[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52764C77E9BF0E44C27265838C729@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Sat, 11 Dec 2021 03:23:23 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Zhong, Yang" <yang.zhong@...el.com>,
"x86@...nel.org" <x86@...nel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>
CC: "seanjc@...gle.com" <seanjc@...gle.com>,
"Nakajima, Jun" <jun.nakajima@...el.com>,
"jing2.liu@...ux.intel.com" <jing2.liu@...ux.intel.com>,
"Liu, Jing2" <jing2.liu@...el.com>
Subject: RE: [PATCH 15/19] kvm: x86: Save and restore guest XFD_ERR properly
> From: Paolo Bonzini
> Sent: Saturday, December 11, 2021 9:32 AM
>
> On 12/11/21 01:10, Thomas Gleixner wrote:
> > 2) When the guest triggers #NM is takes an VMEXIT and the host
> > does:
> >
> > rdmsrl(MSR_XFD_ERR, vcpu->arch.guest_fpu.xfd_err);
> >
> > injects the #NM and goes on.
> >
> > 3) When the guest writes to MSR_XFD_ERR it takes an VMEXIT and
> > the host does:
> >
> > vcpu->arch.guest_fpu.xfd_err = msrval;
> > wrmsrl(MSR_XFD_ERR, msrval);
>
> No wrmsrl here I think, the host value is 0 and should stay so. Instead
> the wrmsrl will happen the next time the VCPU loop is entred.
>
To elaborate I guess the reason is because MSR_XFD_ERR should
always contain host value 0 after preemption is enabled, while
WRMSR emulation is called with preemption enabled. Then we
just need wait for the next time the vcpu loop is entered to
restore the guest value after preemption is disabled. 😊
Thanks
Kevin
Powered by blists - more mailing lists