From nobody Sat Apr 27 11:24:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616164916; cv=none; d=zohomail.com; s=zohoarc; b=lGDbb6SUE8AmheMa3R3weXk1AUDNCCybBTtJ5cuZDftC34STfgXtcEF/OxvhZNW4NsDeaWji+iYOr8J0WlXg05Pr8RuDz0oLHx7NmLZ9GTbHGJGh8qR3DKjNGPxpyXE7sfHnbGUMaCnd+7RrJL4kqK+5AsMKokv3KCw+Br7DmS8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616164916; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NluLGvW8zCpuv1gj0odoyxh2KQT5xpwkxHS0QKRCSwM=; b=nRTOWbTEKuzcrjSr34PsQIYApnKhsNg9d4KCpxV0jwimmpgtwcHlzXAiYcaY2DUZqvXrId/pWUyFaSqclXHrtyAwFA2H44Nfg5Q1nw+HXfBZ5gkB+rp0HNgCiZg7yl4DydtYhsd0H1xqUKw1T49Xu0j8h9uZ0NcW8VfXToefoKA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616164916217514.7214599700694; Fri, 19 Mar 2021 07:41:56 -0700 (PDT) Received: from localhost ([::1]:39164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNGK1-0006pT-7Z for importer@patchew.org; Fri, 19 Mar 2021 10:41:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHk-0005Jf-Gk for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHg-0004o5-LV for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:32 -0400 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-211-9y2DI5KdPtmvjpzOvk4bOw-1; Fri, 19 Mar 2021 10:39:26 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 182B788EF03 for ; Fri, 19 Mar 2021 14:39:25 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAEB160C04 for ; Fri, 19 Mar 2021 14:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616164767; 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=NluLGvW8zCpuv1gj0odoyxh2KQT5xpwkxHS0QKRCSwM=; b=EGE+4tQ/g7v6/BzTqCx5X7TKFAN6w0G+xBKLy8QMrX4HreIfQ/pNVuDdgJzf3/3LlCyoGu lDETfAuAsBExyiYd5Kk7EjGRiFzL+4j/5wYxI1uUQfo/rl2bk+VoXftea/P8lsgV87yAxW +RPqbxBi3RjQNzf0F+D1sk+11usF9io= X-MC-Unique: 9y2DI5KdPtmvjpzOvk4bOw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 1/8] qom: use qemu_printf to print help for user-creatable objects Date: Fri, 19 Mar 2021 10:39:17 -0400 Message-Id: <20210319143924.2173798-2-pbonzini@redhat.com> In-Reply-To: <20210319143924.2173798-1-pbonzini@redhat.com> References: <20210319143924.2173798-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Since we have added help support for object_add, the help is printed on stdout. Switch to qemu_printf so that it goes to the monitor. Signed-off-by: Paolo Bonzini --- qom/object_interfaces.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 7661270b98..11ad2e2078 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -13,6 +13,7 @@ #include "qemu/option.h" #include "qapi/opts-visitor.h" #include "qemu/config-file.h" +#include "qemu/qemu-print.h" =20 bool user_creatable_complete(UserCreatable *uc, Error **errp) { --=20 2.26.2 From nobody Sat Apr 27 11:24:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616164926; cv=none; d=zohomail.com; s=zohoarc; b=LsZyA0OL1rpph65lu3Va7HLARe4LQrEIVbSBbaIl3nqq25VzalaVjADQyib0TmAuBXE64cp6JrbXGeJD3lq4od760JEpe+TffJlYb66KSFIcmdIPfSaW33D6o2CcnBxAdR52dzlgd1WHInUqQqFvbe2d5g0ts9mlJlMy9+pVxi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616164926; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AND/vXxJw3vrWkioqSg3Zz/4dLo3/PhPwrKBCa9mFv4=; b=Ho/TBIo7WBPB3jA1Sr9EwsUTzElkKj9vX6orp9EKemlz8KoVZcDeG1/iEWIezpBQNZKRoFgodpSKAHWsFuP2ZwUd5yf0gqb/IRlzEjriFle6I+zfwPKoRfKjRvZ+8UndXoTm7VyMCCtKD+2Jy/LoC4zJ8UfmgZ8FRoWBgCN92No= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616164926209286.6727275334415; Fri, 19 Mar 2021 07:42:06 -0700 (PDT) Received: from localhost ([::1]:39308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNGK8-0006t0-Gw for importer@patchew.org; Fri, 19 Mar 2021 10:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHl-0005Jr-6f for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHg-0004o7-JU for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:32 -0400 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-222-GYQy1-A5MN6iYshPhxOzBw-1; Fri, 19 Mar 2021 10:39:26 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65F26107B7C5 for ; Fri, 19 Mar 2021 14:39:25 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3312A60C04 for ; Fri, 19 Mar 2021 14:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616164767; 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=AND/vXxJw3vrWkioqSg3Zz/4dLo3/PhPwrKBCa9mFv4=; b=BvCi3stoYMcwRhYg9qSufmxmP4KxWLq9LEVkdq6Oe13BpQYnnRb6eKE+/ONEHUNgxVKNkC +0khZDID9crozcj1tsqka4QWscs2KlUGad9Eo+BXOxwV9CyAFauoOb2leYGi3FFJyjDdxH pOV3jM0wYD9kko5plyaYJBVKl+txLRY= X-MC-Unique: GYQy1-A5MN6iYshPhxOzBw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 2/8] target/i386: allow modifying TCG phys-addr-bits Date: Fri, 19 Mar 2021 10:39:18 -0400 Message-Id: <20210319143924.2173798-3-pbonzini@redhat.com> In-Reply-To: <20210319143924.2173798-1-pbonzini@redhat.com> References: <20210319143924.2173798-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 23 ++++++++--------------- target/i386/cpu.h | 1 - target/i386/tcg/excp_helper.c | 7 ++++--- target/i386/tcg/helper-tcg.h | 12 ++++-------- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ae9fd9f31d..6b3e9467f1 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6785,21 +6785,14 @@ static void x86_cpu_realizefn(DeviceState *dev, Err= or **errp) cpu->phys_bits =3D cpu->host_phys_bits_limit; } } - - if (cpu->phys_bits && - (cpu->phys_bits > TARGET_PHYS_ADDR_SPACE_BITS || - cpu->phys_bits < 32)) { - error_setg(errp, "phys-bits should be between 32 and %u " - " (but is %u)", - TARGET_PHYS_ADDR_SPACE_BITS, cpu->phys_bi= ts); - return; - } - } else { - if (cpu->phys_bits && cpu->phys_bits !=3D TCG_PHYS_ADDR_BITS) { - error_setg(errp, "TCG only supports phys-bits=3D%u", - TCG_PHYS_ADDR_BITS); - return; - } + } + if (cpu->phys_bits && + (cpu->phys_bits > TARGET_PHYS_ADDR_SPACE_BITS || + cpu->phys_bits < 32)) { + error_setg(errp, "phys-bits should be between 32 and %u " + " (but is %u)", + TARGET_PHYS_ADDR_SPACE_BITS, cpu->phys_bits); + return; } /* 0 means it was not explicitly set by the user (or by machine * compat_props or by the host code above). In this case, the defa= ult diff --git a/target/i386/cpu.h b/target/i386/cpu.h index b4b136cd0d..570f916878 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -290,7 +290,6 @@ typedef enum X86Seg { #define PG_GLOBAL_MASK (1 << PG_GLOBAL_BIT) #define PG_PSE_PAT_MASK (1 << PG_PSE_PAT_BIT) #define PG_ADDRESS_MASK 0x000ffffffffff000LL -#define PG_HI_RSVD_MASK (PG_ADDRESS_MASK & ~PHYS_ADDR_MASK) #define PG_HI_USER_MASK 0x7ff0000000000000LL #define PG_PKRU_MASK (15ULL << PG_PKRU_BIT) #define PG_NX_MASK (1ULL << PG_NX_BIT) diff --git a/target/i386/tcg/excp_helper.c b/target/i386/tcg/excp_helper.c index b7d6259e4a..1e71e44510 100644 --- a/target/i386/tcg/excp_helper.c +++ b/target/i386/tcg/excp_helper.c @@ -142,8 +142,9 @@ void raise_exception_ra(CPUX86State *env, int exception= _index, uintptr_t retaddr static hwaddr get_hphys(CPUState *cs, hwaddr gphys, MMUAccessType access_t= ype, int *prot) { - CPUX86State *env =3D &X86_CPU(cs)->env; - uint64_t rsvd_mask =3D PG_HI_RSVD_MASK; + X86CPU *cpu =3D X86_CPU(cs); + CPUX86State *env =3D &cpu->env; + uint64_t rsvd_mask =3D PG_ADDRESS_MASK & ~MAKE_64BIT_MASK(0, cpu->phys= _bits); uint64_t ptep, pte; uint64_t exit_info_1 =3D 0; target_ulong pde_addr, pte_addr; @@ -358,7 +359,7 @@ static int handle_mmu_fault(CPUState *cs, vaddr addr, i= nt size, int error_code =3D 0; int is_dirty, prot, page_size, is_write, is_user; hwaddr paddr; - uint64_t rsvd_mask =3D PG_HI_RSVD_MASK; + uint64_t rsvd_mask =3D PG_ADDRESS_MASK & ~MAKE_64BIT_MASK(0, cpu->phys= _bits); uint32_t page_offset; target_ulong vaddr; uint32_t pkr; diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index c133c63555..ef60e2e04b 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -25,17 +25,13 @@ /* Maximum instruction code size */ #define TARGET_MAX_INSN_SIZE 16 =20 -/* - * XXX: This value should match the one returned by CPUID - * and in exec.c - */ -# if defined(TARGET_X86_64) +#if defined(TARGET_X86_64) # define TCG_PHYS_ADDR_BITS 40 -# else +#else # define TCG_PHYS_ADDR_BITS 36 -# endif +#endif =20 -#define PHYS_ADDR_MASK MAKE_64BIT_MASK(0, TCG_PHYS_ADDR_BITS) +QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_SPACE_BITS); =20 /** * x86_cpu_do_interrupt: --=20 2.26.2 From nobody Sat Apr 27 11:24:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616165053; cv=none; d=zohomail.com; s=zohoarc; b=EdufmOcJr0sBW3NZKVv53+xvCiGpuO3iGTHAo0BlkBLcFUY58E5lDogNFxC9GVTSfovn4O9N6XHWZo5Au/2YUVjW/CwIivZE1NBBnzn5L5ynnzyWS6MV4M4UWy13xKu1Wd4DxFOya7wFYqFMRvKqYNyuP0Cer28FizCebz4SlXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616165053; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gF8shkL9d4p69aJ98TkRkFFQDtlC4V3fo6jb0Wtc7Xk=; b=Qs6F3EnaonLWePBwQ/hzGgYP1EICEFoJDos68NXlQ62nCbEYsRp7QW1qQp229RFgZns9cYezLbSwhigvUPSLuui2jGvSxeaEqPEBRpE8Z1110qbCfLJyIBVK3JbYLnH+FKEwkl+s7ujvyqZODd4iMTWGCzRXNW6uGf2QJgR/tG0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616165053426466.9430211549404; Fri, 19 Mar 2021 07:44:13 -0700 (PDT) Received: from localhost ([::1]:47702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNGMG-0001vP-0d for importer@patchew.org; Fri, 19 Mar 2021 10:44:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHk-0005Jl-Qr for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHg-0004o9-Ty for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:32 -0400 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-232-rGolk4fEOSKilnT1_-8KIA-1; Fri, 19 Mar 2021 10:39:26 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B207088EF00 for ; Fri, 19 Mar 2021 14:39:25 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F73860C04 for ; Fri, 19 Mar 2021 14:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616164767; 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=gF8shkL9d4p69aJ98TkRkFFQDtlC4V3fo6jb0Wtc7Xk=; b=E6QoArbTbjofAh+BoYbc+BsphSPYidHspZsgSPFlbopGsiKU2E7+sU86ZumoWWEmh1DBBj ug+4y5nfcp3mGNFFgwC05GMocbkzMQJOS6XoYPT/DctAkm6xBdvCcpmefls4alu68hojVM /bJP7m+LJi/2Aw8mVeD7xj+91aHYIhE= X-MC-Unique: rGolk4fEOSKilnT1_-8KIA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 3/8] target/i386: fail if toggling LA57 in 64-bit mode Date: Fri, 19 Mar 2021 10:39:19 -0400 Message-Id: <20210319143924.2173798-4-pbonzini@redhat.com> In-Reply-To: <20210319143924.2173798-1-pbonzini@redhat.com> References: <20210319143924.2173798-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This fixes kvm-unit-tests access.flat with -cpu qemu64,la57. Signed-off-by: Paolo Bonzini --- target/i386/tcg/misc_helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c index 90b87fdef0..a25428c36e 100644 --- a/target/i386/tcg/misc_helper.c +++ b/target/i386/tcg/misc_helper.c @@ -167,6 +167,10 @@ void helper_write_crN(CPUX86State *env, int reg, targe= t_ulong t0) cpu_x86_update_cr3(env, t0); break; case 4: + if (((t0 ^ env->cr[4]) & CR4_LA57_MASK) && + (env->hflags & HF_CS64_MASK)) { + raise_exception_ra(env, EXCP0D_GPF, GETPC()); + } cpu_x86_update_cr4(env, t0); break; case 8: --=20 2.26.2 From nobody Sat Apr 27 11:24:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616165053; cv=none; d=zohomail.com; s=zohoarc; b=nlZth1CaFxE2BCJKhAeVHd+USc5hpjuUektnSp1MvymPHqcbgtxxjpkm3T4+plsdAhqvJXDwtGsmqVlN7HRzJbUEVMITO57H64Az182wgYGcLT4h2fO6jS5grZz62Kxlx5Kb9QXpyooHn06Ndh4aJXNVNkE4RCegl7w6hMCflzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616165053; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wlKHFHC0Q0JoUnvY6Xg/B0UUnONgzKq6R19/MfSXZJg=; b=TFQsjNB5SFFJ773546+CG86AscQ4/0gQ/TAKz1BZvrAEXV759MjjEUJR7suOXtZtVPL7xaUK0nHX+LaYTG0G0fzz0AdjPDWkaLwHezeffwvOI0wenBLutMNE4PCo3OiA8fshcqVNB9Zp7WGJgEtt5vLVTmWUc716B1zDVWXKazU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616165053925588.9876948831005; Fri, 19 Mar 2021 07:44:13 -0700 (PDT) Received: from localhost ([::1]:47768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNGMG-0001wd-Kb for importer@patchew.org; Fri, 19 Mar 2021 10:44:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHl-0005Js-9u for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lNGHh-0004oL-N7 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:33 -0400 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-471-NZ5o-ztwNneucPOIaEk-ug-1; Fri, 19 Mar 2021 10:39:27 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A4C2801817 for ; Fri, 19 Mar 2021 14:39:26 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBECF60C04 for ; Fri, 19 Mar 2021 14:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616164768; 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=wlKHFHC0Q0JoUnvY6Xg/B0UUnONgzKq6R19/MfSXZJg=; b=fjdcndvWOK6m70wexwP4TGlAaY1FTC+xTgIil3vdvnmUKRsAkvOBxIaIKXBxUV6d/d0X2n G78pbFB4drzySKwBD7A3MLqv8wjFIIXF3BLSnVmyRG7KQ7UiSnuHP9lImKapDZoJUGAWBc joLlS/oAiYjZcmun9L+01acb9TOW/ts= X-MC-Unique: NZ5o-ztwNneucPOIaEk-ug-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 4/8] target/i386: svm: do not discard high 32 bits of EXITINFO1 Date: Fri, 19 Mar 2021 10:39:20 -0400 Message-Id: <20210319143924.2173798-5-pbonzini@redhat.com> In-Reply-To: <20210319143924.2173798-1-pbonzini@redhat.com> References: <20210319143924.2173798-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" env->error_code is only 32-bits wide, so the high 32 bits of EXITINFO1 are being lost. However, even though saving guest state and restoring host state must be delayed to do_vmexit, because they might take tb_lock, it is always possible to write to the VMCB. So do this for the exit code and EXITINFO1, just like it is already being done for EXITINFO2. Signed-off-by: Paolo Bonzini --- target/i386/tcg/helper-tcg.h | 2 +- target/i386/tcg/seg_helper.c | 4 ++-- target/i386/tcg/svm_helper.c | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index ef60e2e04b..bcdfca06f6 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -80,7 +80,7 @@ void cpu_load_eflags(CPUX86State *env, int eflags, int up= date_mask); /* svm_helper.c */ void QEMU_NORETURN cpu_vmexit(CPUX86State *nenv, uint32_t exit_code, uint64_t exit_info_1, uintptr_t retaddr); -void do_vmexit(CPUX86State *env, uint32_t exit_code, uint64_t exit_info_1); +void do_vmexit(CPUX86State *env); =20 /* seg_helper.c */ void do_interrupt_x86_hardirq(CPUX86State *env, int intno, int is_hw); diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index 180d47f0e9..d180a381d1 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -1305,9 +1305,9 @@ void x86_cpu_do_interrupt(CPUState *cs) /* successfully delivered */ env->old_exception =3D -1; #else - if (cs->exception_index >=3D EXCP_VMEXIT) { + if (cs->exception_index =3D=3D EXCP_VMEXIT) { assert(env->old_exception =3D=3D -1); - do_vmexit(env, cs->exception_index - EXCP_VMEXIT, env->error_code); + do_vmexit(env); } else { do_interrupt_all(cpu, cs->exception_index, env->exception_is_int, diff --git a/target/i386/tcg/svm_helper.c b/target/i386/tcg/svm_helper.c index 097bb9b83d..0145afceae 100644 --- a/target/i386/tcg/svm_helper.c +++ b/target/i386/tcg/svm_helper.c @@ -621,15 +621,19 @@ void cpu_vmexit(CPUX86State *env, uint32_t exit_code,= uint64_t exit_info_1, control.exit_info_2)), env->eip); =20 - cs->exception_index =3D EXCP_VMEXIT + exit_code; - env->error_code =3D exit_info_1; + cs->exception_index =3D EXCP_VMEXIT; + x86_stq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, control.exit_cod= e), + exit_code); + + x86_stq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, + control.exit_info_1), exit_in= fo_1), =20 /* remove any pending exception */ env->old_exception =3D -1; cpu_loop_exit(cs); } =20 -void do_vmexit(CPUX86State *env, uint32_t exit_code, uint64_t exit_info_1) +void do_vmexit(CPUX86State *env) { CPUState *cs =3D env_cpu(env); uint32_t int_ctl; @@ -762,11 +766,6 @@ void do_vmexit(CPUX86State *env, uint32_t exit_code, u= int64_t exit_info_1) env->vm_hsave + offsetof(struct vmcb, save.dr7)); =20 /* other setups */ - x86_stq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, control.exit_cod= e), - exit_code); - x86_stq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, control.exit_inf= o_1), - exit_info_1); - x86_stl_phys(cs, env->vm_vmcb + offsetof(struct vmcb, control.exit_int_info), x86_ldl_phys(cs, env->vm_vmcb + offsetof(struct vmcb, --=20 2.26.2 From nobody Sat Apr 27 11:24:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616165235; cv=none; d=zohomail.com; s=zohoarc; b=RmE/ZoorUEX3wztXELzNN0QZBWIZlGkdu8j3hS92yY9NjMlQZlLrGldfpt18daYpJMwZpVj7FHCLMhhlaZPnIAelg7hjG///jAADVXzPVx/NtOBoL6WMt/i/oOTdyg31rnJ94bm0qL6bWrEtvHnaxxjHLlTTB3GS5u4l0zvrdaY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616165235; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DEudN1aMR1Vi29euOu/QdKIGp/3szmzik1xsDE298Aw=; b=jmmcHSQxLyDgrnJCPSk6hIzCoj7S6dCJ+nsCSUzvEb/GbGE354bp2Nx/TOjHq9PLZ/40OQKRM64ZlZLQ4W68eXCfrSgo/yh6AqdxAwuvdpLrvNVgs9hMadZFYOEPJ48C4GkSmoODUP+ECgjQd/KFd0mheHX5+kSIPbEttSvMdnY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616165234748379.3076811535325; Fri, 19 Mar 2021 07:47:14 -0700 (PDT) Received: from localhost ([::1]:56634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNGOq-0005dx-E0 for importer@patchew.org; Fri, 19 Mar 2021 10:46:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHn-0005Nu-Fi for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39799) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lNGHk-0004q8-6V for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:35 -0400 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-475-Mw4Hwz8XPzCpplrL-vbNhA-1; Fri, 19 Mar 2021 10:39:27 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7DA0388EF11 for ; Fri, 19 Mar 2021 14:39:26 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CC8B60C04; Fri, 19 Mar 2021 14:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616164771; 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=DEudN1aMR1Vi29euOu/QdKIGp/3szmzik1xsDE298Aw=; b=dZgHps7+uwFJf8dZTv0etWJZfEbAzBe3AL9fgBcX5FDFh7/uqDoe++kUVFsWUekiK3jbiZ edrXZsEK7o/whl4Ur3gUh7wX++gWwmL88tsQaqoJGwzX8/5+KoKQ8nIQ+dWBE4+h/8732Q eQz46mpqRQSulfz1PWBEoHMyTrYfJ6I= X-MC-Unique: Mw4Hwz8XPzCpplrL-vbNhA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 5/8] i386: Fix 'hypercall_hypercall' typo Date: Fri, 19 Mar 2021 10:39:21 -0400 Message-Id: <20210319143924.2173798-6-pbonzini@redhat.com> In-Reply-To: <20210319143924.2173798-1-pbonzini@redhat.com> References: <20210319143924.2173798-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vitaly Kuznetsov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vitaly Kuznetsov Even the name of this section is 'cpu/msr_hyperv_hypercall', 'hypercall_hypercall' is clearly a typo. Signed-off-by: Vitaly Kuznetsov Message-Id: <20210318160249.1084178-3-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/machine.c b/target/i386/machine.c index 3967dfc257..7259fe6868 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -705,7 +705,7 @@ static bool hyperv_hypercall_enable_needed(void *opaque) return env->msr_hv_hypercall !=3D 0 || env->msr_hv_guest_os_id !=3D 0; } =20 -static const VMStateDescription vmstate_msr_hypercall_hypercall =3D { +static const VMStateDescription vmstate_msr_hyperv_hypercall =3D { .name =3D "cpu/msr_hyperv_hypercall", .version_id =3D 1, .minimum_version_id =3D 1, @@ -1484,7 +1484,7 @@ VMStateDescription vmstate_x86_cpu =3D { &vmstate_msr_ia32_feature_control, &vmstate_msr_architectural_pmu, &vmstate_mpx, - &vmstate_msr_hypercall_hypercall, + &vmstate_msr_hyperv_hypercall, &vmstate_msr_hyperv_vapic, &vmstate_msr_hyperv_time, &vmstate_msr_hyperv_crash, --=20 2.26.2 From nobody Sat Apr 27 11:24:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616165211; cv=none; d=zohomail.com; s=zohoarc; b=IfoQH6oicwhNEY0L3AaKShiMtijNJJDtimoJL1pi7z/Ko0IxiRIy1tHOhl1H+gud1q1N5TvZIwiwg70Nl4rAmGyFdhbqD+YcIehVf53BHxJPg1Z0/R0JvEGpFVpINDLSm7XFeUPCthLHV/6GqrtqN1QLuC7KR0+EpMwnpGcZu5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616165211; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=740VPqy7jHXMKY934bNgXjPYVzg/lq/3T9pBROfeajo=; b=jX1ctu9URup3qqZLoRKrYsabHKAkJOs4DucHDkJlhn4B6Wm8Y+Tb8S97npexkqP6lopB3IyEgL99UsDq8hFBH27R7Lwb/C6J3GtKS0o3+Kz2itGmm6B8/RQH7QqTvlrXZJZToz/AQ3w31I4CvXgVxRRIk9aEy2cd8jPWCI7Wr7w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616165211063160.03955015092572; Fri, 19 Mar 2021 07:46:51 -0700 (PDT) Received: from localhost ([::1]:56354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNGOo-0005Ww-2J for importer@patchew.org; Fri, 19 Mar 2021 10:46:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHl-0005K4-S1 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHi-0004oi-N8 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:33 -0400 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-58-Gb6okdE9Mz6P-W-v-toIcQ-1; Fri, 19 Mar 2021 10:39:27 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8B6284BA50 for ; Fri, 19 Mar 2021 14:39:26 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9822460C04; Fri, 19 Mar 2021 14:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616164770; 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=740VPqy7jHXMKY934bNgXjPYVzg/lq/3T9pBROfeajo=; b=gAfBNwqxfsreNUeyhfw9/MSJzovsJhnK+LEHdyfpTluyyfIEP6kxV9z8QIS6dzfn9NypS4 RT5HrZMqSGrBGKjMEr4Gz4ZiXIZjVrTmRWyHhP0rzXxMZG6V/IQHGKaLzoCAVesgoUAp0B DMBlBkp70hDsPgSw5tuZBahbuoDQZHI= X-MC-Unique: Gb6okdE9Mz6P-W-v-toIcQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 6/8] i386: Make migration fail when Hyper-V reenlightenment was enabled but 'user_tsc_khz' is unset Date: Fri, 19 Mar 2021 10:39:22 -0400 Message-Id: <20210319143924.2173798-7-pbonzini@redhat.com> In-Reply-To: <20210319143924.2173798-1-pbonzini@redhat.com> References: <20210319143924.2173798-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vitaly Kuznetsov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vitaly Kuznetsov KVM doesn't fully support Hyper-V reenlightenment notifications on migration. In particular, it doesn't support emulating TSC frequency of the source host by trapping all TSC accesses so unless TSC scaling is supported on the destination host and KVM_SET_TSC_KHZ succeeds, it is unsafe to proceed with migration. KVM_SET_TSC_KHZ is called from two sites: kvm_arch_init_vcpu() and kvm_arch_put_registers(). The later (intentionally) doesn't propagate errors allowing migrations to succeed even when TSC scaling is not supported on the destination. This doesn't suit 're-enlightenment' use-case as we have to guarantee that TSC frequency stays constant. Require 'tsc-frequency=3D' command line option to be specified for successf= ul migration when re-enlightenment was enabled by the guest. Signed-off-by: Vitaly Kuznetsov Message-Id: <20210319123801.1111090-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini --- docs/hyperv.txt | 5 +++++ target/i386/kvm/hyperv-proto.h | 1 + target/i386/machine.c | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/docs/hyperv.txt b/docs/hyperv.txt index 5df00da54f..e53c581f45 100644 --- a/docs/hyperv.txt +++ b/docs/hyperv.txt @@ -160,6 +160,11 @@ the hypervisor) until it is ready to switch to the new= one. This, in conjunction with hv-frequencies, allows Hyper-V on KVM to pass stable clocksource (Ref= erence TSC page) to its own guests. =20 +Note, KVM doesn't fully support re-enlightenment notifications and doesn't +emulate TSC accesses after migration so 'tsc-frequency=3D' CPU option also= has to +be specified to make migration succeed. The destination host has to either= have +the same TSC frequency or support TSC scaling CPU feature. + Recommended: hv-frequencies =20 3.16. hv-evmcs diff --git a/target/i386/kvm/hyperv-proto.h b/target/i386/kvm/hyperv-proto.h index 056a305be3..e30d64b4ad 100644 --- a/target/i386/kvm/hyperv-proto.h +++ b/target/i386/kvm/hyperv-proto.h @@ -139,6 +139,7 @@ * Reenlightenment notification MSRs */ #define HV_X64_MSR_REENLIGHTENMENT_CONTROL 0x40000106 +#define HV_REENLIGHTENMENT_ENABLE_BIT (1u << 16) #define HV_X64_MSR_TSC_EMULATION_CONTROL 0x40000107 #define HV_X64_MSR_TSC_EMULATION_STATUS 0x40000108 =20 diff --git a/target/i386/machine.c b/target/i386/machine.c index 7259fe6868..137604ddb8 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -883,11 +883,31 @@ static bool hyperv_reenlightenment_enable_needed(void= *opaque) env->msr_hv_tsc_emulation_status !=3D 0; } =20 +static int hyperv_reenlightenment_post_load(void *opaque, int version_id) +{ + X86CPU *cpu =3D opaque; + CPUX86State *env =3D &cpu->env; + + /* + * KVM doesn't fully support re-enlightenment notifications so we need= to + * make sure TSC frequency doesn't change upon migration. + */ + if ((env->msr_hv_reenlightenment_control & HV_REENLIGHTENMENT_ENABLE_B= IT) && + !env->user_tsc_khz) { + error_report("Guest enabled re-enlightenment notifications, " + "'tsc-frequency=3D' has to be specified"); + return -EINVAL; + } + + return 0; +} + static const VMStateDescription vmstate_msr_hyperv_reenlightenment =3D { .name =3D "cpu/msr_hyperv_reenlightenment", .version_id =3D 1, .minimum_version_id =3D 1, .needed =3D hyperv_reenlightenment_enable_needed, + .post_load =3D hyperv_reenlightenment_post_load, .fields =3D (VMStateField[]) { VMSTATE_UINT64(env.msr_hv_reenlightenment_control, X86CPU), VMSTATE_UINT64(env.msr_hv_tsc_emulation_control, X86CPU), --=20 2.26.2 From nobody Sat Apr 27 11:24:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616165055; cv=none; d=zohomail.com; s=zohoarc; b=ZO6/hM5zGbjWPqDhXJnPLDNHTpn11CVe0P408aSpxHPoUwJsh7tb7lbCEc7+iNKDqG8xP1YsYS4uIDhNxvhl1X27O7TCv1VlpaJljeuBhBRJIe8bBuKmvBq/w1I2gOAoa+fBHZ6y1OAodiqumP0+zvG/BsThkXkt/kpPbRk5LPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616165055; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bquYpcnZmcudj9kVmx4yv28dkt/YfbLZRig664mS0G4=; b=msJzGqignineaxC07ZYKKIzOMZFS1sOiX1fAKNugQKwSXI4G8bI7aMQd42bh6r6iJmlrVeKO9n2KxEwvfnnaUmk03xlnewhdWN1pL8AawgA9fPQgEM1af9kqzKjQf/TjCWOEHKVHI0kecOz314IO8sdgj+R8yqgShYEx1R+upDU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616165055541805.4167068644348; Fri, 19 Mar 2021 07:44:15 -0700 (PDT) Received: from localhost ([::1]:47924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNGMI-00020b-F7 for importer@patchew.org; Fri, 19 Mar 2021 10:44:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHm-0005LQ-HJ for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHk-0004pr-7z for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:34 -0400 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-98-WxxvkfO7O2eXLROXiUqwfw-1; Fri, 19 Mar 2021 10:39:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5031A107B7C4; Fri, 19 Mar 2021 14:39:27 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2F8860C04; Fri, 19 Mar 2021 14:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616164770; 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=bquYpcnZmcudj9kVmx4yv28dkt/YfbLZRig664mS0G4=; b=jBlxNU9KDWHEDH4l0tV171UjX648VRRb0MwoNVIc3dqR913/lXdwREeetg1QwFm10NnEjX fnT2tPfTz3d+1AzVVNCIu/5osZkECADmjOXmBxLcKR7dyEqE2zQThxXWqrfKGlG0xmm0yX tc5I4huhR9rfRfdDIQV3WBrzR4bJQ1I= X-MC-Unique: WxxvkfO7O2eXLROXiUqwfw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 7/8] hw/intc/i8259: Refactor pic_read_irq() to avoid uninitialized variable Date: Fri, 19 Mar 2021 10:39:23 -0400 Message-Id: <20210319143924.2173798-8-pbonzini@redhat.com> In-Reply-To: <20210319143924.2173798-1-pbonzini@redhat.com> References: <20210319143924.2173798-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Some compiler versions are smart enough to detect a potentially uninitialized variable, but are not smart enough to detect that this cannot happen due to the code flow: ../hw/intc/i8259.c: In function =E2=80=98pic_read_irq=E2=80=99: ../hw/intc/i8259.c:203:13: error: =E2=80=98irq2=E2=80=99 may be used uninit= ialized in this function [-Werror=3Dmaybe-uninitialized] 203 | irq =3D irq2 + 8; | ~~~~^~~~~~~~~~ Restrict irq2 variable use to the inner statement. Fixes: 78ef2b6989f ("i8259: Reorder intack in pic_read_irq") Reported-by: Christian Borntraeger Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210318163059.3686596-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- hw/intc/i8259.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c index 344fd04db1..cc4e21ffec 100644 --- a/hw/intc/i8259.c +++ b/hw/intc/i8259.c @@ -176,10 +176,12 @@ static void pic_intack(PICCommonState *s, int irq) int pic_read_irq(DeviceState *d) { PICCommonState *s =3D PIC_COMMON(d); - int irq, irq2, intno; + int irq, intno; =20 irq =3D pic_get_irq(s); if (irq >=3D 0) { + int irq2; + if (irq =3D=3D 2) { irq2 =3D pic_get_irq(slave_pic); if (irq2 >=3D 0) { @@ -189,20 +191,18 @@ int pic_read_irq(DeviceState *d) irq2 =3D 7; } intno =3D slave_pic->irq_base + irq2; + pic_intack(s, irq); + irq =3D irq2 + 8; } else { intno =3D s->irq_base + irq; + pic_intack(s, irq); } - pic_intack(s, irq); } else { /* spurious IRQ on host controller */ irq =3D 7; intno =3D s->irq_base + irq; } =20 - if (irq =3D=3D 2) { - irq =3D irq2 + 8; - } - #ifdef DEBUG_IRQ_LATENCY printf("IRQ%d latency=3D%0.3fus\n", irq, --=20 2.26.2 From nobody Sat Apr 27 11:24:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616165211; cv=none; d=zohomail.com; s=zohoarc; b=OY73DPOOF46Kny4xL1Oq4tqKgPlwlnSPibKH4WHYsdRJsp3oYbK2KsaadzDGihlpXEwUGOBiVEdKaNcuKYu5EnRjWEp2vRi6fvl3d7u0AICT2+CzXzB1PO9Y24dGMP1qirSdghitfulfpsg8pIypx87AnsOkwTMsfwk8HRcCRN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616165211; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vS2/ndZYQdE/ri/XWMoUI04OsVq11Xm8ankxYhvipqo=; b=N1+eSoUZKnDpYl+C93kn7wqH22rKYnonleLHl4LMEQxzF/sFH/S1Z9ziaPFO4YeX7zn+ocHTeD1UNwFC1C2b0jEN5p/19Cqf73EbT6s8u3ZK5HBlRWf3iOrvJBaVm783SQ4WwRXC7vVfowluXrB84bZgsqFvhYiMVsOKSNl3Sew= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616165211414877.4657418998835; Fri, 19 Mar 2021 07:46:51 -0700 (PDT) Received: from localhost ([::1]:56398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNGOo-0005Y6-BH for importer@patchew.org; Fri, 19 Mar 2021 10:46:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNGHm-0005K9-18 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lNGHk-0004ow-68 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 10:39:33 -0400 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-W9LvjZV9OHSwrFyub65a6g-1; Fri, 19 Mar 2021 10:39:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9CB0618C8C00 for ; Fri, 19 Mar 2021 14:39:27 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A06E60C04; Fri, 19 Mar 2021 14:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616164770; 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=vS2/ndZYQdE/ri/XWMoUI04OsVq11Xm8ankxYhvipqo=; b=KXyOlp8lR5xl3YxlMT+7hIOuMu3hWkPeseiw1/REkqBqxT5Pooeq8gaHNUC9NlscP1Gdle NeEBgqJtc71qFDBlaBxfjZV2wfObUsx1mTtVShZju4zCJPxHQHXyjoBrNqvEPtvj+OKCB6 SS/M8Gs7ZCfHWPyPb5olm1fIAfr8CaE= X-MC-Unique: W9LvjZV9OHSwrFyub65a6g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 8/8] tests/qtest: cleanup the testcase for bug 1878642 Date: Fri, 19 Mar 2021 10:39:24 -0400 Message-Id: <20210319143924.2173798-9-pbonzini@redhat.com> In-Reply-To: <20210319143924.2173798-1-pbonzini@redhat.com> References: <20210319143924.2173798-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Clean up the writes to the configuration space and the PM region, and rename the test to lpc-ich9-test. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- tests/qtest/{fuzz-test.c =3D> lpc-ich9-test.c} | 12 +++++++----- tests/qtest/meson.build | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) rename tests/qtest/{fuzz-test.c =3D> lpc-ich9-test.c} (71%) diff --git a/tests/qtest/fuzz-test.c b/tests/qtest/lpc-ich9-test.c similarity index 71% rename from tests/qtest/fuzz-test.c rename to tests/qtest/lpc-ich9-test.c index 00149abec7..fe0bef9980 100644 --- a/tests/qtest/fuzz-test.c +++ b/tests/qtest/lpc-ich9-test.c @@ -1,5 +1,5 @@ /* - * QTest testcase for fuzz case + * QTest testcases for ich9 case * * Copyright (c) 2020 Li Qiang * @@ -18,9 +18,11 @@ static void test_lp1878642_pci_bus_get_irq_level_assert(= void) s =3D qtest_init("-M pc-q35-5.0 " "-nographic -monitor none -serial none"); =20 - qtest_outl(s, 0xcf8, 0x8400f841); - qtest_outl(s, 0xcfc, 0xebed205d); - qtest_outl(s, 0x5d02, 0xebed205d); + qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */ + qtest_outl(s, 0xcfc, 0x5d00); + qtest_outl(s, 0xcf8, 0x8000f844); /* ACPI_CTRL */ + qtest_outl(s, 0xcfc, 0xeb); + qtest_outw(s, 0x5d02, 0x205d); qtest_quit(s); } =20 @@ -31,7 +33,7 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { - qtest_add_func("fuzz/test_lp1878642_pci_bus_get_irq_level_assert", + qtest_add_func("ich9/test_lp1878642_pci_bus_get_irq_level_assert", test_lp1878642_pci_bus_get_irq_level_assert); } =20 diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 6e871077c1..9731606c31 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -57,6 +57,7 @@ qtests_i386 =3D \ (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + = \ (config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : [= ]) + \ (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) += \ + (config_all_devices.has_key('CONFIG_LPC_ICH9') ? ['lpc-ich9-test'] : [])= + \ (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] := []) + \ (config_all_devices.has_key('CONFIG_USB_UHCI') and = \ config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] := []) + \ @@ -74,7 +75,6 @@ qtests_i386 =3D \ 'bios-tables-test', 'rtc-test', 'i440fx-test', - 'fuzz-test', 'fw_cfg-test', 'device-plug-test', 'drive_del-test', --=20 2.26.2