From patchwork Thu May 14 19:26: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: 11549595 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 562E6697 for ; Thu, 14 May 2020 19:26:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38C702065F for ; Thu, 14 May 2020 19:26:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J/O/3AAw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727904AbgENT0r (ORCPT ); Thu, 14 May 2020 15:26:47 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38448 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727869AbgENT0q (ORCPT ); Thu, 14 May 2020 15:26:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484405; 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=rY2cYf+JQwIw292enk42+PfnTxsr6TeBeQ3Eoug1TqY=; b=J/O/3AAwz543qHavoGJOOZ6D57jMhbg7CYW0ri/TI3Z8PFYeLlzPS/TE8h4/8xPBhqS9JT WuUlahcQQz0ceEVBDQ2MgeoZy3uhqWpJbDTOfqGzcgaVtbb+sXlVEKZBnz10Ssug3USVam dtujEGjIpw0fySqtppbWylXi8lGq5fc= 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-438-3ZyGTTl2MNCVgZr3BK1Bpg-1; Thu, 14 May 2020 15:26:41 -0400 X-MC-Unique: 3ZyGTTl2MNCVgZr3BK1Bpg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA108872FE0; Thu, 14 May 2020 19:26:40 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5507C5C1D6; Thu, 14 May 2020 19:26:32 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 01/11] x86/access: Fix phys-bits parameter Date: Thu, 14 May 2020 21:26:16 +0200 Message-Id: <20200514192626.9950-2-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Mohammed Gamal Some QEMU versions don't support setting phys-bits argument directly. This causes breakage to Travis CI. Work around the bug by setting host-phys-bits=on Fixes: 1a296ac170f ("x86: access: Add tests for reserved bits of guest physical address") Reported-by: Thomas Huth Signed-off-by: Mohammed Gamal Tested-by: Thomas Huth Signed-off-by: Thomas Huth --- x86/unittests.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/unittests.cfg b/x86/unittests.cfg index bf0d02e..d43cac2 100644 --- a/x86/unittests.cfg +++ b/x86/unittests.cfg @@ -116,7 +116,7 @@ extra_params = -cpu qemu64,+x2apic,+tsc-deadline -append tscdeadline_immed [access] file = access.flat arch = x86_64 -extra_params = -cpu host,phys-bits=36 +extra_params = -cpu host,host-phys-bits=on,phys-bits=36 [smap] file = smap.flat From patchwork Thu May 14 19:26: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: 11549597 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 7EF17697 for ; Thu, 14 May 2020 19:26:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66FDD20643 for ; Thu, 14 May 2020 19:26:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Jhs9V3FP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727917AbgENT0s (ORCPT ); Thu, 14 May 2020 15:26:48 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:31800 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727896AbgENT0r (ORCPT ); Thu, 14 May 2020 15:26:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484406; 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=/AapBUmkfNYFHQpcUHDMDfwNqslU3LcRYoaC52cFEgg=; b=Jhs9V3FP0eGRH48kVcv+Aklzr+MKgZBvDC9xJDVe3A5hroKVduz6ovjU9K2aRxDDZbtelx nSWoveVFZaixt6ZFQVB8MuJVQA/8R9yaJsvD3OQvNw7uIPEsZwCIwTxRmSk83pnjibS+9V xY9vaTWppYCBJOeJpv8rkanCWgziqis= 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-454-QOHCUL_8M5GjWoMRo-WsxA-1; Thu, 14 May 2020 15:26:44 -0400 X-MC-Unique: QOHCUL_8M5GjWoMRo-WsxA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4BC32474; Thu, 14 May 2020 19:26:43 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A5925C1BE; Thu, 14 May 2020 19:26:41 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 02/11] Fix out-of-tree builds Date: Thu, 14 May 2020 21:26:17 +0200 Message-Id: <20200514192626.9950-3-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 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 Thu May 14 19:26: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: 11549599 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 7A4C7913 for ; Thu, 14 May 2020 19:26:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5515220643 for ; Thu, 14 May 2020 19:26:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IaDZfDN8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727954AbgENT0v (ORCPT ); Thu, 14 May 2020 15:26:51 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20027 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727910AbgENT0v (ORCPT ); Thu, 14 May 2020 15:26:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484410; 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=Z1+cCPr77ZxTZCfVeRFGI2KL+VvU2bdBfuP7xBCYBIQ=; b=IaDZfDN82rAgmDU6ZDqhp7gzLbJoYwsgAEkK59mm/J3nQ1pppfd//Jp8ufXLEHRF2HXRW+ 1ai2nPfnbl+uNqqVlkXd8KGWkwAsEgKyQ/cuO5gPRj65SeFNsAn4Jp5NC+xljEvjYwKyf1 /SOjuNRkqxXV0qGHafn6aXpPPTLugvo= 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-253-DXbUGwLaMfajUCyMxGFAVg-1; Thu, 14 May 2020 15:26:47 -0400 X-MC-Unique: DXbUGwLaMfajUCyMxGFAVg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6C61818FF660; Thu, 14 May 2020 19:26:46 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id C548A5C1BE; Thu, 14 May 2020 19:26:43 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 03/11] x86: avoid multiply defined symbol Date: Thu, 14 May 2020 21:26:18 +0200 Message-Id: <20200514192626.9950-4-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 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 Thu May 14 19:26:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11549601 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 5F9DE697 for ; Thu, 14 May 2020 19:26:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4777C206DC for ; Thu, 14 May 2020 19:26:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="C/lm4Riv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728000AbgENT0y (ORCPT ); Thu, 14 May 2020 15:26:54 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:30890 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727937AbgENT0x (ORCPT ); Thu, 14 May 2020 15:26:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4KZMyFCANHadDSTe3mYiIZm5hahl7Xch/k004NsO2qo=; b=C/lm4RivSQ0WkA5jKvII/0nDUPzkCViX2PdwZdZbjiO2Z6y7KBTGy4ERzx6JQ1PW0xC4U3 EmUylq2k/ZKnAJd2E6kXYeF472+Xm4AKxwQ6Qnb4L5cK/t78H1fSKpxSsQMPpgDiAXXRnX V5PXrY/72FJt8bp/ap4w4nZqY+1V7xw= 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-190-QiP51cBzP-CzK6O74lC4Zg-1; Thu, 14 May 2020 15:26:50 -0400 X-MC-Unique: QiP51cBzP-CzK6O74lC4Zg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 885071005510; Thu, 14 May 2020 19:26:49 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4C775C1BE; Thu, 14 May 2020 19:26:46 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 04/11] Fixes for the umip test Date: Thu, 14 May 2020 21:26:19 +0200 Message-Id: <20200514192626.9950-5-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 7eee294..37f1ab8 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 Thu May 14 19:26: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: 11549603 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 EBB50697 for ; Thu, 14 May 2020 19:26:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D351C2065F for ; Thu, 14 May 2020 19:26:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GuFhU7M2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727998AbgENT05 (ORCPT ); Thu, 14 May 2020 15:26:57 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:59926 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728034AbgENT05 (ORCPT ); Thu, 14 May 2020 15:26:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484416; 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=vu1tn+iAIBpjXO1Y+o5gEzbfnBApw5RJRZbLy4rn9TI=; b=GuFhU7M2O9Ss7BaqTSrsE35kaAzoXJx1FMbBbP1o50bytwVv/i3bRNP9MFVOiwogzo7EdO UZZTgvHU6ct+etstFAVaWTOs9+sorstNUlt0AT3EW26zN7bPvcQGQSScP0r5Z3X9xTKis/ tAuPHf/VyX0cprUt29hltt23l4kE1n4= 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-474-nFHgF98cPvK-T8ascFecwA-1; Thu, 14 May 2020 15:26:54 -0400 X-MC-Unique: nFHgF98cPvK-T8ascFecwA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A1C3872FE1; Thu, 14 May 2020 19:26:53 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10AC25C1BE; Thu, 14 May 2020 19:26:49 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 05/11] Always compile the kvm-unit-tests with -fno-common Date: Thu, 14 May 2020 21:26:20 +0200 Message-Id: <20200514192626.9950-6-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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. 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 Thu May 14 19:26: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: 11549605 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 E9837697 for ; Thu, 14 May 2020 19:27:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7E9E2065F for ; Thu, 14 May 2020 19:27:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iPhADVtb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728084AbgENT1B (ORCPT ); Thu, 14 May 2020 15:27:01 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:42414 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728068AbgENT1B (ORCPT ); Thu, 14 May 2020 15:27:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484420; 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=EE7x2n/yIQY1b6jXYkvSag9LroLzvwnGE1ytGCl9bIM=; b=iPhADVtb8gWI2drrJJ8jOI2rSIxg4gcSpZjAdRK13JorDx16vgchikv2uUCSqUzA+tqj2O /ezjF8DSOQd441f8Wxcfs7D2ienVzQ5ibQ6Q7YCeNjj0KC9A6W54u0RCc9OK3ZjHgauvc7 amCmjRTTfhQ62IrS16zhCv57M2YXi5Y= 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-140-sUdo_T4WN5m4tiGpC6dmQQ-1; Thu, 14 May 2020 15:26:58 -0400 X-MC-Unique: sUdo_T4WN5m4tiGpC6dmQQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D2EF18FF669; Thu, 14 May 2020 19:26:57 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DEFE5C1BE; Thu, 14 May 2020 19:26:54 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 06/11] Fix powerpc issue with the linker from Fedora 32 Date: Thu, 14 May 2020 21:26:21 +0200 Message-Id: <20200514192626.9950-7-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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. 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 Thu May 14 19:26: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: 11549607 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 3D391913 for ; Thu, 14 May 2020 19:27:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C3D32065F for ; Thu, 14 May 2020 19:27:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NBqV5qOa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728093AbgENT1G (ORCPT ); Thu, 14 May 2020 15:27:06 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43938 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728045AbgENT1G (ORCPT ); Thu, 14 May 2020 15:27:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484425; 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=o8rnt7e+9Gl0UnGQXfhXtKLH9lAy/5fTqs/wBF1Q9Qc=; b=NBqV5qOaF7Mdb/RW1EosrX/huJOO6195E/G2kuCRbIw2oXH8RK4gPiMRciScOqfMtMQpha m+PxBub1v5LGZ7uQuFunfWL42Pu7DkNUqRsFgMa7t/dr4ThKr0aMRfiNSrENc4/ruPgMhh g4zyHq/TjY6U21gK0EZ9YEwTbQmY7YE= 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-237-q8n0D7eGMPenzTiQo3AX_w-1; Thu, 14 May 2020 15:27:03 -0400 X-MC-Unique: q8n0D7eGMPenzTiQo3AX_w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9C0318FF661; Thu, 14 May 2020 19:27:02 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF3755C1BE; Thu, 14 May 2020 19:26:57 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 07/11] Update the gitlab-ci to Fedora 32 Date: Thu, 14 May 2020 21:26:22 +0200 Message-Id: <20200514192626.9950-8-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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. 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 Thu May 14 19:26:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11549611 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 44DB3697 for ; Thu, 14 May 2020 19:27:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21FF12065F for ; Thu, 14 May 2020 19:27:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EFwFL3/j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728129AbgENT1J (ORCPT ); Thu, 14 May 2020 15:27:09 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:25219 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728098AbgENT1J (ORCPT ); Thu, 14 May 2020 15:27:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484428; 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=nIMdLxZMn/PQTzyjNGQJxXdDAScW95E/bjh0JAPZKB8=; b=EFwFL3/jakHjswfcy+o8x63dbvduBndX3/86C4MXSJ7o1ZdoVTA7F4Mkz/uZgid9ETYPmG dfZ0nQn0v8qk3VpJnFT6qlcHecERLxTd/KbpfB6MGkJdkDNHkWyQ1XZ0x2oBb2C/DaVWoU gss4PqcBpF9jTO+rBV3I2tnXxWhUKLU= 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-498-pBwNrmziORKK7oyWDtgmsQ-1; Thu, 14 May 2020 15:27:06 -0400 X-MC-Unique: pBwNrmziORKK7oyWDtgmsQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F719107ACCA; Thu, 14 May 2020 19:27:05 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 418545C1BE; Thu, 14 May 2020 19:27:02 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 08/11] x86: use a non-negative number in shift Date: Thu, 14 May 2020 21:26:23 +0200 Message-Id: <20200514192626.9950-9-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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] 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 2f53b8f..be1bddf 100644 --- a/x86/svm_tests.c +++ b/x86/svm_tests.c @@ -844,7 +844,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 Thu May 14 19:26:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11549613 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 6C0A3697 for ; Thu, 14 May 2020 19:27:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 494232065F for ; Thu, 14 May 2020 19:27:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ji+yoSQC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728138AbgENT1N (ORCPT ); Thu, 14 May 2020 15:27:13 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:30790 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728068AbgENT1N (ORCPT ); Thu, 14 May 2020 15:27:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484432; 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=/qqSyStXioAG1RadE9dj7UWYWWFSrYAkUMqp6A6ClJs=; b=Ji+yoSQCnyNxsMMvMykL/rdKe9AGYtWjZALIRrG6J6Ck/xdoiflw0USvJAOpXBKh2ELkKx IZx+gY8Lvyj2JzUbQpxp8EiEoXJEZr8mEPK+LUSM5yXegHJ6Jb1mm8G72oixJk7smFIIvI YTk1XlfDGgXlx3wxQd+FOdaGVQXj5pI= 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-476-cSVLu9zQNNehiYbmMv5deQ-1; Thu, 14 May 2020 15:27:08 -0400 X-MC-Unique: cSVLu9zQNNehiYbmMv5deQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C4FD3100CCC4; Thu, 14 May 2020 19:27:07 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id B21545C1BE; Thu, 14 May 2020 19:27:05 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 09/11] x86: use inline asm to retrieve stack pointer Date: Thu, 14 May 2020 21:26:24 +0200 Message-Id: <20200514192626.9950-10-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 0909adb..dbf5375 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -2135,7 +2135,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"); @@ -3231,7 +3233,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 Thu May 14 19:26:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11549615 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 80C46697 for ; Thu, 14 May 2020 19:27:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DAAE2065C for ; Thu, 14 May 2020 19:27:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="R8ZvsWFV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728182AbgENT1S (ORCPT ); Thu, 14 May 2020 15:27:18 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:54089 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728174AbgENT1S (ORCPT ); Thu, 14 May 2020 15:27:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484437; 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=n4UvJVseBiY31Df4HWIwknp1COnvoobu7zdWwBtzLM4=; b=R8ZvsWFV7pDaAwBXuovS6dKD4AX2+Nlfs5AjqjwU6DBt7+UkXJg2KGEwfcMnOCQKSKzqYk OlL2ib77bKlA991pL0+Nkuxg0OI6hj2FDFZA2PRrS85CRfjp+6ptO5m3JubuFQ4fbYcvkD tow5XVj2fxlGSL+N1or0xpI2YOe1j8w= 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-171-QC1YYUJePr65c6Y9W0xSUQ-1; Thu, 14 May 2020 15:27:13 -0400 X-MC-Unique: QC1YYUJePr65c6Y9W0xSUQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14EEA100CCC0; Thu, 14 May 2020 19:27:12 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5502F5C1BE; Thu, 14 May 2020 19:27:08 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 10/11] vmx_tests: Silence warning from Clang Date: Thu, 14 May 2020 21:26:25 +0200 Message-Id: <20200514192626.9950-11-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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. 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 dbf5375..c38115c 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -8426,7 +8426,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 Thu May 14 19:26:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11549619 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 274BF697 for ; Thu, 14 May 2020 19:27:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0498C2065C for ; Thu, 14 May 2020 19:27:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KN4bDDVB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728227AbgENT1U (ORCPT ); Thu, 14 May 2020 15:27:20 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:48939 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728191AbgENT1U (ORCPT ); Thu, 14 May 2020 15:27:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589484439; 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=+PaQYWYn8bHUvQxqPmgnXPvMwkxGZAfGAiUQ0e3SRuw=; b=KN4bDDVB0bMuqP/2LoqoTJ19+bXhOW+Vwrgvqb6GNoeJR/pnH9OKR2bnYugYJFK/NWiBb4 Uo29TNviL8X6Z8glRZ0I+6RWnm8dOLyc+xaeGYaOZEkLFjnG3kQuKeHiPR6owPEbu10JPt GtzcjXvZMguLwzZtj+a9SDasI3cP6y8= 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-353-hzjHhuGcPtO65kOAudSq0A-1; Thu, 14 May 2020 15:27:17 -0400 X-MC-Unique: hzjHhuGcPtO65kOAudSq0A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9464F1005510; Thu, 14 May 2020 19:27:16 +0000 (UTC) Received: from thuth.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id B19F35C1BE; Thu, 14 May 2020 19:27:13 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Laurent Vivier , Drew Jones , Bill Wendling Subject: [kvm-unit-tests PATCH 11/11] Compile the kvm-unit-tests also with Clang Date: Thu, 14 May 2020 21:26:26 +0200 Message-Id: <20200514192626.9950-12-thuth@redhat.com> In-Reply-To: <20200514192626.9950-1-thuth@redhat.com> References: <20200514192626.9950-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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. 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