Re: [PATCH] KVM: x86: Do not raise #GP on write to MSR_IA32_MCG_CTL which is not 0 or all 1s

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

 



On Wed, Jan 02, 2019 at 03:26:30PM -0800, Sean Christopherson wrote:
> On Wed, Jan 02, 2019 at 09:25:22PM +0200, Liran Alon wrote:
> > Only 0 or all 1s can be written to IA32_MCG_CTL.
> > SDM specifies other values as undefined and/or implementation specific.
> > 
> > However, some guest kernels write different values.
> > One such example is WinNT 4 SP6 which uses a value of 0xffffffff.
> > 
> > Prefer to silently accept these writes to avoid an uncatched #GP in the guest.
> > We will define our implementation specific behaviour as any value other than 0
> > to be treated as all 1s.
> 
> I'm assuming this is a 32-bit guest, so what about going with a more
> precise hackaround and explicitly allowing 0xffffffff for 32-bit guests,
> e.g. sign-extending bit 31 when the value isn't already 0 or -1?
> 
> It's worth keeping the #GP behavior for modern kernels, e.g. for testing
> and debug.  MSRs 0x0 and 0x1 are aliased to MSRs 0x400 and 0x401 for
> historical reasons, i.e. WRMSR without setting ECX can easily write
> MSR_IA32_MC0_CTL.

Of course KVM probably doesn't emulate the aliasing so it'd likely #GP
anyways, but I still think we should go with a more surgical hack :)



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux