Re: [PATCH] KVM/x86: pmu: Fix #GP condition check for RDPMC emulation

2020-07-08 Thread Paolo Bonzini
On 08/07/20 17:45, Sean Christopherson wrote: > On Wed, Jul 08, 2020 at 05:31:14PM +0200, Paolo Bonzini wrote: >> The order follows the SDM. I'm tempted to remove the CR0 check >> altogether, since non-protected-mode always runs at CPL0 AFAIK, but let's >> keep it close to what the manual says. >

Re: [PATCH] KVM/x86: pmu: Fix #GP condition check for RDPMC emulation

2020-07-08 Thread Sean Christopherson
On Wed, Jul 08, 2020 at 05:31:14PM +0200, Paolo Bonzini wrote: > The order follows the SDM. I'm tempted to remove the CR0 check > altogether, since non-protected-mode always runs at CPL0 AFAIK, but let's > keep it close to what the manual says. Heh, it wouldn't surprise me in the least if there's

Re: [PATCH] KVM/x86: pmu: Fix #GP condition check for RDPMC emulation

2020-07-08 Thread Paolo Bonzini
On 08/07/20 17:18, Sean Christopherson wrote: > On Wed, Jul 08, 2020 at 03:44:09PM +0800, Like Xu wrote: >> in guest protected mode, if the current privilege level >> is not 0 and the pce flag in the cr4 register is cleared, >> we will inject a #gp for rdpmc usage. > > Wrapping at ~58 characters i

Re: [PATCH] KVM/x86: pmu: Fix #GP condition check for RDPMC emulation

2020-07-08 Thread Sean Christopherson
On Wed, Jul 08, 2020 at 03:44:09PM +0800, Like Xu wrote: > in guest protected mode, if the current privilege level > is not 0 and the pce flag in the cr4 register is cleared, > we will inject a #gp for rdpmc usage. Wrapping at ~58 characters is a bit aggressive. checkpatch enforces 75 chars, some

[PATCH] KVM/x86: pmu: Fix #GP condition check for RDPMC emulation

2020-07-08 Thread Like Xu
In guest protected mode, if the current privilege level is not 0 and the PCE flag in the CR4 register is cleared, we will inject a #GP for RDPMC usage. Signed-off-by: Like Xu --- arch/x86/kvm/pmu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c i