From nobody Tue Nov 4 15:26:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530218766819501.48124030750785; Thu, 28 Jun 2018 13:46:06 -0700 (PDT) Received: from localhost ([::1]:38508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdnl-0008J1-Vq for importer@patchew.org; Thu, 28 Jun 2018 16:46:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdAx-0007b4-FF for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYdAw-0000wj-Az for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:55 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:46017) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYdAw-0000vZ-2e for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:54 -0400 Received: by mail-wr0-x242.google.com with SMTP id u7-v6so6680561wrn.12 for ; Thu, 28 Jun 2018 13:05:53 -0700 (PDT) Received: from 640k.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id 127-v6sm6211110wmd.18.2018.06.28.13.05.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lnP/SVhv3c3srDgVWrVnoDRYNY1ZOuDavKllehni4wk=; b=hHdPKYXg5kVuZB96eNnRWWncs0A5p3GvnRCtJbu9eww831eAD2huCZYpInDqLrSGcA 1mlW5UBfrYlxQ8TFJ6XPWR+nNMpy9J9/EZ52N2hq8MTJYyIvJFt+7tfF++YepCUka/G0 8QUBW/FmxIKWIYfF1Ee2JT37i3hBUOnNylzn0p+2tPRD9mK3GZjcCFvBa5xJDxrN1OI5 v0PK9ObiosPxpaXRx8scGQ5YMDrGHtn9qiXoJ742WymKWxgfNjA4C2GJ3BuoddbBArxw Je/7w+D1qNPUWhMeueZ85Z97GYLGHEtSFWAQF4Y9leW2FWDEP0Mv/HcCGChISDN00Fek 1r0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lnP/SVhv3c3srDgVWrVnoDRYNY1ZOuDavKllehni4wk=; b=Oe1Iz8WpIVqpaFbutvVQOGUr7biLi5SuHMRNMGmV5ELNDmCRqbjFJnCuHHu98PbtnV ybvpSAtsdYShsVL9ZBBa+OMsP1jzXEPgy+5eg4U/6U6SHEDMf0RWvLPo4lbTYV8n1j0V 9QnV0x8ejwoJUoGbP+Lg08E2Bmwo/nEcY5Mue+effW6ji+dOkl+9dEeuWljDNTv3W4LP l+K1dmv3kFOJ+wTtQPtYi6cdWFKoq11ip/PwZkbE50pG6Hf113S768MPnJsMjBYq5xSh oKNUXDkDl88fLKhgBXVoD3/aJLD0mHFxDIQj7qqe6PICmfA/ljh2AUeG0Qbi4ZYWiI0C eSpQ== X-Gm-Message-State: APt69E0lq53tT/cejZBgI2mIXYjqmksluJMYI9ibQvO1e5FqlqVAYHnH L/WtBuvnC+rbZhpc2j62kC6bHOq5 X-Google-Smtp-Source: AAOMgpdbHyzqEL6iXBgk54Me60vIPXLLESF+lx+kL8i8TLi4XIkvDRwKmYDuP9bKOi55PO7fMNaymA== X-Received: by 2002:adf:8188:: with SMTP id 8-v6mr10259759wra.89.1530216352774; Thu, 28 Jun 2018 13:05:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 28 Jun 2018 22:04:50 +0200 Message-Id: <1530216310-52873-41-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> References: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PULL 40/60] WHPX workaround bug in OSVW handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM)" Adds a workaround to an incorrect value setting CPUID Fn8000_0001_ECX[bit 9 OSVW] =3D 1. This can cause a guest linux kernel to panic when an issue to rdmsr C001_0140h returns 0. Disabling this feature correctly allows the guest to boot without accessing the osv workarounds. Signed-off-by: Justin Terry (VM) Message-Id: <20180605221500.21674-1-juterry@microsoft.com> Signed-off-by: Paolo Bonzini --- target/i386/whpx-all.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 6b42096..99501ba 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -964,6 +964,16 @@ static int whpx_vcpu_run(CPUState *cpu) rdx =3D vcpu->exit_ctx.CpuidAccess.DefaultResultRdx; rbx =3D vcpu->exit_ctx.CpuidAccess.DefaultResultRbx; break; + case 0x80000001: + rax =3D vcpu->exit_ctx.CpuidAccess.DefaultResultRax; + /* Remove any support of OSVW */ + rcx =3D + vcpu->exit_ctx.CpuidAccess.DefaultResultRcx & + ~CPUID_EXT3_OSVW; + + rdx =3D vcpu->exit_ctx.CpuidAccess.DefaultResultRdx; + rbx =3D vcpu->exit_ctx.CpuidAccess.DefaultResultRbx; + break; default: rax =3D vcpu->exit_ctx.CpuidAccess.DefaultResultRax; rcx =3D vcpu->exit_ctx.CpuidAccess.DefaultResultRcx; @@ -1382,12 +1392,13 @@ static int whpx_accel_init(MachineState *ms) goto error; } =20 - UINT32 cpuidExitList[] =3D {1}; + UINT32 cpuidExitList[] =3D {1, 0x80000001}; hr =3D whp_dispatch.WHvSetPartitionProperty( whpx->partition, WHvPartitionPropertyCodeCpuidExitList, cpuidExitList, RTL_NUMBER_OF(cpuidExitList) * sizeof(UINT32)); + if (FAILED(hr)) { error_report("WHPX: Failed to set partition CpuidExitList hr=3D%08= lx", hr); --=20 1.8.3.1