Re: [PATCH v2 2/4] KVM: SVM: Add emulation support for #GP triggered by SVM instructions

2021-01-25 Thread Maxim Levitsky
On Thu, 2021-01-21 at 14:40 -0800, Sean Christopherson wrote: > On Thu, Jan 21, 2021, Maxim Levitsky wrote: > > BTW, on unrelated note, currently the smap test is broken in kvm-unit tests. > > I bisected it to commit 322cdd6405250a2a3e48db199f97a45ef519e226 > > > > It seems that the following

Re: [PATCH v2 2/4] KVM: SVM: Add emulation support for #GP triggered by SVM instructions

2021-01-21 Thread Sean Christopherson
On Thu, Jan 21, 2021, Maxim Levitsky wrote: > BTW, on unrelated note, currently the smap test is broken in kvm-unit tests. > I bisected it to commit 322cdd6405250a2a3e48db199f97a45ef519e226 > > It seems that the following hack (I have no idea why it works, > since I haven't dug deep into the area

Re: [PATCH v2 2/4] KVM: SVM: Add emulation support for #GP triggered by SVM instructions

2021-01-21 Thread Maxim Levitsky
On Thu, 2021-01-21 at 10:06 -0600, Wei Huang wrote: > > On 1/21/21 8:07 AM, Maxim Levitsky wrote: > > On Thu, 2021-01-21 at 01:55 -0500, Wei Huang wrote: > > > From: Bandan Das > > > > > > While running SVM related instructions (VMRUN/VMSAVE/VMLOAD), some AMD > > > CPUs check EAX against

Re: [PATCH v2 2/4] KVM: SVM: Add emulation support for #GP triggered by SVM instructions

2021-01-21 Thread Wei Huang
On 1/21/21 8:07 AM, Maxim Levitsky wrote: > On Thu, 2021-01-21 at 01:55 -0500, Wei Huang wrote: >> From: Bandan Das >> >> While running SVM related instructions (VMRUN/VMSAVE/VMLOAD), some AMD >> CPUs check EAX against reserved memory regions (e.g. SMM memory on host) >> before checking VMCB's

Re: [PATCH v2 2/4] KVM: SVM: Add emulation support for #GP triggered by SVM instructions

2021-01-21 Thread Maxim Levitsky
On Thu, 2021-01-21 at 01:55 -0500, Wei Huang wrote: > From: Bandan Das > > While running SVM related instructions (VMRUN/VMSAVE/VMLOAD), some AMD > CPUs check EAX against reserved memory regions (e.g. SMM memory on host) > before checking VMCB's instruction intercept. If EAX falls into such >

[PATCH v2 2/4] KVM: SVM: Add emulation support for #GP triggered by SVM instructions

2021-01-20 Thread Wei Huang
From: Bandan Das While running SVM related instructions (VMRUN/VMSAVE/VMLOAD), some AMD CPUs check EAX against reserved memory regions (e.g. SMM memory on host) before checking VMCB's instruction intercept. If EAX falls into such memory areas, #GP is triggered before VMEXIT. This causes problem