Re: [PATCH] KVM: x86: use positive error values for msr emulation that causes #GP

2020-11-05 Thread Pankaj Gupta
> > This looks good to me. This should solve "-EPERM" return by "__kvm_set_msr" > > . > > > > A question I have, In the case of "kvm_emulate_rdmsr()", for "r" we > > are injecting #GP. > > Is there any possibility of this check to be hit and still result in #GP? > > When I wrote this patch series

Re: [PATCH] KVM: x86: use positive error values for msr emulation that causes #GP

2020-11-05 Thread Maxim Levitsky
On Thu, 2020-11-05 at 07:14 +0100, Pankaj Gupta wrote: > > Recent introduction of the userspace msr filtering added code that uses > > negative error codes for cases that result in either #GP delivery to > > the guest, or handled by the userspace msr filtering. > > > > This breaks an assumption th

Re: [PATCH] KVM: x86: use positive error values for msr emulation that causes #GP

2020-11-04 Thread Pankaj Gupta
> Recent introduction of the userspace msr filtering added code that uses > negative error codes for cases that result in either #GP delivery to > the guest, or handled by the userspace msr filtering. > > This breaks an assumption that a negative error code returned from the > msr emulation code is

Re: [PATCH] KVM: x86: use positive error values for msr emulation that causes #GP

2020-11-04 Thread Paolo Bonzini
On 04/11/20 17:31, Qian Cai wrote: On Sun, 2020-11-01 at 13:55 +0200, Maxim Levitsky wrote: Recent introduction of the userspace msr filtering added code that uses negative error codes for cases that result in either #GP delivery to the guest, or handled by the userspace msr filtering. This bre

Re: [PATCH] KVM: x86: use positive error values for msr emulation that causes #GP

2020-11-04 Thread Qian Cai
On Sun, 2020-11-01 at 13:55 +0200, Maxim Levitsky wrote: > Recent introduction of the userspace msr filtering added code that uses > negative error codes for cases that result in either #GP delivery to > the guest, or handled by the userspace msr filtering. > > This breaks an assumption that a neg