From patchwork Tue Jun 16 18:56:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6F9D6A2 for ; Tue, 16 Jun 2020 18:56:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4DCE207C4 for ; Tue, 16 Jun 2020 18:56:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Wn8VUZkR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730301AbgFPS4d (ORCPT ); Tue, 16 Jun 2020 14:56:33 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:20072 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729994AbgFPS4b (ORCPT ); Tue, 16 Jun 2020 14:56:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=QG4GcvBqyaMGQs6iL8I7UP/KbYkVhSk8WJz8geiWD8w=; b=Wn8VUZkRFImC8nVawRnoHcsIbEG8eKAIHOaCYF5Y7YGq+TjkupwrOPShnJEJzdmsrkfYO0 kA4VRp0fhd2EFC2n0kilqv2jspVCsdXGQ3CBvRa2pzzLhej7dD4zfp2Vdq8CyBTNi/ENOj CFtinjcypHtPSpRpF0wdyrMSr2ywRlg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1-YCtvSGvoOJyIIn9s_dqwXQ-1; Tue, 16 Jun 2020 14:56:28 -0400 X-MC-Unique: YCtvSGvoOJyIIn9s_dqwXQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D55CB80F5EA for ; Tue, 16 Jun 2020 18:56:26 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAB207CAA8; Tue, 16 Jun 2020 18:56:25 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Andrew Jones Subject: [kvm-unit-tests PULL 01/12] Fix out-of-tree builds Date: Tue, 16 Jun 2020 20:56:11 +0200 Message-Id: <20200616185622.8644-2-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Andrew Jones Since b16df9ee5f3b out-of-tree builds have been broken because we started validating the newly user-configurable $erratatxt file before linking it into the build dir. We fix this not by moving the validation, but by removing the linking and instead using the full path of the $erratatxt file. This allows one to keep that file separate from the src and build dirs. Fixes: b16df9ee5f3b ("arch-run: Add reserved variables to the default environ") Reported-by: Thomas Huth Signed-off-by: Andrew Jones Message-Id: <20200511070641.23492-1-drjones@redhat.com> Signed-off-by: Thomas Huth --- configure | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 5d2cd90..f9d030f 100755 --- a/configure +++ b/configure @@ -17,7 +17,7 @@ environ_default=yes u32_long= vmm="qemu" errata_force=0 -erratatxt="errata.txt" +erratatxt="$srcdir/errata.txt" usage() { cat <<-EOF @@ -89,7 +89,8 @@ while [[ "$1" = -* ]]; do environ_default=no ;; --erratatxt) - erratatxt="$arg" + erratatxt= + [ "$arg" ] && erratatxt=$(eval realpath "$arg") ;; --help) usage @@ -169,9 +170,6 @@ if test ! -e Makefile; then echo "linking scripts..." ln -sf "$srcdir/scripts" - - echo "linking errata.txt..." - ln -sf "$srcdir/errata.txt" fi # link lib/asm for the architecture From patchwork Tue Jun 16 18:56:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608451 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E1726A2 for ; Tue, 16 Jun 2020 18:56:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBD62207C4 for ; Tue, 16 Jun 2020 18:56:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="V5RFi+2t" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730139AbgFPS4c (ORCPT ); Tue, 16 Jun 2020 14:56:32 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:44486 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730082AbgFPS4b (ORCPT ); Tue, 16 Jun 2020 14:56:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=7sORUDwgRVhhtfiGbJgwh7emKoMOBNl3hnH5dpBlRZc=; b=V5RFi+2tVWGVCjPb3Lgb3YKrl8jWwApqzVSs1KQ/McSA2WjIWgWr7DgwD/0o15NyVFNcQJ JHwxk9BwAO+F1VWCNQrD+8WnndiDDDaLeNADgj0KKFmKNqTmch9O6Apm3C84qiz/Jnh0jO vD0fJeWHp8KRksEWVAZcjWl32NQI2jQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-218-qQBRkPb3OrmiKxx0muK7fA-1; Tue, 16 Jun 2020 14:56:29 -0400 X-MC-Unique: qQBRkPb3OrmiKxx0muK7fA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 19B35134ED for ; Tue, 16 Jun 2020 18:56:28 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40ED57CAA8; Tue, 16 Jun 2020 18:56:27 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Subject: [kvm-unit-tests PULL 02/12] x86: avoid multiple defined symbol Date: Tue, 16 Jun 2020 20:56:12 +0200 Message-Id: <20200616185622.8644-3-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Paolo Bonzini Fedora 32 croaks about a symbol that is defined twice, fix it. Reported-by: Dr. David Alan Gilbert Signed-off-by: Paolo Bonzini Message-Id: <20200511165959.42442-1-pbonzini@redhat.com> Signed-off-by: Thomas Huth --- lib/x86/fault_test.c | 2 +- lib/x86/usermode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/x86/fault_test.c b/lib/x86/fault_test.c index 078dae3..e15a218 100644 --- a/lib/x86/fault_test.c +++ b/lib/x86/fault_test.c @@ -1,6 +1,6 @@ #include "fault_test.h" -jmp_buf jmpbuf; +static jmp_buf jmpbuf; static void restore_exec_to_jmpbuf(void) { diff --git a/lib/x86/usermode.c b/lib/x86/usermode.c index f01ad9b..f032523 100644 --- a/lib/x86/usermode.c +++ b/lib/x86/usermode.c @@ -14,7 +14,7 @@ #define USERMODE_STACK_SIZE 0x2000 #define RET_TO_KERNEL_IRQ 0x20 -jmp_buf jmpbuf; +static jmp_buf jmpbuf; static void restore_exec_to_jmpbuf(void) { From patchwork Tue Jun 16 18:56:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608457 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8E28912 for ; Tue, 16 Jun 2020 18:56:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A270920810 for ; Tue, 16 Jun 2020 18:56:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O14niA+m" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730396AbgFPS4h (ORCPT ); Tue, 16 Jun 2020 14:56:37 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:35609 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730082AbgFPS4c (ORCPT ); Tue, 16 Jun 2020 14:56:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Lz8dTB+N9OTpHHu5R1TNOSXQkrZEQyo4bOoaenoe9gw=; b=O14niA+mYDF52kOHOpwllelb/tm97FtJ9Lhwhh4IbsRY9zPbitd63xBM3Jykrxzrs8cbxY 1fNoTvumfBzbNnU/DH9diX8HPbRMRlsa/mugM/CC0Pp6z0H0U39/om88szTGoEl4abcTcA Ec/gmgr1Y7sghJauN9WbhUbKy8/XrZ0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-jj49tza1OD2JfO83uQt0Nw-1; Tue, 16 Jun 2020 14:56:30 -0400 X-MC-Unique: jj49tza1OD2JfO83uQt0Nw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 513E410059BA for ; Tue, 16 Jun 2020 18:56:29 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7898A7CAA8; Tue, 16 Jun 2020 18:56:28 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Subject: [kvm-unit-tests PULL 03/12] Fixes for the umip test Date: Tue, 16 Jun 2020 20:56:13 +0200 Message-Id: <20200616185622.8644-4-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org When compiling umip.c with -O2 instead of -O1, there are currently two problems. First, the compiler complains: x86/umip.c: In function ‘do_ring3’: x86/umip.c:162:37: error: array subscript 4096 is above array bounds of ‘unsigned char[4096]’ [-Werror=array-bounds] [user_stack_top]"m"(user_stack[sizeof user_stack]), ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ This can be fixed by initializing the stack to point to one of the last bytes of the array instead. The second problem is that some tests are failing - and this is due to the fact that the GP_ASM macro uses inline asm without the "volatile" keyword - so that the compiler reorders this code in certain cases where it should not. Fix it by adding "volatile" here. Message-Id: <20200122160944.29750-1-thuth@redhat.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Thomas Huth --- x86/umip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x86/umip.c b/x86/umip.c index afb373d..c5700b3 100644 --- a/x86/umip.c +++ b/x86/umip.c @@ -22,7 +22,8 @@ static void gp_handler(struct ex_regs *regs) #define GP_ASM(stmt, in, clobber) \ - asm ("mov" W " $1f, %[expected_rip]\n\t" \ + asm volatile ( \ + "mov" W " $1f, %[expected_rip]\n\t" \ "movl $2f-1f, %[skip_count]\n\t" \ "1: " stmt "\n\t" \ "2: " \ @@ -159,7 +160,8 @@ static int do_ring3(void (*fn)(const char *), const char *arg) : [ret] "=&a" (ret) : [user_ds] "i" (USER_DS), [user_cs] "i" (USER_CS), - [user_stack_top]"m"(user_stack[sizeof user_stack]), + [user_stack_top]"m"(user_stack[sizeof(user_stack) - + sizeof(long)]), [fn]"r"(fn), [arg]"D"(arg), [kernel_ds]"i"(KERNEL_DS), From patchwork Tue Jun 16 18:56:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608459 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 445BC14E3 for ; Tue, 16 Jun 2020 18:56:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E98320810 for ; Tue, 16 Jun 2020 18:56:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bbrH74io" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730421AbgFPS4i (ORCPT ); Tue, 16 Jun 2020 14:56:38 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:47736 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729994AbgFPS4e (ORCPT ); Tue, 16 Jun 2020 14:56:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=gI8VGlGSnMQyE03VP9aqGEe1Ss4f/jEXIJkRru5nAI0=; b=bbrH74ioRNDpfWMWmwgBMvrGOSpEzDagMJPAMoJYkKlhEVbF1rQVysukm+I0h4FGbRNMIB LdIw7PNn5tAt0IHPVaTvYZZ0DAtvb5fIYyGceZ4YEVFivmPosj8ot2isdPM/GBmL/okCOy bNcPMjAlfZgvhSWtqFl184+SnEeQVQc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-227-bp5IqzFENWC7hdZHdySVVw-1; Tue, 16 Jun 2020 14:56:31 -0400 X-MC-Unique: bp5IqzFENWC7hdZHdySVVw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 890F110AB64C for ; Tue, 16 Jun 2020 18:56:30 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id B01037CAA8; Tue, 16 Jun 2020 18:56:29 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Subject: [kvm-unit-tests PULL 04/12] Always compile the kvm-unit-tests with -fno-common Date: Tue, 16 Jun 2020 20:56:14 +0200 Message-Id: <20200616185622.8644-5-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The new GCC v10 uses -fno-common by default. To avoid that we commit code that declares global variables twice and thus fails to link with the latest version, we should also compile with -fno-common when using older versions of the compiler. However, this now also means that we can not play the trick with the common auxinfo struct anymore. Thus declare it as extern in the header now and link auxinfo.c on x86, too. Message-Id: <20200514192626.9950-6-thuth@redhat.com> Signed-off-by: Thomas Huth --- Makefile | 2 +- lib/auxinfo.h | 3 +-- x86/Makefile.common | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 754ed65..3ff2f91 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ include $(SRCDIR)/$(TEST_DIR)/Makefile cc-option = $(shell if $(CC) -Werror $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) -COMMON_CFLAGS += -g $(autodepend-flags) -fno-strict-aliasing +COMMON_CFLAGS += -g $(autodepend-flags) -fno-strict-aliasing -fno-common COMMON_CFLAGS += -Wall -Wwrite-strings -Wempty-body -Wuninitialized COMMON_CFLAGS += -Wignored-qualifiers -Werror diff --git a/lib/auxinfo.h b/lib/auxinfo.h index 08b96f8..a46a1e6 100644 --- a/lib/auxinfo.h +++ b/lib/auxinfo.h @@ -13,7 +13,6 @@ struct auxinfo { unsigned long flags; }; -/* No extern! Define a common symbol. */ -struct auxinfo auxinfo; +extern struct auxinfo auxinfo; #endif #endif diff --git a/x86/Makefile.common b/x86/Makefile.common index ab67ca0..2ea9c9f 100644 --- a/x86/Makefile.common +++ b/x86/Makefile.common @@ -5,6 +5,7 @@ all: directories test_cases cflatobjs += lib/pci.o cflatobjs += lib/pci-edu.o cflatobjs += lib/alloc.o +cflatobjs += lib/auxinfo.o cflatobjs += lib/vmalloc.o cflatobjs += lib/alloc_page.o cflatobjs += lib/alloc_phys.o From patchwork Tue Jun 16 18:56:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608461 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8F916A2 for ; Tue, 16 Jun 2020 18:56:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9B3920810 for ; Tue, 16 Jun 2020 18:56:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Rl9iHZcy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730436AbgFPS4i (ORCPT ); Tue, 16 Jun 2020 14:56:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56768 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730312AbgFPS4f (ORCPT ); Tue, 16 Jun 2020 14:56:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=6OpF2PS0+M7A0UkOIJJrI29Srt4ywHknxIiHcFjvmY8=; b=Rl9iHZcysq1BJk1LLJtkbB7YiX2zmsL15J/9YOBldTpycHs0Ivjxn9GQV5B0gSuZdFt+Fk JQF5PkPCyTsU4acXhEXPNbkjMYZGeV3euwo0eOu9YjgzZO/PclnJ/OALDNNjTYm4X8KK29 POAoANgMzdyTQF/xh6pLhBd6zZIKp40= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-36-agPJjcitNg6tXZztgXZpeg-1; Tue, 16 Jun 2020 14:56:32 -0400 X-MC-Unique: agPJjcitNg6tXZztgXZpeg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B76EE81EE22 for ; Tue, 16 Jun 2020 18:56:31 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id E90F7891C2; Tue, 16 Jun 2020 18:56:30 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Subject: [kvm-unit-tests PULL 05/12] Fix powerpc issue with the linker from Fedora 32 Date: Tue, 16 Jun 2020 20:56:15 +0200 Message-Id: <20200616185622.8644-6-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The linker from Fedora 32 complains: powerpc64-linux-gnu-ld: powerpc/selftest.elf: error: PHDR segment not covered by LOAD segment Let's introduce some fake PHDRs to the linker script to get this working again. Message-Id: <20200514192626.9950-7-thuth@redhat.com> Signed-off-by: Thomas Huth --- powerpc/flat.lds | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/powerpc/flat.lds b/powerpc/flat.lds index 53221e8..5eed368 100644 --- a/powerpc/flat.lds +++ b/powerpc/flat.lds @@ -1,7 +1,17 @@ +PHDRS +{ + text PT_LOAD FLAGS(5); + data PT_LOAD FLAGS(6); +} + SECTIONS { - .text : { *(.init) *(.text) *(.text.*) } + .text : { + *(.init) + *(.text) + *(.text.*) + } :text . = ALIGN(64K); etext = .; .opd : { *(.opd) } @@ -19,9 +29,12 @@ SECTIONS .data : { *(.data) *(.data.rel*) - } + } :data . = ALIGN(16); - .rodata : { *(.rodata) *(.rodata.*) } + .rodata : { + *(.rodata) + *(.rodata.*) + } :data . = ALIGN(16); .bss : { *(.bss) } . = ALIGN(256); From patchwork Tue Jun 16 18:56:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608465 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8016D912 for ; Tue, 16 Jun 2020 18:56:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6032E207E8 for ; Tue, 16 Jun 2020 18:56:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UbkX4EU5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730320AbgFPS4n (ORCPT ); Tue, 16 Jun 2020 14:56:43 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:53628 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730341AbgFPS4g (ORCPT ); Tue, 16 Jun 2020 14:56:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=dp12gYHNFVGYlFsmwoQZhifxQecCGX/Lk1TlV4n+QT8=; b=UbkX4EU5sPPgI5RWcUGTHvw8jXpBaz85tzYk1Zqy1IgZCoPYxzUf0XWmEK9V92GvVA5tuo 8z1hSueDm1S/MlP5LAh1Rb/hyEcJDOayLINpXDwMVNK0iZ2oSTdTetw6VA1T+Yfr0qAlFk AV43JtzuqwdAvKzropomBWwP1vnSNN0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-293-XgicGo-6OGqHMAgYb8Ot0Q-1; Tue, 16 Jun 2020 14:56:33 -0400 X-MC-Unique: XgicGo-6OGqHMAgYb8Ot0Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03EE210059C7 for ; Tue, 16 Jun 2020 18:56:33 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BA917CAA8; Tue, 16 Jun 2020 18:56:31 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Subject: [kvm-unit-tests PULL 06/12] Update the gitlab-ci to Fedora 32 Date: Tue, 16 Jun 2020 20:56:16 +0200 Message-Id: <20200616185622.8644-7-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Fedora 30 is end of life, let's use the version 32 instead. Unfortunately, we have to disable taskswitch2 in the gitlab-ci now. It does not seem to work anymore with the latest version of gcc and/or QEMU. We still check it in the travis-ci, though, so until somebody has some spare time to debug this issue, it should be ok to disable it here. Message-Id: <20200514192626.9950-8-thuth@redhat.com> Signed-off-by: Thomas Huth --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3093239..13e1a1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: fedora:30 +image: fedora:32 before_script: - dnf update -y @@ -77,6 +77,6 @@ build-i386: - ./configure --arch=i386 - make -j2 - ACCEL=tcg ./run_tests.sh - cmpxchg8b eventinj port80 setjmp sieve tsc taskswitch taskswitch2 umip + cmpxchg8b eventinj port80 setjmp sieve tsc taskswitch umip | tee results.txt - if grep -q FAIL results.txt ; then exit 1 ; fi From patchwork Tue Jun 16 18:56:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608463 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E635E6A2 for ; Tue, 16 Jun 2020 18:56:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4F59207C4 for ; Tue, 16 Jun 2020 18:56:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iTB3psPE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730371AbgFPS4l (ORCPT ); Tue, 16 Jun 2020 14:56:41 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:26113 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730487AbgFPS4k (ORCPT ); Tue, 16 Jun 2020 14:56:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=HkIZVS3LrWgv6Z1qkiTaYOJCFvxEZGb5PZvGUy2JAtU=; b=iTB3psPEtNrZqSV8k4nXOLvkTGVfk7ttqRHfTyCBfInoHZlldbFcLjwGTGPlkoAGEx0hzB N8Uspv1hN24WlNG/mFm7JyC1jP0lP9aCwLGLzmX8HUSzUk12RTidusAW9Uvl3Vr5he/NnK LVtvwCl6Hz1MFf8rs/2QEZiGQI8SdxA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-b8USvjPbO-W-g9LQlvknDQ-1; Tue, 16 Jun 2020 14:56:35 -0400 X-MC-Unique: b8USvjPbO-W-g9LQlvknDQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6EA84100945B; Tue, 16 Jun 2020 18:56:34 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63AF57CAA8; Tue, 16 Jun 2020 18:56:33 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Bill Wendling Subject: [kvm-unit-tests PULL 07/12] x86: use a non-negative number in shift Date: Tue, 16 Jun 2020 20:56:17 +0200 Message-Id: <20200616185622.8644-8-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Bill Wendling Shifting a negative number is undefined. Clang complains about it: x86/svm.c:1131:38: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value] test->vmcb->control.tsc_offset = TSC_OFFSET_VALUE; Using "~0ull" results in identical asm code: before: movabsq $-281474976710656, %rsi after: movabsq $-281474976710656, %rsi Signed-off-by: Bill Wendling [thuth: Rebased to master - code is in svm_tests.c instead of svm.c now] Message-Id: <20200514192626.9950-9-thuth@redhat.com> Signed-off-by: Thomas Huth --- x86/svm_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/svm_tests.c b/x86/svm_tests.c index c1abd55..a645d66 100644 --- a/x86/svm_tests.c +++ b/x86/svm_tests.c @@ -890,7 +890,7 @@ static bool npt_rw_l1mmio_check(struct svm_test *test) } #define TSC_ADJUST_VALUE (1ll << 32) -#define TSC_OFFSET_VALUE (-1ll << 48) +#define TSC_OFFSET_VALUE (~0ull << 48) static bool ok; static void tsc_adjust_prepare(struct svm_test *test) From patchwork Tue Jun 16 18:56:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608471 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E23B14E3 for ; Tue, 16 Jun 2020 18:56:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EADD020882 for ; Tue, 16 Jun 2020 18:56:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h9vwgFO0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730511AbgFPS4u (ORCPT ); Tue, 16 Jun 2020 14:56:50 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:45516 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730585AbgFPS4s (ORCPT ); Tue, 16 Jun 2020 14:56:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=1sXdCsLD/wNLgcX2hxdbu2F9Htj/d109TbAOyp+XA8Q=; b=h9vwgFO0spv6cym0fRdxlxwSa8pVaHC+9NJ44GoGL0BPLcdmCarN+T+oEkfrdTszJNT00i aedeAhpHkoG2YzRcg4szdhBxFINcoE+yS8Rj7qOgOzOwSFTcpnW5JLr9Vu6T0h+c3rqlGF 8468yNpxs1woFl4CXam2Y4qpsiM+wrI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-158-idPy71MYNWOngTFwnjonpA-1; Tue, 16 Jun 2020 14:56:39 -0400 X-MC-Unique: idPy71MYNWOngTFwnjonpA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8611580F5FA; Tue, 16 Jun 2020 18:56:38 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD7127CAA8; Tue, 16 Jun 2020 18:56:34 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Bill Wendling Subject: [kvm-unit-tests PULL 08/12] x86: use inline asm to retrieve stack pointer Date: Tue, 16 Jun 2020 20:56:18 +0200 Message-Id: <20200616185622.8644-9-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Bill Wendling According to GCC's documentation, the only supported use for specifying registers for local variables is "to specify registers for input and output operands when calling Extended asm." Using it as a shortcut to get the value in a register isn't guaranteed to work, and clang complains that the variable is uninitialized. Signed-off-by: Bill Wendling Message-Id: <20191030210419.213407-7-morbo@google.com> Signed-off-by: Thomas Huth --- x86/vmx_tests.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index 68f93d3..fcd97a1 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -2253,7 +2253,9 @@ static void into_guest_main(void) .offset = (uintptr_t)&&into, .selector = KERNEL_CS32, }; - register uintptr_t rsp asm("rsp"); + uintptr_t rsp; + + asm volatile ("mov %%rsp, %0" : "=r"(rsp)); if (fp.offset != (uintptr_t)&&into) { printf("Code address too high.\n"); @@ -3349,7 +3351,9 @@ static void try_compat_invvpid(void *unused) .offset = (uintptr_t)&&invvpid, .selector = KERNEL_CS32, }; - register uintptr_t rsp asm("rsp"); + uintptr_t rsp; + + asm volatile ("mov %%rsp, %0" : "=r"(rsp)); TEST_ASSERT_MSG(fp.offset == (uintptr_t)&&invvpid, "Code address too high."); From patchwork Tue Jun 16 18:56:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608467 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24596912 for ; Tue, 16 Jun 2020 18:56:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04658207E8 for ; Tue, 16 Jun 2020 18:56:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QO/rPzYA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730341AbgFPS4o (ORCPT ); Tue, 16 Jun 2020 14:56:44 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:29033 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730337AbgFPS4n (ORCPT ); Tue, 16 Jun 2020 14:56:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=p+mkbEnudir9dIPe3RaAA9y7QvMIFQSz5R+sX80GQrA=; b=QO/rPzYAdQ9IdJOknSszxhLzbXRSSgMK8MueztPj+XJ9flF12GCdiWzil0N3P9Pk4oUFqT G8fq1aojQkd4GiR212lHKCq1BlWIPEbRaIzl0dZjhDNTq/ugedrNAxNiIOziEknG4J4AZI ElgvLGAoY9LTYh5nw/7dnjXF94sS1iY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-fq_FBSn4N465s_xz9owe2Q-1; Tue, 16 Jun 2020 14:56:40 -0400 X-MC-Unique: fq_FBSn4N465s_xz9owe2Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A49091009618 for ; Tue, 16 Jun 2020 18:56:39 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB2A87CAA8; Tue, 16 Jun 2020 18:56:38 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Subject: [kvm-unit-tests PULL 09/12] vmx_tests: Silence warning from Clang Date: Tue, 16 Jun 2020 20:56:19 +0200 Message-Id: <20200616185622.8644-10-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Clang complains: x86/vmx_tests.c:8429:40: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare] vmx_preemption_timer_zero_inject_db(1 << DB_VECTOR); ^ Looking at the code, the "1 << DB_VECTOR" is done within the function vmx_preemption_timer_zero_inject_db() indeed: vmcs_write(EXC_BITMAP, intercept_db ? 1 << DB_VECTOR : 0); ... so using "true" as parameter for the function should be appropriate here. Message-Id: <20200514192626.9950-11-thuth@redhat.com> Signed-off-by: Thomas Huth --- x86/vmx_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index fcd97a1..36e94fa 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -8544,7 +8544,7 @@ static void vmx_preemption_timer_zero_test(void) * an event that you injected. */ vmx_set_test_stage(1); - vmx_preemption_timer_zero_inject_db(1 << DB_VECTOR); + vmx_preemption_timer_zero_inject_db(true); vmx_preemption_timer_zero_expect_preempt_at_rip(db_fault_address); vmx_preemption_timer_zero_advance_past_vmcall(); From patchwork Tue Jun 16 18:56:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608475 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF1116A2 for ; Tue, 16 Jun 2020 18:56:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD25B207E8 for ; Tue, 16 Jun 2020 18:56:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KKkorSO7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730466AbgFPS4v (ORCPT ); Tue, 16 Jun 2020 14:56:51 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:60822 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730564AbgFPS4r (ORCPT ); Tue, 16 Jun 2020 14:56:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=wRxffG2T1M8BwN6SCZlk4oZyZzZlp0cjW2MQ3OpWouU=; b=KKkorSO7zwv0dsVZPriwkHeeWTASFBX36BQqdQ63l+r35RHMtOms/150chNCMpQEtN2E2m rg2NDba/KcVy6WRyp4UYmTOiM2xAMSODNkK/xpL4ZUppypcxpqwxLM0aGebnaWqUYQsVyh 2uC7Teul2VnCvNmn+p/LfG47uMHou9M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-157-KWkFFZS2NQK9B3kCPxdXDg-1; Tue, 16 Jun 2020 14:56:42 -0400 X-MC-Unique: KWkFFZS2NQK9B3kCPxdXDg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDBED18A8228 for ; Tue, 16 Jun 2020 18:56:40 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F8F27CAA8; Tue, 16 Jun 2020 18:56:39 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Subject: [kvm-unit-tests PULL 10/12] Compile the kvm-unit-tests also with Clang Date: Tue, 16 Jun 2020 20:56:20 +0200 Message-Id: <20200616185622.8644-11-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org To get some more test coverage, let's check compilation with Clang, too. Message-Id: <20200514192626.9950-12-thuth@redhat.com> Signed-off-by: Thomas Huth --- .gitlab-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 13e1a1f..3af53f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -80,3 +80,16 @@ build-i386: cmpxchg8b eventinj port80 setjmp sieve tsc taskswitch umip | tee results.txt - if grep -q FAIL results.txt ; then exit 1 ; fi + +build-clang: + script: + - dnf install -y qemu-system-x86 clang + - ./configure --arch=x86_64 --cc=clang + - make -j2 + - ACCEL=tcg ./run_tests.sh + smptest smptest3 vmexit_cpuid vmexit_mov_from_cr8 + vmexit_mov_to_cr8 vmexit_inl_pmtimer vmexit_ipi vmexit_ipi_halt + vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed + eventinj msr port80 setjmp syscall tsc rmap_chain umip intel_iommu + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt From patchwork Tue Jun 16 18:56:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608469 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B6AF6A2 for ; Tue, 16 Jun 2020 18:56:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B49C20810 for ; Tue, 16 Jun 2020 18:56:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gzsgxA2I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730312AbgFPS4r (ORCPT ); Tue, 16 Jun 2020 14:56:47 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:41557 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730463AbgFPS4p (ORCPT ); Tue, 16 Jun 2020 14:56:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=Egwvk/keyW7bpl+kT1M4wcmKcL4bNR6jVz3e7BvACgA=; b=gzsgxA2IJ+1alPUKpAVVN2JO/gCyO1j27oe+8XdfaBCrpT3NhL1/HwHazYeB7eAbbAuRTG mF5kEjQ41AKTbKslpl56XYpgApOyBt96RrkQNGBBuZuyKDiNmhpZaQ8/Q6GP0qEj3op5Pg s79ob8pnbXYv5iwpdhwQ8v31TW9TZdo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-109-8dSTDQ4XP7-iu4BISQ-lbg-1; Tue, 16 Jun 2020 14:56:42 -0400 X-MC-Unique: 8dSTDQ4XP7-iu4BISQ-lbg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CF145AECA for ; Tue, 16 Jun 2020 18:56:42 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 476EA7CAB0; Tue, 16 Jun 2020 18:56:41 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Subject: [kvm-unit-tests PULL 11/12] x86: disable SSE on 32-bit hosts Date: Tue, 16 Jun 2020 20:56:21 +0200 Message-Id: <20200616185622.8644-12-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Paolo Bonzini On 64-bit hosts we are disabling SSE and SSE2. Depending on the compiler however it may use movq instructions for 64-bit transfers even when targeting 32-bit processors; when CR4.OSFXSR is not set, this results in an undefined opcode exception, so tell the compiler to avoid those instructions on 32-bit hosts as well. Signed-off-by: Paolo Bonzini Message-Id: <20200616140217.104362-1-pbonzini@redhat.com> Signed-off-by: Thomas Huth --- x86/Makefile.i386 | 1 + 1 file changed, 1 insertion(+) diff --git a/x86/Makefile.i386 b/x86/Makefile.i386 index d801b80..be9d6bc 100644 --- a/x86/Makefile.i386 +++ b/x86/Makefile.i386 @@ -1,6 +1,7 @@ cstart.o = $(TEST_DIR)/cstart.o bits = 32 ldarch = elf32-i386 +COMMON_CFLAGS += -mno-sse -mno-sse2 cflatobjs += lib/x86/setjmp32.o From patchwork Tue Jun 16 18:56:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11608473 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9AD626A2 for ; Tue, 16 Jun 2020 18:56:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AF5F207C4 for ; Tue, 16 Jun 2020 18:56:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZgVbHv7x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730621AbgFPS4s (ORCPT ); Tue, 16 Jun 2020 14:56:48 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:34965 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730549AbgFPS4r (ORCPT ); Tue, 16 Jun 2020 14:56:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592333806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=m8xQB6mQZC1dBMukO1QKy6l2+Gq6ZtFVdy6w67HPVeU=; b=ZgVbHv7xRuB96NEDMVZz8VY2VH6GlbBigglPsrhBt/bES9vC7yTasR8wp3pAPJYzhLZLWH uQVJQkLqdy+Q2ABVn43uzJaz1M9ZTAOBGVVcld8/gmaTO1qmfK9STLsRAZV9z+RoLBy6fp Nw3DDwsKLOhRd5DDKp/jj0rVyVfkBZU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-440-DB-JvC8ANOemVURQ4x3gFw-1; Tue, 16 Jun 2020 14:56:44 -0400 X-MC-Unique: DB-JvC8ANOemVURQ4x3gFw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 719C880F5D5; Tue, 16 Jun 2020 18:56:43 +0000 (UTC) Received: from thuth.com (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 662A37CAA8; Tue, 16 Jun 2020 18:56:42 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 12/12] s390x: stsi: Make output tap13 compatible Date: Tue, 16 Jun 2020 20:56:22 +0200 Message-Id: <20200616185622.8644-13-thuth@redhat.com> In-Reply-To: <20200616185622.8644-1-thuth@redhat.com> References: <20200616185622.8644-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank In tap13 output # is a special character and only "skip" and "todo" are allowed to come after it. Let's appease our CI environment and replace # with "count". Signed-off-by: Janosch Frank Message-Id: <20200525084340.1454-1-frankja@linux.ibm.com> Signed-off-by: Thomas Huth --- s390x/stsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/s390x/stsi.c b/s390x/stsi.c index 66b4257..b81cea7 100644 --- a/s390x/stsi.c +++ b/s390x/stsi.c @@ -129,11 +129,11 @@ static void test_3_2_2(void) } report(!memcmp(data->vm[0].uuid, uuid, sizeof(uuid)), "uuid"); - report(data->vm[0].conf_cpus == smp_query_num_cpus(), "cpu # configured"); + report(data->vm[0].conf_cpus == smp_query_num_cpus(), "cpu count configured"); report(data->vm[0].total_cpus == data->vm[0].reserved_cpus + data->vm[0].conf_cpus, - "cpu # total == conf + reserved"); - report(data->vm[0].standby_cpus == 0, "cpu # standby"); + "cpu count total == conf + reserved"); + report(data->vm[0].standby_cpus == 0, "cpu count standby"); report(!memcmp(data->vm[0].name, vm_name, sizeof(data->vm[0].name)), "VM name == kvm-unit-test");