[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/cpuid: Expose number of vCPUs in CPUID.1.EBX


  • To: Hubert Jasudowicz <hubert.jasudowicz@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 18 Jun 2020 17:51:33 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 18 Jun 2020 16:51:43 +0000
  • Ironport-sdr: f1riQasH8QZqtsOlROjpTqsXBW2rrs/N96EWdeBNYx49E9591RdHGoYYVog2fay6LCLS5d9gou RbvX4DQrtwUYGD3RXZFeyY0DGdYL77Jb81CVRKjhTRV31eBYO80mb63EKu/EtzygiNhumJSBc6 U59lIoZkq/s/vUkSp91nfLUTAK5vxE9X4vGHL6K9OcXfd6qhTOe027j4fBYOpHkF8Ynf9pfl3c B05GhE0//ypY/2qo6fXAscrcpixmvgRHYkhLthyhn4X5ZqIkUdHn8kheTe6kuY9FNO4Eb7l9wm ljE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18/06/2020 17:22, Hubert Jasudowicz wrote:
> When running under KVM (or presumably other hypervisors) we enable
> the CPUID.1.EDX.HTT flag, thus indicating validity of CPUID.1.EBX[23:16]
> - maximum number of logical processors which the guest reads as 0.
>
> Although this method of topology detection is considered legacy,
> Windows falls back to it when CPUID.0BH.EBX is 0.
>
> CPUID.1.EBX[23:16] being equal to 0, triggers memory corruption in
> ntoskrnl.exe as Windows assumes that number of logical processors would
> be at least 1. Memory corruption manifests itself while mapping
> framebuffer for early graphical subsystem, causing BSOD.
>
> This patch fixes running nested Windows (tested on 7 and 10) with KVM as
> L0 hypervisor, by setting the value to maximum number of vCPUs in domain.
>
> Signed-off-by: Hubert Jasudowicz <hubert.jasudowicz@xxxxxxx>

I'm afraid fixing guest topology is more complicated than just this.  On
its own, I'm not sure if this is safe for VMs migrating in.

While I agree that Xen's logic is definitely broken, I suspect the
conditions for the BSOD are more complicated than this, because Windows
does work fine when there is no KVM in the setup described.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.