From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713697; cv=none; d=zohomail.com; s=zohoarc; b=ZyBvANF9YXyAg3tPh4rBlR9bdwzmBWe6mbnvdtvYOJetB+v1r/b7CfEM9xrCl2BDUTtgYvhgpzroNSw/HSciJSTQsNVUODqpkfGTIGJTv38X1Sgtzil6WSrqH1D5fU1zVPNRvjG0ii0rF8g+t0LoTs5hE9Khc28epdo2kQWgKlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713697; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5lM3M/27cmxL429SQ6zeAkdGwYl8tz0wXYP78bVYgaU=; b=YPSk+3BaAqpb3vlx32Gv4sVWC57OepDcrAZTKZQv9vJaZPQ7Fy8rFRVyEPXGlEDHQpVjZYlBi0O884yVNNXoGY/HK8VIxfXZNSeQS2v4/x6vUbs8ygq3lYe/AdZoQ7upR55FYFXWHK9l7OIzyLJS6msso1w4uMJA7XJu3f7WPBc= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713697078910.2701066662765; Thu, 22 Oct 2026 17:01:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2gj-0002ga-NB; Thu, 22 Oct 2026 19:59:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gh-0002ff-Pv for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:11 -0400 Received: from mr-2003d-snip6-8.eps.apple.com ([2a01:b747:3000:202::27] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2ge-00025e-Ok for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:11 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id A81351800267; Thu, 22 Oct 2026 23:59:05 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id BFA3418001F0; Thu, 22 Oct 2026 23:59:03 +0000 (UTC) X-ICL-RepId: 01a1660d-d78a-7d95-8e78-1bb2f4af0715 X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0OWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQAVGXx9RGV4IUytHHkkKVgleCEYRWxRWQ1EZDFBNAUMICghHA00XXjJTBF8RUBY= Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713546; x=1824249546; bh=5lM3M/27cmxL429SQ6zeAkdGwYl8tz0wXYP78bVYgaU=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=ArLLZVK7FrV9RfxvWnltP+vwmuS/jOcZzd13wodWa5fIqUcrfhs+rLxVjZuMSlehzjkAlkmHzwNo/coL/Bu2e3aluAjEzDzvKq6KDCokrY3dp/dLuzWXfrSChiHD4R7Hxh8SgNt82xQwKMuDCiXDyxGBR/ChUYPeNLLB+9s/aZffdDijMxqSr09bCPFv7a5ZfE0P0aDzt5mt3FlqjMu1R6W3fB2nAmLcVrKfJbhB0eI4D3D5QMpevbEYpeiqOZKRCKQqiX0e7I4uqShdRGfxuXUTtUUN9ONjcrtUr6BuTGwDu+vMFbBI+8Q8fvUDH8Fo7sdh9/kz+/CaKb4/WY9I8A== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda , Doug Cook Subject: [PATCH 01/11] target/i386/whpx: fix VMX capability MSR values Date: Fri, 23 Oct 2026 01:58:49 +0200 Message-ID: <20261022235859.88753-2-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX3yVSrlAz14ua //EWEm+wrxbR0xl8qc8DCLmRAN1kKe06ZDyPiHa3ecW60tng0/N7Vcf1ducGTpssw7r1Zp8DFX5 yoI83GK8xQYyBdrdvqNy0zpVuXpwg+vu33U+Lk75LlDf2xHyl+qxZnpUOhf1rGLq0x2gSsqJXuT DY5ZtT9y4RCChGBbdLr4Z888PbAXOIBuOqHRzWJmV1BomMuMj//K3IwR3O0IRjtnb3gjGQ0X3kS iaYD4VINjACyRDvKTiPxJFPL0OOv2A+D/8UWwQC2LWmvqs7/U1kN24SapWpSL8msjDWyydB+6fZ 9dCRtV4drclVexR4q3Wbjx2IQFN0rdp+4tPnYxmMWYRftcMsZ6mArP/a5E68QM= X-Proofpoint-ORIG-GUID: hpVEasEX7C2roEwPkcf-w0jsf46Yj3xN X-Proofpoint-GUID: hpVEasEX7C2roEwPkcf-w0jsf46Yj3xN X-Authority-Info-Out: v=2.4 cv=DtFbOW/+ c=1 sm=1 tr=0 ts=6adaa34a cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=yMhMjlubAAAA:8 a=34rDk-nlojoYW5TMjDsA:9 X-JNJ: AAAAAAABtHPeT6FE31YMsD94aQTX7RJClXvvCMdEjOYrr9LPD5reDDHa1K2YG24P57+Fp2tJzG8chlJ7RiAdsVh/egitqHoK864caElzQ1RnEUEBdJvx4H+FgyaVar785KXkMJOW60E5wKZtWfx1EH5MhPmuAU/3d+LBOPZJlzsCMRmFXvMImgmxIJzo2gx0h5LiVELct/GokHotgir1h9GlgKe/6BwWs2VLKrV1yGRvIfSpaOzxl2rCQp7JYCyjslksastH1IPCBmFW7gNuM4bJpINv3jUOpNwkKhFpQA+Zkr7PYLHhmPfoGH/IOGzD9zSXv1ADY373pyC23NlGv6BEeqy/MS4yfrSKE9pa36m6jRvuwVHE4/bck8Sfv4a8NRKnN1RpYyggfKLyRuFgMORvxooY66xUnZ1LOwZSXYKcidosm5vvLxuksaNRTndksgVhwU47fqgFhC00iQh0IJkvnxjiPtSv4VymwfOiPYbdZenaX5TNwZJfYVglWgKv4veBZfVlUfHJvP/UD8rs7oTI7auX2FfatTmNxtPFlwC2OV5Cmr86R6Bfb61oQqV7aed/A5zWBVr0drRidQz3ofG4Q0vfJTgIL4cYz0CYFJgWLzPmQ+pfXA2YY9GskzXQ8+VRGFZKtp5bSylwCiSCDyQHoISmSaha5rzU/LBGVtkYYBCaiceS7KY/NgNIktcsn3FGhDB11962rq3E4e1pyEiMMGng2R+dSW/rsUrG6eOaDn1d3KCCZ0Oe6qFKX7hIKo0MpUnA148960bgfqT8KPpo+h6o6LHfwUDUHcS4A7izfgM= 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:202::27; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713698847158500 Content-Type: text/plain; charset="utf-8" From: Doug Cook whpx_get_supported_msr_feature() had two bugs in how it reports the VMX control MSRs: - MSR_IA32_VMX_TRUE_PINBASED_CTLS and MSR_IA32_VMX_TRUE_PROCBASED_CTLS were queried using the non-TRUE capability codes (WHvCapabilityCodeVmxPinbasedCtls and WHvCapabilityCodeVmxProcbasedCtls). - For PROCBASED_CTLS2 and the four TRUE_* control MSRs, the raw allowed-0/allowed-1 pair was returned. The feature-word code expects only the bits that may be 1 but are not required to be 1. Apply the same transformation as kvm_arch_get_supported_msr_feature(); make_vmx_msr_value() adds the must-be-one bits back afterwards. As a result, with +vmx QEMU treated many VMX features the host does support (secondary controls, EPT, VPID, MSR bitmaps, ...) as missing, warned about each of them, and dropped them from the CPU model. The guest itself reads the VMX MSRs from the hypervisor, not from QEMU, so this did not change what the guest saw. Signed-off-by: Doug Cook Reviewed-by: Mohamed Mediouni --- target/i386/whpx/whpx-all.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 113f79afb9..1386affa9c 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -1452,10 +1452,10 @@ uint64_t whpx_get_supported_msr_feature(uint32_t in= dex) cap =3D WHvCapabilityCodeVmxEptVpidCap; break; case MSR_IA32_VMX_TRUE_PINBASED_CTLS: - cap =3D WHvCapabilityCodeVmxPinbasedCtls; + cap =3D WHvCapabilityCodeVmxTruePinbasedCtls; break; case MSR_IA32_VMX_TRUE_PROCBASED_CTLS: - cap =3D WHvCapabilityCodeVmxProcbasedCtls; + cap =3D WHvCapabilityCodeVmxTrueProcbasedCtls; break; case MSR_IA32_VMX_TRUE_ENTRY_CTLS: cap =3D WHvCapabilityCodeVmxTrueEntryCtls; @@ -1474,6 +1474,31 @@ uint64_t whpx_get_supported_msr_feature(uint32_t ind= ex) if (FAILED(hr)) { return 0; } + + switch (index) { + case MSR_IA32_VMX_PROCBASED_CTLS2: + case MSR_IA32_VMX_TRUE_PINBASED_CTLS: + case MSR_IA32_VMX_TRUE_PROCBASED_CTLS: + case MSR_IA32_VMX_TRUE_ENTRY_CTLS: + case MSR_IA32_VMX_TRUE_EXIT_CTLS: { + /* + * These MSRs hold the allowed-0 settings in the low half and = the + * allowed-1 settings in the high half. QEMU's feature words = want + * only the bits that can be one but do not have to be one, so + * apply the same transformation as + * kvm_arch_get_supported_msr_feature(); make_vmx_msr_value() + * restores the must-be-one bits later. + */ + uint32_t must_be_one =3D (uint32_t)val; + uint32_t can_be_one =3D (uint32_t)(val >> 32); + + val =3D can_be_one & ~must_be_one; + break; + } + default: + break; + } + return val; } return 0; --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713684; cv=none; d=zohomail.com; s=zohoarc; b=HWqzGpxeyEx0XLGkFGWrUvd/LTtnQqJ7XCAeIPcNdJUm6DVkV458Yszr0ckSNtkL+ryg3x8N+UmSGugugL2qMgRit9vzU6+BNaQNoIw7n3nCFeazuvDSy7YtnH2ki01908k2ASZZuFxL+chz675oM4SxBDOpB8WdhcqUnJUWiEQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713684; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=x6QpE31YHSYm3IN5HGzUQG5BULloTc4Z+l5HgHvxa6Y=; b=X24hsM+N5Tgmw7atvfhSNpcvL35sdFdiq4fUjqJaop0vwqtXVP9rg/Chh91KqiBaUOzl8WPQnu6tB4IfuPBsfeJjvZA5/oQRJtPp6AL9HXpx20QOELfB36Il1l5XBfh1Rvf5kQ8e5LVt/9XHw353/TDyL8CuVnjCPxKB9LGJb1w= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713684530942.3537803557743; Thu, 22 Oct 2026 17:01:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2hc-0003Ph-W9; Thu, 22 Oct 2026 20:00:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2hZ-0003Iu-5t for qemu-devel@nongnu.org; Thu, 22 Oct 2026 20:00:06 -0400 Received: from mr-2005l-snip6-6.eps.apple.com ([2a01:b747:3000:206::75] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2hX-0002FW-2H for qemu-devel@nongnu.org; Thu, 22 Oct 2026 20:00:04 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id 4921C18001E9; Thu, 22 Oct 2026 23:59:07 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id 6EE341800134; Thu, 22 Oct 2026 23:59:05 +0000 (UTC) X-ICL-RepId: 01a1660d-dde2-7469-807f-9a27ee7f3d2c X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0OWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQARGXx9RGV4IUytHHkkKVgleCEYRWxRWQ1EZDFBNAUMICghHA00XXjJTBF8RUBY= Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713601; x=1824249601; bh=x6QpE31YHSYm3IN5HGzUQG5BULloTc4Z+l5HgHvxa6Y=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=FLWFzTeClE7Nt1ArXeFeDtGZrO+ogDoNNRcW0s6Xp98LjKmIF+PBbJ6P7sYihcJuejn/THM5yxYti0RtEtNKMupO67EFyKEhMJY1IsqUnnbcSTauVcYRO0kesj2nQVFjbPoXEsRk6NISR01y7NITYWS8UIiEjIzL/lSl9G9zX0vbfKDx/LtyOtu0oH+ehHDg92ksKwLhYkspsO0sTyfkYsEr9LGtz3ows4Jk7cVh1PnUM/yBxN8Z2ykdMYG6iVVWy0Yhq6ZJ6SkSItktm8dCx4m5bkgAaCgsXD49jt/d6Un7mg8WunINc5Z0DWccICmiaTgc68J1ClGVAb+MD9nXiA== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda , "Doug Cook (WINDOWS)" Subject: [PATCH 02/11] target/i386/whpx: whpx_get_xsave_state error handling Date: Fri, 23 Oct 2026 01:58:50 +0200 Message-ID: <20261022235859.88753-3-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: jz1C0U3JhQ5yaOokW_xdll9rf42s_aZs X-Authority-Info-Out: v=2.4 cv=LJFrgZW9 c=1 sm=1 tr=0 ts=6adaa34b cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=yMhMjlubAAAA:8 a=CyeGX34NJn-RfCE8euUA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX+xv1Ju3rp6dA qPQhAxwUKyTbiXceUjcAO1X4lDArm066sectl1mfI8LilA3bKf4YePV0jOkWNW9Ls23pAinOy8v 3Jk39LLywvU5BvnMvlcSrqnezrz/57mGRu9wFasLui5VoltPmwjSwnCQhUdGmoMfT2dcWg5gNTm A4n/jIAguHBbGfXILzcXZ6Pp5VxUwZgFAl0FYBDbrWZYlRnksfa5JJFbbMUJReag34aClThD9qk gGMrqyUr8pJZxlFEqSD0geYAx/sehfLF2wXE1I/aLDeOei6pdzP66NAGU7Dk1D5mf+7Cz8pmMEN /S//r8zWKIjS8FPydI2WM/AsRHTN55v6sBfiKgqvSyvwrxuyYmw05PPN5Gewnk= X-Proofpoint-GUID: jz1C0U3JhQ5yaOokW_xdll9rf42s_aZs X-JNJ: AAAAAAABuXesWyQYFwYpNjHUs1yNlIX3ChppcEbc/CMTJX1w2wg+eifHmWy+w+10Mr4VoMIahdw+L06Jenyf0CiZb1HYGThmpOVfmQYCmHLtkiziN8oGp+W1HHB42dyQ8ytKY1mpu9DalHyYNyLMB4SvsHLi0ruVEOOjhQidQjIf7YCQ4PyreI8ahBCr5cCbjV23Cn0BIONjz22z1CnwPqYMI6XGuy/UPQ95Gaf1661BaoLdoMNS3SW9OQYfCqnijuWSIPz/ofxlImR8UB1eGLO0vqUGeMbIrm/4hfe3tJ6PF5PxTgd81Mn3lHd2SLqAZaVSS53N51HRPrpzle4PZLtKgt2JOoqA2uSCctayvcCJURgWK2uV6qmt8AQmb1KllWKs0Iv+PVhBUYsidfkVhRpviwiqjVvAJaJqjXRdZkqWnpxGLqFDTLGi7UxBGCEbs96WRuXpMazW5AYukbqjkjQmlviF31XSrVyuQLptcMznq0hk+A1IHAKe/vi2a+6ck57fPe2lVQEMOmL8TGpZjwduRbL7jNFRQQ8YIQKNXmm8unbXC/SdFxWHlBtINCTx2NfrPI9ox4DULUGcZ/mpFREzK0idbNFmNncpnDn+h1xDLDNhw3FUt0708I3LR4SeIWMx2j083e3U3tla2Bt0wkM7qgnyri9spDSI+IxYizcCzqUOsVI28fs3HLNb/tWdKcWPCzKQYdwbuDfuO1RYSS2ljbmsCkqsPAAx54yS04IZ80tb+aFXg9jdbfzJmpIzPYcI4ncApGbrSs/HRfdJzcLSfwBCWn82obU+eYKY7mT3 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:206::75; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713686637158501 Content-Type: text/plain; charset="utf-8" From: "Doug Cook (WINDOWS)" Several problems with error handling in whpx_get_xsave_state: - Does not handle WHV_E_INSUFFICIENT_BUFFER, which occurs frequently in practice for XSAVE state. - Does not free xsavec_buf when an error occurs. - Error message and return code use errno where they should use hr. Fixes: cfaa3b6c9597 ("whpx: xsave support") Signed-off-by: Doug Cook Reviewed-by: Mohamed Mediouni --- include/system/whpx-internal.h | 5 ++- target/i386/whpx/whpx-all.c | 73 +++++++++++++++++++++++++--------- 2 files changed, 57 insertions(+), 21 deletions(-) diff --git a/include/system/whpx-internal.h b/include/system/whpx-internal.h index c295c5a529..b15f3d8faf 100644 --- a/include/system/whpx-internal.h +++ b/include/system/whpx-internal.h @@ -58,8 +58,9 @@ void whpx_apic_get(APICCommonState *s); =20 #define WHV_E_UNKNOWN_CAPABILITY 0x80370300L =20 -/* This should eventually come from the Windows SDK */ -#define WHV_E_UNKNOWN_PROPERTY 0x80370302 +/* These should eventually come from the Windows SDK */ +#define WHV_E_INSUFFICIENT_BUFFER 0x80370301L +#define WHV_E_UNKNOWN_PROPERTY 0x80370302L =20 #define LIST_WINHVPLATFORM_FUNCTIONS(X) \ X(HRESULT, WHvGetCapability, (WHV_CAPABILITY_CODE CapabilityCode, VOID* = CapabilityBuffer, UINT32 CapabilityBufferSizeInBytes, UINT32* WrittenSizeIn= Bytes)) \ diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 1386affa9c..68272c5657 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -442,8 +442,8 @@ static int whpx_set_xsave_state(const CPUState *cpu) =20 qemu_vfree(xsavec_buf); if (FAILED(hr)) { - error_report("WHPX: Failed to get virtual processor context, hr=3D= %08lx", - hr); + error_report("WHPX: Failed to set xsave state, hr=3D%08lx", hr); + return -EIO; } =20 return 0; @@ -809,9 +809,28 @@ static void whpx_get_legacy_fp_registers(CPUState *cpu= , WHPXStateLevel level) idx +=3D 1; } =20 -static int whpx_get_xsave_state(CPUState *cpu) +static HRESULT whpx_get_xsave_state_buffer(const CPUState *cpu, void *buf, + size_t buf_len, + UINT32 *bytes_written) { struct whpx_state *whpx =3D &whpx_global; + + if (!whpx_is_legacy_os()) { + return whp_dispatch.WHvGetVirtualProcessorState( + whpx->partition, cpu->cpu_index, + WHvVirtualProcessorStateTypeXsaveState, + buf, + buf_len, bytes_written); + } else { + return whp_dispatch.WHvGetVirtualProcessorXsaveState( + whpx->partition, cpu->cpu_index, + buf, + buf_len, bytes_written); + } +} + +static int whpx_get_xsave_state(CPUState *cpu) +{ X86CPU *x86cpu =3D X86_CPU(cpu); CPUX86State *env =3D &x86cpu->env; int ret; @@ -824,27 +843,43 @@ static int whpx_get_xsave_state(CPUState *cpu) xsavec_buf =3D qemu_memalign(page, xsavec_buf_len); memset(xsavec_buf, 0, xsavec_buf_len); =20 - if (!whpx_is_legacy_os()) { - hr =3D whp_dispatch.WHvGetVirtualProcessorState( - whpx->partition, cpu->cpu_index, - WHvVirtualProcessorStateTypeXsaveState, - xsavec_buf, - xsavec_buf_len, &bytes_written); - } else { - hr =3D whp_dispatch.WHvGetVirtualProcessorXsaveState( - whpx->partition, cpu->cpu_index, - xsavec_buf, - xsavec_buf_len, &bytes_written); + bytes_written =3D 0; + hr =3D whpx_get_xsave_state_buffer(cpu, xsavec_buf, xsavec_buf_len, + &bytes_written); + + /* + * whpx_get_xsave_max_len() returns the size of user state components + * enabled in XCR0. The hypervisor returns an XSAVES image, which also + * contains the supervisor state, so the whpx_get_xsave_max_len() size + * may be too small. + */ + if (hr =3D=3D WHV_E_INSUFFICIENT_BUFFER && bytes_written > xsavec_buf_= len) { + qemu_vfree(xsavec_buf); + xsavec_buf_len =3D bytes_written; + xsavec_buf =3D qemu_memalign(page, xsavec_buf_len); + memset(xsavec_buf, 0, xsavec_buf_len); + + bytes_written =3D 0; + hr =3D whpx_get_xsave_state_buffer(cpu, xsavec_buf, xsavec_buf_len, + &bytes_written); } - if (FAILED(hr) || bytes_written =3D=3D 0) { - error_report("failed to get xsave state: %s", strerror(errno)); - return -errno; + + if (FAILED(hr)) { + error_report("WHPX: Failed to get xsave state, hr=3D%08lx", hr); + qemu_vfree(xsavec_buf); + return -EIO; + } + + if (bytes_written =3D=3D 0) { + error_report("WHPX: Failed to get xsave state, no data returned"); + qemu_vfree(xsavec_buf); + return -EIO; } =20 - ret =3D decompact_xsave_area(xsavec_buf, xsavec_buf_len, env); + ret =3D decompact_xsave_area(xsavec_buf, bytes_written, env); qemu_vfree(xsavec_buf); if (ret < 0) { - error_report("failed to decompact xsave area"); + error_report("WHPX: Failed to decompact xsave area"); return ret; } x86_cpu_xrstor_all_areas(x86cpu, env->xsave_buf, env->xsave_buf_len); --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713705; cv=none; d=zohomail.com; s=zohoarc; b=LD89cgqb+yXlJTpJvWE+tuDGumktb5rnqpIphpfOR2jJYA3+0YZsHQQ6sV9VyiXOMw7zVXZuJuZufCL/grXxSoo8h1UIKt+eO8rWsiLW0laU//+NpC8WHe4gbFt2mJj3mmQUWZksuT4yZQxPKf5UcXO/4M1/BBGLn4ZRym/Sj/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713705; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BMfLaruRwjS2EuVB1qFM1OkXquvXAo2QdP40DhTsI1I=; b=JYi5YtMJ8h5mD+5g/quWgZZFWXIU/dJL2ObtGBtVUsy6TUnNsxhPGUtWGlVBs3Y54lsz3VXC8Wqjy3x65XSzkgrOOa1zDOgjcXtFpehtCO/Z4ISBf3+M91/4xzwzgZG8oK0KBCcAQb9xZLqb0I7Zcqkk1+hs5maXCshOKkt+W2w= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713705326654.2987852855068; Thu, 22 Oct 2026 17:01:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2gn-0002id-Cy; Thu, 22 Oct 2026 19:59:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gj-0002gc-7w for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:13 -0400 Received: from mr-2003f-snip6-2.eps.apple.com ([2a01:b747:3000:202::3e] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gh-000268-Je for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:12 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id B6191180054E; Thu, 22 Oct 2026 23:59:08 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id 1E6C6180011B; Thu, 22 Oct 2026 23:59:06 +0000 (UTC) X-ICL-RepId: 01a1660d-e392-7148-81ff-1540d7dc9199 X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0PWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQANGXx9RGV4IUytHHkkKVgleCEYRWxRWQ1EZDFBNAUMICghHA00XXjJTBF8RUBY= Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713550; x=1824249550; bh=BMfLaruRwjS2EuVB1qFM1OkXquvXAo2QdP40DhTsI1I=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=hS/GgViVlsoKD7upPLfpQyMt+p3S7ayko5FieMTNSpxi+9z5YLCojdjA8BvCGlVQFMAiIys6zDYek+Yjuh2hAUUY6UytDbT2Pnm1utFoqAzetDAQl+VN7cxQ26HT6d70lU6jqK2pSqWtMXBT7i0TJF6wc1z2Kmwlk6RgyiPvIztLvO3siVbzbX2rLL3LKOv8zvYs867gFMrkvjEX+m+vFGYB97cZ5A2xzKCgZ18GhuD/5GFpSkfMzh0FmYam6L6XJy6uP6Jf6r07QzV4ptQicY32bLUefvmci4NmWX6HktocBINtkv9T+oeazbSVc/umR8zVxDeKfoBdQGJSNs7p9Q== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda Subject: [PATCH 03/11] whpx: i386: get APIC state before VM save Date: Fri, 23 Oct 2026 01:58:51 +0200 Message-ID: <20261022235859.88753-4-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: 5EgcIoOm-oOJRPbDY17_Z8jOQOugws4q X-Proofpoint-GUID: 5EgcIoOm-oOJRPbDY17_Z8jOQOugws4q X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX3EgeHjgQAvb7 h//31JVQoMddttWu0DM873T+re0ySMNnRnPQkwr1tDgx4yqV8c423GlloQ8iAuv7kG4RwybBSkO DlHZDxrGfuiMYLm2gE2Dh56pgsLL5CEgcE/hrE0P3xOtAhffUh5lUdpdY+MJZVLxMWNUnT9xlxw dikX/2hkMQGBPLmyZn7MPRtTl5XZd3nWy4dadmwVtTyltUU6QbOepw33xa1NnNIjL0W4AcjJWtJ R+lPLIf6iX1pHOdy27h1T5XEbROsyeL0wR9MQfyrsazUz7x/KG5HoueyfkC2JpOHYeRh77qbFte AdTJ7rt/xBMaflY1jK4wUxATF+3OtoqA7uZrG/sCQkzt3+A1AF1sJbMxCtpwR0= X-Authority-Info-Out: v=2.4 cv=Ap7jHe9P c=1 sm=1 tr=0 ts=6adaa34d cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=O2XxGrO5I-fc2znLRzsA:9 X-JNJ: AAAAAAABwdu9sEeOIaClRHBgVlTAegGjbh3rx/88lqcVjw8SzD7PCXrjGkK6vsKnKvvujnRIApltyu/FZvsRdhzbb9XUe5C4MTDWsptftwijAnxUBIjgBGfCm8RQn52uDONCvE/DjpAY9z9JfZnnpr0J+g4h6VNPYMT4BSoh8r89RQT+3b5QfqUz6NPRhhEvIovcuIL/9VCkoS9ZXe+HMpMuBor+GV7o6S5k30fnAVmgESrqgD7iQ5hHZ2oc0/sFxHnvuh8m9Lpyl5HKkNqhW/QRe7eSsbPNYhxg9mSdAfWNUXt/XTnVPQZ8XHrCymsaXO1FMWp+z6f7UbyanFADC4/PNhutwoskrA2d695Dv0RmgupX/Ayi0CYKbb6HqBp31cSixNIndcMj4fhXhxzZ2Ldojo7iVMdRza7jvJSr276kl4LPXPKzVKMh/Z7Q0dxI251JZZsv9Ib/oEYLf08DpKy0i40qLxblL53mEKDaiMFLyuDKk89EqSTc0OS7sL3MJaUPBURIu5KMyhr+JKIn15UXDjPM/HkqINWu9xVK0BhJbY4g6Nd6sYyvVyTNZy5XwaTP9sY4YgKFZRTaon+3v+irEJK+XAWN3AT65cKPvz8+NggEY8HXVN4uMEWM8+mfTN91VcsOORR3ONdccjDiaa1ZQobj+ErJbdo+HlAHz0e4E2/Mv8dlsdHkMdTceLdmxLRgfCAq2nWGiS9O49bj2mctznFL9Gj0LMavbNNzORfCyTLN1VbDsNYa60RNGQdQmDy69KOT4upREZlf2cBoxSsF6RUP445FOIXp1BiC 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:202::3e; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713707140158500 Content-Type: text/plain; charset="utf-8" Prerequisite for VM save/restore. Signed-off-by: Mohamed Mediouni --- target/i386/whpx/whpx-apic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/whpx/whpx-apic.c b/target/i386/whpx/whpx-apic.c index cc272f82a5..efdedbcd77 100644 --- a/target/i386/whpx/whpx-apic.c +++ b/target/i386/whpx/whpx-apic.c @@ -242,6 +242,11 @@ void whpx_apic_get(APICCommonState *s) whpx_get_apic_state(s, &kapic); } =20 +static void whpx_apic_pre_save(APICCommonState *s) +{ + whpx_apic_get(s); +} + static void whpx_apic_post_load(APICCommonState *s) { run_on_cpu(CPU(s->cpu), whpx_apic_put, RUN_ON_CPU_HOST_PTR(s)); @@ -338,6 +343,7 @@ static void whpx_apic_class_init(ObjectClass *klass, co= nst void *data) k->set_base =3D apic_set_base; k->set_tpr =3D whpx_apic_set_tpr; k->get_tpr =3D whpx_apic_get_tpr; + k->pre_save =3D whpx_apic_pre_save; k->post_load =3D whpx_apic_post_load; k->vapic_base_update =3D whpx_apic_vapic_base_update; k->external_nmi =3D whpx_apic_external_nmi; --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713604; cv=none; d=zohomail.com; s=zohoarc; b=hTL1dvi77GtB4nzDFISzI2gyrp4H1pZQB5fJJjM6ebIyLZ3/+aLYo+wUSQBkHYTWNC4VOWjs23DtUNaa+txfS2C5gWgOejD6rbXc/CovlNRwWgclSlCI7rN1QNQHtpDd+AYoVhaSoZWNWL/frF6MFRTxKnxja2QobnmV3h6U+44= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713604; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4MtoiGWVHD1ql7ktrdOMb3tf+OVOyyTmcQKxYtuN+0U=; b=Qm5+Ni9e8IpqHikiZ5IYYmXqzFamlPY2IAPzK4Kg6M2OGGO8nSH17d3HxcKBw7Wp2X76eJT+KV7/rw+KQoS1mGPXBQKWoI2/5QvFZ5EDVSg0xZrxIsCRHrQoECujasSA04EErI0CIjExGs5FA2Ys+ZQtrTpgVBMbw9HQoACn9r4= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713604190870.2970433393476; Thu, 22 Oct 2026 17:00:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2gm-0002hy-2v; Thu, 22 Oct 2026 19:59:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gl-0002hZ-2Z for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:15 -0400 Received: from mr-2003l-snip6-1.eps.apple.com ([2a01:b747:3000:202::72] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gj-00026W-I0 for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:14 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id 5F7A21800337; Thu, 22 Oct 2026 23:59:10 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id 9D10918000B2; Thu, 22 Oct 2026 23:59:08 +0000 (UTC) X-ICL-RepId: 01a1660d-e9ec-71e1-ad13-5aa10814eed5 X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0PWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQAJGXx9RGV4IUytHHkkKVgleCEYRWxRWQ1EZDFBNAUMICghHA00XXjJTBF8RUBY= Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713552; x=1824249552; bh=4MtoiGWVHD1ql7ktrdOMb3tf+OVOyyTmcQKxYtuN+0U=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=Mqq2yDr/hNrtBJB9b3ymj11g99Rv9T74LnJYfc+4/U1k1uzAGXL1H0YWMm2rvazDfqhQH+KS1LdacPmrYIm1xV/BVixch41Ut9vHZa/ewrdxQ/fXLGhUEgHlnZ5O0trmNSicJq8l7G08QKzaXKusyvgjd7qZogBDDBzR5utK6qE1FPA11IlmQ8MUGhsIIU3jZKfUaXAl46ZMZeqFhFiIaxn3rJkb3hi8j/lp41FSVY/X2FuVERebqYfFNX9R93oiFmUS8NtyPVrH67r6xPF0+UgdsuCH2B2+7UCYV7HfyZyx6BDa+SZ6k3+7H837/mvskdJLdKtFRGGLRWuNX/g2pA== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda Subject: [PATCH 04/11] whpx: i386: fix TPR encodings for local APIC Date: Fri, 23 Oct 2026 01:58:52 +0200 Message-ID: <20261022235859.88753-5-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX3c5s3ZM5Vc9z 5B7gD6wh1gHHgbDjsRwTlFwMDmK5w4tFSFdBoXsQZM5G+l21AoqWdtes9Jz+Ch7m6QVucxQFFu+ HtrESemsDUTxXFlr7HlNus5BQmk18VFYrPDfeJLY8VS4h06dDmFOoYaOnLlMiMM2OHMMfou5I3o a1RiESfT0CaNtGWIrmh3Ri4GRXu4bqbyR+/qK50oaBP2qvZ93SUCj5yt1umdv9JC730k9OY8OKT A9aYvysSN+n+Hu+99jeL3ZMC69BQc110yAHwhaZTeT7MuctD/co5R4ABSTQlhdPFh/mGKZ39ybH DnzEFDl2RrX+WFI5FxskTS5myXMwIu6m1HEWy4ZBANmTclQLehv1KUWMjYjFso= X-Authority-Info-Out: v=2.4 cv=BqSQAIX5 c=1 sm=1 tr=0 ts=6adaa34e cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=YYz-tg3MKeN3tcD12NcA:9 X-Proofpoint-GUID: jlKHh7aTADjelRTIT8xFTU929dTQCPhC X-Proofpoint-ORIG-GUID: jlKHh7aTADjelRTIT8xFTU929dTQCPhC X-JNJ: AAAAAAAB9yzKMEuZXJsElmi0YL89QX0J996xSrp5PZ5oSzba8g8AsyO97ngP3q9ME0L2ylWh/l8Bd2YvdBGpLlh4EuzXUBGrL2vIf1xoU9bAtuP9iUlABFEu1QuzYQK1b44zYIdS4mn3yTpHDFNFHDRay9VmaK+dROUj/xVcU82QbBJSpVoIm9J8X0ZHLYihEBiMIAjut+incubeueXFsfQON/lI5xMhbI2gjeRSJ+sKGe0xEMl2kbR2OjzhVzH6lAHTEupzzCXiWQAGcfOXcUYCmCx8p8k5lsAIKVD6B27wiU0DKjtsT/bs5bDruu4BQolqqogi5tFrS+RyaeXA3jKCW/DfkePonqeid9w5BMjUJ4CIv4qVuNbvxdMw+I6BFmmfUEqIIEkwu2SCqN0oWUG3N6hzG5IYJoIO0RJFH8TQUnoIu+YYrRZrb1O33LUb9aVxpklW2wf9orq7CCtCU/PQ1xuAS6q36SU1VkJ12htNFEYz4ChY3hMrXXiyXC321+ZOvEo6jWdConx6Yg5t4hz2oncP/z8FDm0yYwBR4DTNsKlf4+7awUx6hMzelfuOZ4MXrp+0lvWwVvFiicglriv1FkHFjnE1jdKLj+pYA0BcYcRoAedG8G9fHtyTU73yM0Rp/uCVVTFuecrfmEMm1LWy9K3pz8/juc/APmDn5oh7wiZIva1Ts9ro8jezm8JxDVk4eop2G2Gybngwck2KpyHTCqszN6ivcYtkV00WlTbGupP1NjPvDloQTBqq3IsBW+mNC0Q89tP1KkehBBKJQn9jKYKaGq38hVGEvPr9AgELH7Q= 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:202::72; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713605180158500 Content-Type: text/plain; charset="utf-8" Convert between the TPR and the APIC priority encodings. Signed-off-by: Mohamed Mediouni --- target/i386/whpx/whpx-apic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/whpx/whpx-apic.c b/target/i386/whpx/whpx-apic.c index efdedbcd77..2d83291fae 100644 --- a/target/i386/whpx/whpx-apic.c +++ b/target/i386/whpx/whpx-apic.c @@ -184,12 +184,12 @@ static void whpx_put_apic_base(CPUState *cpu, uint64_= t val) =20 static void whpx_apic_set_tpr(APICCommonState *s, uint8_t val) { - s->tpr =3D val; + s->tpr =3D (val & APIC_PR_SUB_CLASS) << APIC_PR_CLASS_SHIFT; } =20 static uint8_t whpx_apic_get_tpr(APICCommonState *s) { - return s->tpr; + return s->tpr >> APIC_PR_CLASS_SHIFT; } =20 static void whpx_apic_vapic_base_update(APICCommonState *s) --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713572; cv=none; d=zohomail.com; s=zohoarc; b=BAibI221upfX4P2D1AYM4UB9r0hUSAW/PGC5ZoksVJ4vV0zRDSX0rW4WRR/+ZDY0wH9woLC2GWn/gdQvzXifOZL/giVPDkjJreOwm3OdwuAFGOAqoI48rxY0Pyav9ENM+J3oPAWYUXmQSnrb85S3+UGa9+Qvs6RAXFegaHsFl2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713572; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nVK8vDM8XzoQ7gU4FL1Cwxgq28hF7I8+bUQSMNiuXqA=; b=XpuVnE9bFyqbz1ErR5khNvvlEcDZtcXA9vSFeL/AUL642aX18vI+eBvHe7wafz7VkAxTu4IGBkaY9Nex3tfjxFyiqeVDrGM5wXGphdJmcJRwEgk/ZxpJKyKCMSClU+K+hQvJfljA3T4IWvq6xxqM55IKSaStGH2hbaeugF9TOfo= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713572501816.938683427266; Thu, 22 Oct 2026 16:59:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2gq-0002k2-Qe; Thu, 22 Oct 2026 19:59:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gm-0002iR-RP for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:17 -0400 Received: from mr-2003l-snip6-11.eps.apple.com ([2a01:b747:3000:202::79] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gl-00026r-8k for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:16 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id E9EC31800151; Thu, 22 Oct 2026 23:59:11 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id 2771E1800169; Thu, 22 Oct 2026 23:59:10 +0000 (UTC) X-ICL-RepId: 01a1660d-f00a-768b-8e62-b99ce02281f3 X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0PWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQAFGXx9RGV4IUytHHkkKVgleCEYRWxRWQ1EZDFBNAUMICghHA00XXjJTBF8RUBY= Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713554; x=1824249554; bh=nVK8vDM8XzoQ7gU4FL1Cwxgq28hF7I8+bUQSMNiuXqA=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=ibdEtJ6HmhBGmUi6v5mAzaDyitolNKV2GrW2OVif7COXLJYZq2HVmKVyG1xxbyCcWmBHQ0NmR/gEEpV6w91LHYF0XXciN2y7aKAWb6/PJ0iX63699Lr4bm5oboC4GUH0S2OworyYcR9xLOxOD4IQfrbQUoPiRpiNrOfbTPzsBpymYWAV3rmhrjpDoLWMciUVm/S9zF7BS45baY6hAhrwONwEmT6hk7s6r+yKg8cfJYifgR/YKR2N+LXzOdS3n8DVA29HhB02OkK2/kXlG8oiPWsa4QyrdDuR6jVrxYWcBisBzvhaJQUC5phQIKQ7/LRWwSE7ctpvKwYYTzuU9NwbSg== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda Subject: [PATCH 05/11] whpx: i386: save/restore xss Date: Fri, 23 Oct 2026 01:58:53 +0200 Message-ID: <20261022235859.88753-6-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 8LHo2q9YIRPVEojcvH8wB7YBb_m4AK_2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX9J6ci6URXsM0 DJX+mb1X6tw0LFrFyp9aUebEykNvLaGBnwfJBU3mmxm4UNJYR9aOswDrZN9Z+GizIlp5XQk4Rd3 kiVW9xQ4iGWAKBAjokpTqBFVxt7Fmt2xbDHVJdjhqqRNQg7wE8VS+Og9r/pcjXBkMsLKm2KOpka qXuHqHgygpM0iJ9jTmg8Xp/7Rm+kXD51wq4Q5Vm+NWJdLRoREy9Xy9W+iJ7cOtsFDBbBfptktiD kNrccBd6I/sFs1PvBO7jqaGiPXsaJvsgcVUtz6twZh6TN9WAZdH40a7wkTEOANotp0X9NO1xOip oMrnhTpEEe0+emvMFF9FaPkwVz7azJyH5lI9FZ5/jvlEMIhAOAnsMg7enddkio= X-Proofpoint-ORIG-GUID: 8LHo2q9YIRPVEojcvH8wB7YBb_m4AK_2 X-Authority-Info-Out: v=2.4 cv=cJbtc1eN c=1 sm=1 tr=0 ts=6adaa350 cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=vvjR5Bv0Qg6bciTORDEA:9 X-JNJ: AAAAAAABZBGcRMlGft7yI3Yzoi13+x+ZXIxkIUlIno+BcJOnw7Yti7FILCXheNUvbG3/jiVLdHd+a0hLqZfpEv+Kjap2lKohXMJDjN9RNhcyP7uNEEs5hee6SFcYLIwSXs/nKzeDOyamPucx5zzdN+emyw1MeN1adwj9StriLP9g8e2pqjalleC0ydt6thVRWyNxdpW4KBPjoW6BypKSofIntUT5wWxBNC43v+9itd0cbFoJqo52qr/t4LObDAB4Nd9OSemHElP973HQUSXiwNZv/YycOor7mEz2ZXVoMEUexVNzZ03349f8vnfsA3CGReZ7QYA6KoYyZiHGblLbFFM5oEJ/pnhP2qCYUXaqVYzMGWMg0qUkKFFMo064GrfUM4ym7shUUUJoUUQBgFGqxnRFSxETuRZRp0z4L5C6XRoHyaOAqAdq/GMM1qCBxmNJ1S7uE8IGP8LyjQpFfvvLzsDiKMZ1exzVmbiMqYQ7HmbPORwS5Js4CfIzHaXY39WFGsIQ+97uL8/Jz/JsqYApoG9MVga+bHi1XapafOJodMrAI+Wvk3Uz/UnO8+apwiK9TCSpj83DgWxuNZ1rvewhtFvM0R6Usp1VSi1IU4zhLqXQonlvfUlhkuJxzTrnimb3C1lU08KVf7K+Nb2naxO7WlMJsn87ZZt9WUXy1hl08skT/UjWFrL/n8ZnbmKbB/O4WgHI+5dx+zXh2EVR75Bw/tyK75i5s7ZJ8MH/D8CIc3fJ1iz2v6Nq0NSo+zycnLeGot9k 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:202::79; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713577001158500 Content-Type: text/plain; charset="utf-8" More work on VM save/restore Signed-off-by: Mohamed Mediouni --- target/i386/whpx/whpx-all.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 68272c5657..408a1667e0 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -346,6 +346,8 @@ static void whpx_set_xcrs(CPUState *cpu) struct whpx_state *whpx =3D &whpx_global; WHV_REGISTER_VALUE xcr0; WHV_REGISTER_NAME xcr0_name =3D WHvX64RegisterXCr0; + WHV_REGISTER_VALUE xss; + WHV_REGISTER_NAME xss_name =3D WHvX64RegisterXss; =20 if (!whpx_has_xsave()) { return; @@ -358,6 +360,17 @@ static void whpx_set_xcrs(CPUState *cpu) if (FAILED(hr)) { error_report("WHPX: Failed to set register xcr0, hr=3D%08lx", hr); } + + if (!whpx_has_xsaves()) { + return; + } + + xss.Reg64 =3D cpu_env(cpu)->xss; + hr =3D whp_dispatch.WHvSetVirtualProcessorRegisters( + whpx->partition, cpu->cpu_index, &xss_name, 1, &xss); + if (FAILED(hr)) { + error_report("WHPX: Failed to set register xss, hr=3D%08lx", hr); + } } =20 static int whpx_set_tsc(CPUState *cpu) @@ -691,6 +704,8 @@ static void whpx_get_xcrs(CPUState *cpu) struct whpx_state *whpx =3D &whpx_global; WHV_REGISTER_VALUE xcr0; WHV_REGISTER_NAME xcr0_name =3D WHvX64RegisterXCr0; + WHV_REGISTER_VALUE xss; + WHV_REGISTER_NAME xss_name =3D WHvX64RegisterXss; =20 if (!whpx_has_xsave()) { return; @@ -705,6 +720,19 @@ static void whpx_get_xcrs(CPUState *cpu) } =20 cpu_env(cpu)->xcr0 =3D xcr0.Reg64; + + if (!whpx_has_xsaves()) { + return; + } + + hr =3D whp_dispatch.WHvGetVirtualProcessorRegisters( + whpx->partition, cpu->cpu_index, &xss_name, 1, &xss); + if (FAILED(hr)) { + error_report("WHPX: Failed to get register xss, hr=3D%08lx", hr); + return; + } + + cpu_env(cpu)->xss =3D xss.Reg64; } =20 static void whpx_get_registers_for_vmexit(CPUState *cpu, WHPXStateLevel le= vel) --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713688; cv=none; d=zohomail.com; s=zohoarc; b=MNWBakXVFsIhq1dA6R1NmHR4DTM70ta1+KRI9zB4XT8t5KQxSvMkFswxP548403FSNtNU4spfxGDnAOPUsKgkEWRlQ/aqCwJx2Mizm65loB95i7AMzvpvG/AJWvv/8AqJrtCmubtQOIxpcGgaQCMRzPf5MUo1Et0LJnwUba8cTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713688; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dSrwibXLl61KPeY0mbb9Kw6Bj1BM0S+HBdlSgsEMB5s=; b=HfBMOwJUJYbuOVm/rhq/zRh+3W4RT0nkkj39eBdJpev+tRkc/CAMzLSYQNEM8u5B3bZY7/+ndfFJMNmlY8KnIhl87qDToSp7Mm/sizOzXziNjjlMB34bwl1F6UGVseXGtjrMmuOuJsfG4b9aUqyObGBlqFFbqLmZ36vHNjGWedc= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713687807895.1006819470861; Thu, 22 Oct 2026 17:01:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2gr-0002kX-8X; Thu, 22 Oct 2026 19:59:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gp-0002ji-Gt for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:19 -0400 Received: from mr-2003j-snip6-6.eps.apple.com ([2a01:b747:3000:202::61] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gn-00027Q-Su for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:19 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id 7E3001800169; Thu, 22 Oct 2026 23:59:14 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id AF5D818001F0; Thu, 22 Oct 2026 23:59:11 +0000 (UTC) X-ICL-RepId: 01a1660d-fa06-745d-bd09-c391c0d72d51 X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0PWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQABGXx9RGV4IUytHHkkKVgleCEYRWxRWQ1EZDFBNAUMICghHA00XXjJTBF8RUBY= Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713556; x=1824249556; bh=dSrwibXLl61KPeY0mbb9Kw6Bj1BM0S+HBdlSgsEMB5s=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=Aa9Zd3gAevmxIxwmkE4UBieEDBnFrcVtAQF8s4ZfhgcTFNs3joZ8XW0j+WxthVtqPwkZABz2mHORSmlMhOsqdnyP+eKkiYnbcckafZC/1LpgDheW8BBDonaeQa30taFpGvZzuCLiiXIDamjBV8AAEH+292/1XUpWzgWL8h1CbqkljP/nZ5xIL1+ifso4/0JCbobBbFe8BKlu1pdtgN9XnZwZpw1sUxz89X3UKfdG/FwupB9hqdmUdYSgLYhVFmkjD02dMncwPI46Ea1A9iwiPjDtTe9hi+QVBTwCNkhObDVcJCrPTHPVpnyEqINypzmLlGeHSJ7uIrHCftjj//707g== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda Subject: [PATCH 06/11] whpx: i386: make nested virtualisation init failure non-fatal Date: Fri, 23 Oct 2026 01:58:54 +0200 Message-ID: <20261022235859.88753-7-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Info-Out: v=2.4 cv=O/A0fR9W c=1 sm=1 tr=0 ts=6adaa353 cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=p5XUOwc6s_shZ6Vv324A:9 X-Proofpoint-GUID: s_RQajk0cAED3jfCkRYERVFADkkeq7le X-Proofpoint-ORIG-GUID: s_RQajk0cAED3jfCkRYERVFADkkeq7le X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX6pS3+URRdPs1 SBGc9lJqrkggs+mVuDtEPPMQsn0cuC04sQJt+oeF0yLhC5xMVJrQQeITe4VhbSk8iLNrOV6D+VM +oEtuxExvk/SjvPG1W4JWrl1ozS7DTe57wiRv/mVhvPNNX7JgC20ZPZe4hTeCSTX29fD7nLt9dV xz4dbwU1gxhgWVAEqQCOOBGQH5XrB3tkfdRo7RzwJD4f+tQ+eWxKHEKUM8d7hwv+r3U+H//FHbM tLoqW+OQAqBJkMMnH54vKuhBmlzqus+gWU3qcVwMbL8rvyAy6NDxtsVgK9FHCqZLra9TIxSFBLo 9GSgW52CtUtMzUgeMrUM8yBgcy52brNGg0WWWAJDQo5wot6WlZOqtfDQKiXA2k= X-JNJ: AAAAAAAB2NmEXMuJCSPgz7XgTqD/7b/b7Xo+QSzwh4ePoKVxUIVyOIQgvYjNUmoiVCM1Jtluo6t1L2Pr++bqsnN4ekRmZ8D7UGfw5w15TokKeez0Sx+QfL/n49YZ3d1LFtiVe3a92M918nCVTdBbqMYty08PndRu3JNrhWQScW7MOi3+2Z8Zt9lXoMVC2JzzBzdyVZDxKlSK06qPPtFXyv1PA/2qM7FOLTEUE5vtWxK0JNfGwhLqoxI1Y11XZ6uorNP2VAMUCFcFtumzopZeoui0BHen1hs5GwDl7usyM9/jR85Fn4SWcNRNsIb/ImqHwx+smjv4xbt0FIAwLc+E01/0iSNvWznIq5D/w/TVXQTWQaEM2Huk7yRWj0r+HF7+2ZNarNFIheV3aZJwq8mR07w31qpB9HdA587HqDx6C3zb5Ia8fYX5VqNzITgy3Jn7ZEliR4RX/DfvEOE6EwexD825VEIGY7AMwpqD/j8x/KKZLjWfkzJ+JPZYIOPZfarT30tzHe/bVDEibVmNbS9tk3nbkqcBq21TzFVo2PUVyG20JlsNCxdbqYs80QQ+I++cxbuSkylIsztGFhAYWJYKk8EuTp0VINkYapdgO169SFRec6j933oUZyEvzPw7R7G1CFce0nD6OnfduJaVSmdIaa4mEYcu8E9/PpO76D99ktsehLaw0g8nGwKb+ggsr3qSz6rc/zfqQi+FPzRwOCpGOiFBjo4DqJe2AgneiLuXjrMZ0buTPSPSNdvLAaayMr8rQU2GZvUDHtzmZ32O0ZRBLfI/N5D6SH3Y0av7vjUjAbMLYweCBGifPQ== 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:202::61; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713690679158500 Content-Type: text/plain; charset="utf-8" On some CPUs too old for Windows 11 (Skylake) support but running it anyway, WHP advertises nested virt despite it being unavailable. As such, make failures to initialise nested virt even when advertised non-fatal. Signed-off-by: Mohamed Mediouni --- target/i386/whpx/whpx-all.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 408a1667e0..d13513985c 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -3302,9 +3302,7 @@ int whpx_accel_init(AccelState *as, MachineState *ms) &prop, sizeof(WHV_PARTITION_PROPERTY)); if (FAILED(hr)) { - error_report("WHPX: Failed to enable nested virtualization= , hr=3D%08lx", hr); - ret =3D -EINVAL; - goto error; + warn_report("WHPX: Failed to enable nested virtualization,= hr=3D%08lx", hr); } } =20 --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713640; cv=none; d=zohomail.com; s=zohoarc; b=I1jS6mbEMSIZyOn3VrkJ9aar1i04pYwz/BJqxo+jREASqf6obk/rcRr4FSjmfjpB+aNnYr0crNtOT6Jpz4WT7pF5cPQyeCUSTjKZVLyDdm+IHuJNElRPFHtCgg5BnkxS5OqFQtN1CeiL7p5lKiR6C9IUr4djAiMri3Bh/LY256g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713640; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0DpZpC0HXjATZL6KON6fXf7dnugkN+4ZazEaow1D9EI=; b=Qy9nz9KmT4XYSIdvJk40uhV6aQR3rPM2JNCD9ZKmpZqPs2aN2FX/dSwefPsMiWuGdaGAVMQ7qw38mIwuI8lMuQY6FdldjdzDHCZHfd625mk+uXqEhtqjou12vwSlickejLx9iXdt3u5h0bxOtta+TvlVum63NyBy+6a5WYlaxXc= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713640110420.55083984271255; Thu, 22 Oct 2026 17:00:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2gt-0002la-7d; Thu, 22 Oct 2026 19:59:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gq-0002k7-UZ for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:20 -0400 Received: from mr-2003h-snip6-11.eps.apple.com ([2a01:b747:3000:202::51] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2go-00027Z-88 for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:20 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id 03697180055F; Thu, 22 Oct 2026 23:59:14 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id 396EA18001F2; Thu, 22 Oct 2026 23:59:13 +0000 (UTC) X-ICL-RepId: 01a1660d-fbf7-79fb-bd6c-a806c3f5d938 X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0PWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQA9GXx9RGV4IUytHHkkKVgleCEYRWxRWQ1EZDFBNAUMICghHA00XXjJTBF8RUBY= Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713557; x=1824249557; bh=0DpZpC0HXjATZL6KON6fXf7dnugkN+4ZazEaow1D9EI=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=V0zIybxK3OHnALXJ5cLTT4WwrPpv7DMcMW5veHPXKbJtvar8kwYEPoLr2+16biS+BLvmYyduUwRhPb97uLU7/XEIK2TvvZBDxMxOK6ap2BV4YUqh1fdgfOKsYmf7EPg8Gv0S4oM/N9bjXlNJ2oejP90DcxNQCDLCGynRE95kaxor9tWteuBD8xXZWD8ERUvcJwGbEocQ1WvhE9ilw3tx1Qu8n4suBUOVXf7aEJIqZ5n1WYlyVDdf3Vj8ipbYmC5Qe+jb1ECs7oAjrUM1gclgXrNf5jB3ouK6dZiqplNEBbdLJaIpbG0lkiol7SdfGpAQm9Xb4ORYNWcuV1U92W1quw== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda Subject: [PATCH 07/11] whpx: i386: allow migration for restricted scenarios Date: Fri, 23 Oct 2026 01:58:55 +0200 Message-ID: <20261022235859.88753-8-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: rZhjqsx05E9eFiPs1JpUGL7ub78PFsDv X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX0RvtWpt7Gyjs p+puvNU57h/TZ1bCg5xX1eUIaJsikN3Wz0ytUqQAEVJl89+X2XzveVCNmr5XyEkKjZ7zDr9JUf8 564/ygtR9tkHSRR20vu/AY+qddindwWISqTPYqHYbu5yCXHcOS7s1yUDcLTzMS0hIXZA+5cqy2v eXACrMwH6Ocea60ArOoaGAln1/UzgqkimClnxIsYUJgLrCTg5tIFaivrdOmEXt7HhfISmolanFX hj2KheryC0z4DTqjg6zibSkHk+4yAcnSUuyjIFEk6tRAosBUg8JwUGUzyyhkA63Cjk4Pi9X+yXY RyiMI+Ux/2NxhHei02u8ZdvsHEm1auI7sI9S/Zc9gRJqUUsQCgUGbrNurhSi4w= X-Proofpoint-ORIG-GUID: rZhjqsx05E9eFiPs1JpUGL7ub78PFsDv X-Authority-Info-Out: v=2.4 cv=OYeVzxTY c=1 sm=1 tr=0 ts=6adaa353 cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=nwY42hrHMEqICv1IH2MA:9 X-JNJ: AAAAAAAB0Jf/z1hMnVisCY2/TW/09JzZi+T1joQYPy5M5jhJg3Bjt+9FipEL5H721IWz8h6bFCtJYaMY4XlUVOu78pU1AYPyVvQt2I1CmEtMoZmnZJmbqGaMR6CMCfSVxne0wd+KODSf8mOik7GS8kCJECmV6oFCI0QhhJDPLsYq32DVmjRjlGUfnqzPahZ4rin5+5I19oFzsPD6KxQ86hCfa4RUQEBDNgy0SdAE1VvdFn2ShpG4pU8vgGf/WgsUek97CPZdKN4Z5xxJ0EhTXQsJWLqPFWVkycJqbZhpaHzZT9tMKoMfOlVyKAnC4VhJveGbZst4DTFV6Q2gsV5GfFensCxznnCDY2eK+L/nSR3+JdDiazcqgESU6ahkKMXDy4P1+yVXQyoD7spMo7jIs2McXzZZFO8BcoB6X7YqR/SS3qF7ksbpVipjl1fjlL/9CReUu6dFH24ybG2HWasGRg2RxeSnJWxWyHLuTrC9WqZkLnqVGXSqCYrcTJcsn6JH3w5eUVzPYiA9TKkUqi1x+Z33efhn7WTYRM8/z3eWl11Dgh7rV46VUlBWU27v7iZiProaJmwsd3selIXmLxKDP/cX74Dt6qG83yV/W5/2ndvjUiTejRuViND91pdeVqfIMQ4N3RJTMuaL33tgVbfkKKdQXBKwXnN9jZCOSPbkhfe8/XcN6UkVS4XkByw4pxeXBnvLh4sHONcpAwM75jNDEoYK204EqjFFrFTPwEwKg98o5Oo2Uo+X2S54OwGN+vi5UbS0vyOjNkDhgrrOl3RFa/+Bk0AmK/JFNycyHmE= 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:202::51; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713642389158500 Content-Type: text/plain; charset="utf-8" Currently, nested virtualisation state is not saved/restored and neither is Hyper-V enlightenment state. Debug register state and MTRRs are also not saved. Tested with Windows XP and Alpine Linux. Windows Me is known not to work. Why put it now? Because the Android Emulator is (finally) updating to a newer QEMU tree and they did forward-port QEMU 2.12's WHPX implementation because of save-restore... And their implementation of save/restore was even more restricted than this one. Signed-off-by: Mohamed Mediouni --- target/i386/whpx/whpx-all.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index d13513985c..2f15d41747 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -2828,6 +2828,32 @@ static void whpx_cpu_update_state(void *opaque, bool= running, RunState state) } } =20 +static bool whpx_is_migration_allowed(CPUState *cpu) { + struct whpx_state *whpx =3D &whpx_global; + X86CPU *x86_cpu =3D X86_CPU(cpu); + CPUX86State *env =3D &x86_cpu->env; + + if (whpx->hyperv_enlightenments_enabled =3D=3D true) { + return false; + } + + if (cpu_has_vmx(env) || cpu_has_svm(env)) { + return false; + } + + /* We're relying on the LAPIC state save/restore for pending interrupt= s. */ + if (!whpx_irqchip_in_kernel()) { + return false; + } + + /* The state save-restore we have right now is not good enough for x2A= PIC */ + if (cpu_has_x2apic_feature(env)) { + return false; + } + + return true; +} + int whpx_init_vcpu(CPUState *cpu) { HRESULT hr; @@ -2845,10 +2871,11 @@ int whpx_init_vcpu(CPUState *cpu) /* Add migration blockers for all unsupported features of the * Windows Hypervisor Platform */ - if (whpx_migration_blocker =3D=3D NULL) { + if (whpx_migration_blocker =3D=3D NULL + && !whpx_is_migration_allowed(cpu)) { error_setg(&whpx_migration_blocker, - "State blocked due to missing dirty memory tracking support= ," - "And some system register/state save-restore "); + "State blocked due to missing Hyper-V enlightenments," + "save-restore and/or nested virtualisation"); =20 if (migrate_add_blocker(&whpx_migration_blocker, &local_error) < 0= ) { error_report_err(local_error); --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713705; cv=none; d=zohomail.com; s=zohoarc; b=RIEBBpMb6zZJp0l+ICFV417iatkE6E+orxCsmjYC+i1c9puFgHurTSCoQthz+X4fxAsOkqgyfGnMGtZtfWW3Eetq3yLSm9Q+Meq7VdqkhO0boL5FPog0xTl+T700pyMJ14UYqcirV9AXAG07y2uLj0RnEwfPekmcNLnymV/Q7IM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713705; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/Q7JkoSI88pgzUwwUfNZzSyu6kxg8oY4jMM3MeMnXv4=; b=M1OWlXvfvPVLRT9VzcTfdwxrgOK/QqcFDtyzQdaG7xXgqz54w0SBTxa0PZbQK4DRiu7cESxCw3WQKGWNLwroI+b3x7KL0ja3UWCAMVZVcvMPhtq1vcDeg+NyoMRZ0yppQPP6Tedrdsuzvfsu3zJLtf1ZpYvgJhKXgW/XHr9TyfY= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713705105321.34984372438237; Thu, 22 Oct 2026 17:01:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2gu-0002mw-HU; Thu, 22 Oct 2026 19:59:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gr-0002kJ-3u for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:21 -0400 Received: from mr-2003d-snip6-11.eps.apple.com ([2a01:b747:3000:202::29] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gp-00027u-Gv for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:20 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id A261E1800562; Thu, 22 Oct 2026 23:59:16 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id C15691800118; Thu, 22 Oct 2026 23:59:14 +0000 (UTC) X-ICL-RepId: 01a1660e-027d-75fe-bb4f-cfa565aa4c34 X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0OWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQA5GXx9RGV4IUytHHkkKVgleCEYRWxRWQ1EZDFBNAUMICghHA00XXjJTBF8RUBY= Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713558; x=1824249558; bh=/Q7JkoSI88pgzUwwUfNZzSyu6kxg8oY4jMM3MeMnXv4=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=y4SThmH4eMesx1XwlX5xpOd6MK9gn/cbrtQEECLwHGm7809zfdK22Uy5/udplBcnF90zwuKGtd6oYUddeeJW14MTjZxRfY2abYgG9LLB3VVqHDR8DH6pEBhIxzTtSJw4+chws6HjvTIKl1V4xWHHoiE+GPcMEjho7rMfc0OB3cNMhQE/qfK+K1OoxdFrsThppuI62ZEcIFYs3BCfF5y6XSHzrPOEcDZNzJUj4VmnypE/Br3Dgw/HtvEZ5HQe3037fRA4aW9PJm88eS8qNul1QQWFb8hgu4tmG8KiKdmrQHjb3FqBRfXqpJzgtuKhm/5zGNC2knkM8RiyGRNaYzFu4w== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda , Boden Randin Subject: [PATCH 08/11] whpx: i386: avoid updating hflags for vmexits Date: Fri, 23 Oct 2026 01:58:56 +0200 Message-ID: <20261022235859.88753-9-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX7rWKew5xvJ4I NggOu22nvjpnog5mgZDV3ObRT5Eg2cpsBvhRJBJgYTLvC/ocw459pP1q6GQ023GUHzgeRDE4qOL Q+a+RQa9OJgTYxoa2ZeTBU+d2Fk/VlkStAY+JrfXLih1vWhZb6zlknkWK/+4rk5xz/BfJOzIpCq E7ceH/bQIPmNUaog92ouiHAnzsJIwMgXKiebP/91VeXhUKU4Yy+tAFpeFgmSg7r/MAGhnOVvi43 +rsgb0WJxJsK4mioLrVJ5axL2YlQvYwlpJqU1GKgbBSmqzz3sNggAHTZz7UhaYl4NdkCA6hByst J03QxHvygv9Y7L241HpIwWlg8x/yUkAkRt8GfWNG8y7Rf/6kQvEVt4TLkIdzWY= X-Authority-Info-Out: v=2.4 cv=SN5PlevH c=1 sm=1 tr=0 ts=6adaa355 cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=pGLkceISAAAA:8 a=JvUqhf-O7Ua7-JxK32kA:9 X-Proofpoint-GUID: b1Ofhwu_CmCv0KHYA4vXEEzqEFi43mkR X-Proofpoint-ORIG-GUID: b1Ofhwu_CmCv0KHYA4vXEEzqEFi43mkR X-JNJ: AAAAAAABKoSfT4pKbP+LkaFy6CQzvi5CXOVxnVRSmcVZcRnU0l/xjsxh2Wwf4jGIMFPdDw3KW3c2sdWVGYTM0KWNgG+fewFSpt0YDrUlEqXOrVP1EWQVKJOfgqvg3GVlRYd9iZA8ziI0Jwn9o9M5RHnDiXubGj3yKollUtr3JIpT64EoDkDQUUfypfiOByzd/65XMR6OeAHZu8G8CmkVcCUI0Q/ih7CpR9dyjJCGnMPCw4Y6RXLATnRAt7IohO2LILkw58mBY3oGqgJ8b+ev06YN1oHRfWwwv18+A9BbN8eRWQbvp56c7LG/iQx0mqt5w3ZJ7pnMfnalZj5+wbc+yX5jFRiWJCnR55yLvywqYLJ43hwdrCkhr2OyiCSNmWnFMJDWNcpylfYcL2bKRziYi7JiEA6b970J7xNVspFWxfPHpPBdLYeug7CZ43OXd6aelOaGM4XOJm+hBvunsbie9MnO/kV9DDR5GxqdNQQ993wxFeQESrPw0QuoABDxOId2ZLw1+FJoLmtRd/vK4+PwMKI0sb2B338FHGTyQkk24nHSBE2D9nqO/71/mSh+c/jPvLG0Js4904aS7H5Bu/Z5YIwBh5nwloArJaLNHyeKYpPCbAavXx3W0nC6ljs9ooGb+ymHbfeygNQxJauA4wI2crEiBhsiuLveMlVRaPwZSRcv6tmhJmDsWobvru269fv+IHC8kMEbrzWLZWEG5JSSaZswfopn9uUTYcdiUgxdBKHEkCqc2woC2l0Ns49uwbnK7RmVVQ+4m0vm7uhvwSFD8mHoywfUeEq76xCaEsvjX1bXBvAVSnyCvFH/6fD+uzK0OIvK7A== 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:202::29; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713707111158500 Content-Type: text/plain; charset="utf-8" From: Boden Randin whpx_get_registers_for_vmexit only refreshes GPRs, RIP and RFLAGS. x86_update_hflags() depends on state not refreshed here, while the code using the fast runtime state does not depend on the hflags it recomputes. Signed-off-by: Boden Randin Reviewed-by: Mohamed Mediouni --- target/i386/whpx/whpx-all.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 2f15d41747..478a890c9e 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -772,8 +772,6 @@ static void whpx_get_registers_for_vmexit(CPUState *cpu= , WHPXStateLevel level) rflags_to_lflags(env); =20 assert(idx =3D=3D RTL_NUMBER_OF(whpx_register_names_for_vmexit)); - - x86_update_hflags(env); } =20 static void whpx_get_legacy_fp_registers(CPUState *cpu, WHPXStateLevel lev= el) --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713590; cv=none; d=zohomail.com; s=zohoarc; b=RG6RVqE1134vJchr45jr0UJ22ImLmzo6yltLpd6Ko8qZIVN0kyB9kLzrNMbFygFh1UTr/PCTaF31L08fv+rjz6x8uedjGKaj5pUSWH9cFcjX/ENccQsbVNQIFDKFWL0ofs3tonCpJz6HeEn77MPF3VpoiNSomerLfrFO2GwkGG8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713590; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Cv0uGdAdTyBVyxmHOQprx/PeKa6pk7/GKJjhXwUfb1k=; b=HShZA2qGnslipI1N62VAmb0KZJsWoMlTwiY2yRSX9t8U1h/ENLwck5Owev3FxSxJYy0JeTa6t3Wlapo5xPDYISn8a/06n00YAq809Rz8CM2yZ213S8BKendiye8yvTok2CQ8BxfcL/CAxOmmWbqAKuPpSlMpFHoBvAVmebzURUs= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713590123560.9565656112585; Thu, 22 Oct 2026 16:59:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2gw-0002nS-CL; Thu, 22 Oct 2026 19:59:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gt-0002mA-GW for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:23 -0400 Received: from mr-2003e-snip6-5.eps.apple.com ([2a01:b747:3000:202::2e] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gr-00028q-Oq for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:23 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id 67AE2180011A; Thu, 22 Oct 2026 23:59:18 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id 7B557180024B; Thu, 22 Oct 2026 23:59:16 +0000 (UTC) X-ICL-RepId: 01a1660e-094e-7338-9ff0-369166ecb072 X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0OWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQAZbHx1WEFIAUg9yBVcIQQhTAlEEWBpfCBkNQE4ZDEodUlZRBUoMXABoD10dWBFd Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713560; x=1824249560; bh=Cv0uGdAdTyBVyxmHOQprx/PeKa6pk7/GKJjhXwUfb1k=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=NomFIuK92nmxK+iGwdaoZ5YmE5dQpov2tlEo32sweqB5fb9lLGIktNDXJzcUkfkz/xDUn/xUy0jY19XhTsXvHTdgg4wwyQkVm6aYtksuD8nNm2P4GoSkXoOgXaQqayKS9Pbf6tFfqJVmq+iyxEbxf/hs6aVc8mtwVkAwmOkmO88YD9zgjK1DetoZbMN7M9fTsOBVBJdoEkornkg9yRh0iD0GVnS1HdfNrYdLcccJGE+tICh63a/U8fk7h8d3FADCGhPLuNKkfEK0w/RD53ljoirO7RocOkKT6HqFSijkA208+/TOzNCZ+tNPONgvy1aHhFcpfNolpeNEei8HPL9nVA== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda , "Doug Cook (WINDOWS)" Subject: [PATCH 09/11] target/i386/whpx: handle processor reset Date: Fri, 23 Oct 2026 01:58:57 +0200 Message-ID: <20261022235859.88753-10-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: AJhZ9O9ZxTy302jlGe7JEooJiIKspg3U X-Authority-Info-Out: v=2.4 cv=d/X4CBjE c=1 sm=1 tr=0 ts=6adaa356 cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=p0WdMEafAAAA:8 a=yMhMjlubAAAA:8 a=eqzMyDhjfWJDk1Qr7fMA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX/gMKhvrC1OW8 X1KrC9gHfZEh2oy/ApEE9OgXyzldJTol0anckq+LBZq3SURZWjt/rU3YIQqiGeLHnWzzl6MhtFD oVhYC5T1+aiPFe4zcpNvvfYBIHvuW5v1D3AhwK0NVsBCP2tNTxAVXipTMda6myNkmN3rk0PxqcV hylRyvDIHY8UY8KWnIVv1HVbJ4kwfJn4h4McS3JXCHhs/zvvS3J7zJ7LybXRFL/AOQ65RBUQkm6 CZz28/NB4IPwVncwZ8xiQOWgmlDgMIDQczJdSvzoFaUq5/ZI92R2KD5AWz+gGUGNQ/lSyq78Tme C1V2PgZUovjG+UZefhxfkzYvd0GfezLp9wk1SFPMmTG3cqTijhP2i22zeelHVk= X-Proofpoint-ORIG-GUID: AJhZ9O9ZxTy302jlGe7JEooJiIKspg3U X-JNJ: AAAAAAAB2IfVGWNPP1MUNU+xTZxEnCjpshTaxnqWYbYcz9q2wSX6SWF+xVcDqrvyKTRNvWByf689/b0dBbW5aBEC+008I9d7x2WPhFTBahETxwrgS87m5gCj+gSyLMzm/kHVrGksILGqFA9xCbYBrG2gzIVyvERYLhILw4IUpsC4q+ujbbLRKBwLmRJrreiggQt6QZ0yZStfvdEetQjl9agmU6s/Vx9dh9mATFvw0JpFwpwZs+2razp95ie/2X8aBGJ7HhrD3m98bcNIbJNI8uYwkaBXenq19mLVtliOUhTGhOxL0CvNiigNNhDqROBKeCsLT3MayMsc7lZ1aCBsjyk4BnJstg92a2ZFhaPzLI5ZkEwpHGJaTfxpPgcP4KKC9I9AuWjaoUi/XeUxfeWMUMWa6wPpi3oiBgb8Wowciu6antO+TGiKEAiC/dIvRUsn/VTsHSgg+D+6eAHchDfEFM9QVdeKEFXb2ClEZ/o7tMPz4dh5LJxmD7gUUKXQ4RWVmo22lki2kmhGiPsBoGoXB3j+z0ImAKOIIf/mMq4AOxr0sA13iPfH/uQa7PJi+R8oLFC3hjXwmZFc+Mb1LZvaVrf49FV+7Rsbnulb9TjnbFTdqvoGjdayAhR8MOjMc5T4lSGmf4CY3+EH2t0h+2yXRnOnMoGUe6RTBAj1IbBBvlSxD+m6urzbiNcrZJKDPdcy8bwAkGCnYaY/fDE0YmqWN+qLwuC+TR1u7FDaI0qBD/wcuYpoAe9V5rVvUdwqwhyIoWAsLGduSp5x4cPG+YNOofDYydusZ1nj9liH6/7bkt7ruJQc 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:202::2e; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713590809158500 Content-Type: text/plain; charset="utf-8" From: "Doug Cook (WINDOWS)" WHPX is not properly handling processor reset: - Does not reset partition, so several registers (e.g. Hypercall, GuestOsId) carry values forward as "Locked" into the next session. - Does not clear hypervisor-managed TSC deadline (live-lock). - Does not re-arm the wait-for-SIPI trigger, so all CPUs start running immediately after reset. Some firmware may tolerate this, but OVMF does not. Typical result is that boot hangs or ends in triple-fault, e.g. qemu-system-x86_64: WHPX: Unexpected VP exit code 4 After this patch, I am able to boot to Windows desktop, reset, and boot back to Windows desktop. Tried many times in sequence with no problems. Used several different reset mechanisms (OS shutdown menu, external "reset", watchdog reset) with no problems. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2402 Signed-off-by: Doug Cook --- target/i386/whpx/whpx-all.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 478a890c9e..de4d444368 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -541,6 +541,35 @@ void whpx_set_registers(CPUState *cpu, WHPXStateLevel = level) =20 assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu)); =20 + /* Assumes that cpu_synchronize_all_post_reset() runs cpu 0 first. */ + if (level =3D=3D WHPX_LEVEL_RESET_STATE && cpu->cpu_index =3D=3D 0) { + hr =3D whp_dispatch.WHvResetPartition(whpx->partition); + if (FAILED(hr)) { + error_report("WHPX: Failed to reset partition, hr=3D%08lx", hr= ); + } + } + + /* Reset hypervisor-owned TSC deadline. */ + if (level =3D=3D WHPX_LEVEL_RESET_STATE) { + WHV_REGISTER_VALUE tsc_deadline =3D {}; + + whpx_set_reg(cpu, WHvX64RegisterTscDeadline, tsc_deadline); + } + + /* + * Re-arm partition's wait-for-SIPI state. + * whpx_vcpu_run() ignores cpu->halted, depends on SIPI for this. + * This must follow WHvResetPartition. + */ + if (level =3D=3D WHPX_LEVEL_RESET_STATE && whpx_irqchip_in_kernel()) { + WHV_REGISTER_VALUE activity =3D {}; + + whpx_get_reg(cpu, WHvRegisterInternalActivityState, &activity); + activity.InternalActivity.StartupSuspend =3D !cpu_is_bsp(x86_cpu); + activity.InternalActivity.HaltSuspend =3D 0; + whpx_set_reg(cpu, WHvRegisterInternalActivityState, activity); + } + /* * Following MSRs have side effects on the guest or are too heavy for * runtime. Limit them to full state update. --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713649; cv=none; d=zohomail.com; s=zohoarc; b=Lc8bScKpVfJPcftpt+BN8YR5WlrHU+iREejirnezqPmfaBH7XXdrHBiUXBigjEtrL8hfu6Rtd3zVNBsLYaGesG7y1AB+I0E5uSCW8pODYmVuHP4hP8Ure1/1iTPdZGvcp4NNHFS9MJvXUmROABqa/12/4Nhm7L5ek3cxBV7bu7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713649; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=93j8GFn2aIN5NvK8Y1HIzwXcuknIx3xv/zkmLcn737g=; b=TRVOKE3sihKVyPGD8+8uEUWqh7eIsq8kBGtA6oh6iQ4Y1+nNZWCiplolV4SC/cjonhb5x0uPjjbelOzkaTX1yoHLpowSTrRKHib2YyTQt1kJKMJ9KXULG4zJwXBimGBIyURMYcFeRi6FQjqXJa+F+VToaTusK3Z10XPZ31vhy5Q= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713649040710.2966295621779; Thu, 22 Oct 2026 17:00:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2h0-0002pd-HF; Thu, 22 Oct 2026 19:59:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gx-0002oK-Gj for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:27 -0400 Received: from mr-2004g-snip6-4.eps.apple.com ([2a01:b747:3000:203::41] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gv-00029w-SP for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:27 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id DE0711800553; Thu, 22 Oct 2026 23:59:22 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id 2B0321800106; Thu, 22 Oct 2026 23:59:18 +0000 (UTC) X-ICL-RepId: 01a1660e-1ae0-7488-bdc0-db9e9665d54e X-ICL-Out-Info: HUtFAUMEWwJACUgATUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0PWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQAZaHx1WEFIAUg9yBVcIQQhTAlEEWBpfCBkNQE4ZDEodUlZRBUoMXABoD10dWBFd Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713564; x=1824249564; bh=93j8GFn2aIN5NvK8Y1HIzwXcuknIx3xv/zkmLcn737g=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=JG1yzrG5BSa1GSC5Qs2gRqZ62ZrjsGL1HeOcg1HtolJZs2ap6dxcW71nzTk+4zi7qAQR/0B6T2VtlFdSgmCFhFhYPHaBpnv8tRhWYIMfSvlEh229beoQhtICRCMuHqPCC9l/4m+KFVFx7t8i2jYYADqsTUQAK2V3S8fCjyLBIkT3CgmBPq3pLieRn5upkafzz6hF3XpXaXNsn9dMwbW4XtZKbFZwGWanL5I9h0K6zhK4l+vDNuIADhjKIDvOlQx+elyQ0JJJnC0xNoFOgMseK4NESJ2mTsrmexER7y7nCrMO1SkYCm8Y+R5n2NLej/qJu8s5hu/eQ53IepuM2uM3qw== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda Subject: [PATCH 10/11] target/arm/whpx: handle processor reset Date: Fri, 23 Oct 2026 01:58:58 +0200 Message-ID: <20261022235859.88753-11-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: -yVKV0vH8Hrfoj1Z_mCsq3ZXoCTn1Sj5 X-Proofpoint-ORIG-GUID: -yVKV0vH8Hrfoj1Z_mCsq3ZXoCTn1Sj5 X-Authority-Info-Out: v=2.4 cv=SOVPlevH c=1 sm=1 tr=0 ts=6adaa35b cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=loPyruWHUH_f1C729x8A:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX5Pd+ZtlybILg qfd+lI5uXHw4X7hpPuPCESoynhUYJrc3YA1PlG8Axd1+V7HBnRvxAJc+LstpvPW/+uaWHAGQzt9 6KTRNIjvscMIFD3Z3cfoNL2VLkqh3u0WENADBOw+HSqD4NQvpfzxdXrFk/S32bX9hrXmigaz2jf M4qqgWOGMHhhmt8EwycYV/JH6z6DuyFZHeNFxtZnW1rCgl6dUTgjleborzWB59bztSJxfpz6vLN uJ/Ysgc/WNLJPPjPZYQhvPY+My0QyrObxuGsOBQ6TlmVTXiMDceUjxmRWrO4NAhsQQB7dcljm4y WKrC5PF2zEkskC4ksP0EIyK854m44wbSEcBZcCdzdPwh5ebxrcW+1Js8cy/daE= X-JNJ: AAAAAAABMfl3BWxmsc4DLINcjl5L3y0acdf7F8/3IU+ETfPNQMdL2JSaAUO4lnsa4Jf7OswLQbPwrhqrA1jVxfUwTDaHS0IDr8A6la+uKn54XOUCShrU3Xrxo1a8b57BMLwWduy5dv4zPjVEV6+AvGRVP4zp/UdzPSc9qNi9WHvRGtZKF5Qz2+daPMfC/xO8rCOsY4fR8RG2GJ4cuSkZWyfLQ/Vbsbg+/cNiAUFWE1vn5gsx79rIwgD18Dq+af1minzjfwT0kFWKQdQtxkH+kZm9zgzWlB+UO+dE+S8naUd2d4ozAXhVGvKd0GwdHekYW+4M7AqxDgIRSXPIuTlKBu7KfJZEJkJCiT6pWJYbiPP2dOzdPhqtH7dfxJV0MVR2YfqPNEbBpNf7Sk8Q1ugi9CNRkzD0FcZSkAIxRsHuxIWzXWLb3TZOu8tq/WNrn0yxU2PHzptpxGkxCaWKtXIZIoa+9loCRcShx1vpEFxkkc00Bzc4CBmaCYnsFNU5GehOnNvThkF5/xk047SuW/E/rUrI2heNvk8PcYg947YmVgr8NtJcqXy4Y94By6+mAxnQwJcZUpC4BiEqKY5Im2HhJuoRvw39d7DZZ+11ccz0xubZTf+oIZqwPfhAi6c8EXM70k+djCmgcnUKf1zAtc8I5ic6oGa60pQ+TNn3jPIzvHt+GhZuDWYZCeTB9Xg5MxaRNljsy5lrk1CSxWsr7adIy2TEc1QDMkuCJHqxbbi2i/JoyA8xuw6MFHI+p/BkjQUEBAF1j0F4pqRCNSF2OpDcU84zQgsYvqv790Hs8sbYKI8= 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:203::41; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713649925158500 Content-Type: text/plain; charset="utf-8" Move WHvResetPartition to where it's effective on multi-core configurations. Signed-off-by: Mohamed Mediouni --- target/arm/whpx/whpx-all.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/arm/whpx/whpx-all.c b/target/arm/whpx/whpx-all.c index 46f0b9524e..150a6326d7 100644 --- a/target/arm/whpx/whpx-all.c +++ b/target/arm/whpx/whpx-all.c @@ -471,8 +471,6 @@ int whpx_vcpu_run(CPUState *cpu) if (arm_cpu->power_state !=3D PSCI_OFF) { whpx_psci_cpu_off(arm_cpu); } - /* Partition-wide reset, to reset state for reboots to succeed= . */ - whp_dispatch.WHvResetPartition(whpx->partition); bql_unlock(); break; case WHvRunVpExitReasonNone: @@ -573,6 +571,14 @@ void whpx_set_registers(CPUState *cpu, WHPXStateLevel = level) =20 assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu)); =20 + /* Assumes that cpu_synchronize_all_post_reset() runs cpu 0 first. */ + if (level =3D=3D WHPX_LEVEL_RESET_STATE && cpu->cpu_index =3D=3D 0) { + hr =3D whp_dispatch.WHvResetPartition(whpx->partition); + if (FAILED(hr)) { + error_report("WHPX: Failed to reset partition, hr=3D%08lx", hr= ); + } + } + for (i =3D 0; i < ARRAY_SIZE(whpx_reg_match); i++) { val.Reg64 =3D *(uint64_t *)((char *)env + whpx_reg_match[i].offset= ); whpx_set_reg(cpu, whpx_reg_match[i].reg, val); --=20 2.54.0 (Apple Git-157) From nobody Mon Nov 23 04:34:14 2026 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1792713631; cv=none; d=zohomail.com; s=zohoarc; b=F+Al1RbdWmqQt8PY2Yi77stNrrn8cOq+snO5ZgSNzTkSVvDtYUlbbko8D5a+qK7vzLLuJ3pjtlyt0mhtU8+IlXAQJwM3NmBU0ZdZIc5sDyeOP1zvEaB2b6qhjL7H4pcRNQpvZ3kVzMmq52YRUuufndNPS4Vk/P8Lmus9WYy5HcQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792713631; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kxmNHegOdqS39PStGHBKsfXuH+urTRW4BQhGb2i385I=; b=X1kVJjfmzOliHeMAgv6wWG3FHBA0aIL1ajJgsc2px7Ga1TLOOscZ+Cxk/T4c4KbKaKRUCuIXGBUXAPTR7k+e8FmLgBzzhZnKNpmgXIAoZe/E8M2zO+XpvSckyQU9jGQ8k0RsFeqRgIYLlnGUvRHa+nk2F/YIUwk8UisGMjsytjo= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792713631515598.3418438044029; Thu, 22 Oct 2026 17:00:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xK2gx-0002oF-Lc; Thu, 22 Oct 2026 19:59:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gw-0002nY-AA for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:26 -0400 Received: from mr-2004f-snip6-7.eps.apple.com ([2a01:b747:3000:203::3a] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xK2gu-00029e-O1 for qemu-devel@nongnu.org; Thu, 22 Oct 2026 19:59:26 -0400 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPS id 741E41800267; Thu, 22 Oct 2026 23:59:21 +0000 (UTC) Received: from localhost.localdomain (unknown [17.156.200.36]) by p00-icloudmta-asmtp-us-west-2a-100-percent-9 (Postfix) with ESMTPSA id A8C2F180011B; Thu, 22 Oct 2026 23:59:19 +0000 (UTC) X-ICL-RepId: 01a1660e-1532-78a5-bee1-ac531334e5ed X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1OHVwPUhxEDlYCVRcOVk1UF1sMWg5WMEwWQx9SD1sTTRlRAVJFVAIZHldQQgVCAlwcWg5DClAcXFZVHxcZUU0PWFsIWwQPH0wMUQJCBVZeVAodBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEDV0dRQ5WGVoMUg9bDhwWS1heBFNWDkIJSgVcB1kAQgpNC1gORQpIDk0AQAZZHx1WEFIAUg9yBVcIQQhTAlEEWBpfCBkNQE4ZDEodUlZRBUoMXABoD10dWBFd Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1792713563; x=1824249563; bh=kxmNHegOdqS39PStGHBKsfXuH+urTRW4BQhGb2i385I=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=RhWdF2D5ikFe/NkNDdAfQXAFjbEs7McuEZsQaF9DtdplS7F90jTxkodM5kRR7Fp032AO/hxomr04fOy50af89PHs+6uSYs8I+yU9FAytf3Lo7PxB0YCZOD1vXOyHRC0DMXfASm1zAY9Y/mYcOp1XyBCmaA8Qw9+eRv7oHspk1CHkIVNGsRDijPsft/Yuq2oBh+0S9S0dm645MN8WO2z7DEaWBVpx0ztxOovUvol7L8kpkEzAyitnVUltPI6upZEBhUioFhiv9YfQ1jPd+M+rTSehkUs+V/a+12XWw+cLJMFYRowHnfTDziWLmyJiCBbNfS/HB0x1WmTLleQmuydRSw== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Pierrick Bouvier , qemu-arm@nongnu.org, Pedro Barbuda Subject: [PATCH 11/11] docs: whpx: update documentation Date: Fri, 23 Oct 2026 01:58:59 +0200 Message-ID: <20261022235859.88753-12-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261022235859.88753-1-mohamed@unpredictable.fr> References: <20261022235859.88753-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 0NUEIOKbChs55LJ4Z2cde82Wh0AzVxo- X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIyMDA5NSBTYWx0ZWRfX+ZqxBadidtXV G7uBiLPmKPNWPujod7vJ0Ydlnz7P0fy4ta9xO7OX2hPLNvPTG4yESCo9tacbqa5holghQwrIMAi 6HaJ5moQ8156z3yJxsAlCyUQ5+YJAsIF1EpIDpiMHEpHvBrjXGD8SFfwpggo3xUgGkpk3ctWli5 cPHR7dK6vD+kDwrhE71MkvnIG2DYn/lXNh/kzjePVYavYTbt0TT0pgbt0d+fohF/CMBniNs8mCR fvVx+IEJskD5uFazUWBzDJIOy1bbINxRMBaWLacGPuZI/GPyHAll9Z1jngda9kh3sAGoRPCPe5M 3qtNqqWcR6DuvoW2UTLLVZs8VDD0WuU9URCjEggKGKZVjzagXzXbEdjesyIk7o= X-Proofpoint-ORIG-GUID: 0NUEIOKbChs55LJ4Z2cde82Wh0AzVxo- X-Authority-Info-Out: v=2.4 cv=OYeVzxTY c=1 sm=1 tr=0 ts=6adaa359 cx=c_apl:c_pps:t_out a=9mRn2PO/+PIrVdEbaIuMPg==:117 a=9mRn2PO/+PIrVdEbaIuMPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=i7kv7obA9RsThL7PjB0A:9 a=ZXulRonScM0A:10 X-JNJ: AAAAAAABGvDaR4I7Ms4Xzd2mEdCOOqLUz1AX8e4/HiDdcP0u0wUr65GQvBdxlzsy2t/pV0THxmqs+Af95zoN6QY6AJoYrFwGKiNXGXQSFqLDxkyjCZwiIh7NUto/olxdbH8ZeOjt0Bq3/AaslFCXkC5qdl9w7uNVugEpOevKBSIVDpLjWY/wPPCGKli7GOzdkCxymypVLxMYHgOIrqgC/jfplNlejvaOuPz8n+zwxJaBE23Ck9Ea2NvffYa2/8keaQAbKT/OZIIzguG4Jyg22q4zfDlGSsORS2at7POMiY1iiuC6RpI8uTWZhOU7OCx1dm/2047+ctJBNCb9E7w6IrA+tXU5mMiS44XrgnJo/vO3fhAAUFSUdWnB888wmr3eRzrhd3vQ2UQ5JHF/EwjZeyH/LCXPG5h03YJdQi3o4u8raidSorWcBkklO6CIrlteYndBBHQPwHTwfEm1T3IlX7YNkJ293b4EH9kTBIIl2TguLbkXxn09u2zZhgvBDenZVyC9cAq5cODYrwtEYxACt2E6zsDn/0ePBjWXWbZcCKD70/3zUSrX8Ua6xhsVF6zY9znDdtb6yS67+W3nG7WPLHRlqLQUvsLHUoepBjEJhL7msiZqlNgYlDtmUYCOh7l0TRuKWJ1pW9tMARTtpjBNYFqQoBEfNZCdlnHbQfwy+L9FvpIsiRWFmro5Ij1YZOflYn9s/kCC66cJWNxyHua3/vI0mpeuLkmSRFJnyzY0359SJKlnF6DFz7/tcHizp3kSsyBNKqhc0Zz8ZiudXe9XG5p30jzcs38= 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:b747:3000:203::3a; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1792713633672158500 Content-Type: text/plain; charset="utf-8" Mention experimental VM save/restore support. Signed-off-by: Mohamed Mediouni --- docs/system/whpx.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/system/whpx.rst b/docs/system/whpx.rst index 9909e86831..086193e0b6 100644 --- a/docs/system/whpx.rst +++ b/docs/system/whpx.rst @@ -66,6 +66,8 @@ expects a linear framebuffer to be available. Accelerator options -------------------- =20 +``-accel whpx,hyperv=3Doff`` disables Hyper-V enlightenments exposure. + x86_64 ^^^^^^ =20 @@ -80,6 +82,10 @@ as in a BTB flush when entering/exiting the guest. This = results in a significant MMIO performance increase at the detriment of security mitigations. =20 +``-cpu svm=3Doff,vmx=3Doff,x2apic=3Doff`` with the Hyper-V LAPIC being use= d allows +for experimental VM save/restore support. Currently, this does not cover M= TRRs +or debug registers. + Known issues on x86_64 ---------------------- =20 --=20 2.54.0 (Apple Git-157)