[PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-01-20 Thread Boris Ostrovsky
Starting with commit 84e848fd7a16 ("x86/hvm: disallow access to unknown MSRs") accesses to unhandled MSRs result in #GP sent to the guest. This caused a regression for Solaris who tries to acccess MSR_RAPL_POWER_UNIT and (unlike, for example, Linux) does not catch exceptions when accessing MSRs tha

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-01-22 Thread Jan Beulich
On 20.01.2021 23:49, Boris Ostrovsky wrote: > --- a/xen/arch/x86/msr.c > +++ b/xen/arch/x86/msr.c > @@ -164,6 +164,34 @@ int init_vcpu_msr_policy(struct vcpu *v) > return 0; > } > > +/* Returns true if policy requires #GP to the guest. */ > +bool guest_unhandled_msr(const struct vcpu *v, ui

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-01-22 Thread Boris Ostrovsky
On 1/22/21 7:51 AM, Jan Beulich wrote: > On 20.01.2021 23:49, Boris Ostrovsky wrote: > >> + >> +/* >> + * Accesses to unimplemented MSRs as part of emulation of instructions >> + * other than guest's RDMSR/WRMSR should never succeed. >> + */ >> +if ( !is_guest_msr_access )

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-01-25 Thread Jan Beulich
On 22.01.2021 20:52, Boris Ostrovsky wrote: > On 1/22/21 7:51 AM, Jan Beulich wrote: >> On 20.01.2021 23:49, Boris Ostrovsky wrote: >>> + >>> +/* >>> + * Accesses to unimplemented MSRs as part of emulation of instructions >>> + * other than guest's RDMSR/WRMSR should never succeed. >>>

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-01-25 Thread Boris Ostrovsky
On 21-01-25 11:22:08, Jan Beulich wrote: > On 22.01.2021 20:52, Boris Ostrovsky wrote: > > On 1/22/21 7:51 AM, Jan Beulich wrote: > >> On 20.01.2021 23:49, Boris Ostrovsky wrote: > >>> + > >>> +/* > >>> + * Accesses to unimplemented MSRs as part of emulation of > >>> instructions > >>> +

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-01-26 Thread Jan Beulich
On 25.01.2021 19:42, Boris Ostrovsky wrote: > On 21-01-25 11:22:08, Jan Beulich wrote: >> On 22.01.2021 20:52, Boris Ostrovsky wrote: >>> On 1/22/21 7:51 AM, Jan Beulich wrote: On 20.01.2021 23:49, Boris Ostrovsky wrote: > + > +/* > + * Accesses to unimplemented MSRs as par

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-01-26 Thread Boris Ostrovsky
On 21-01-26 10:05:47, Jan Beulich wrote: > On 25.01.2021 19:42, Boris Ostrovsky wrote: > > On 21-01-25 11:22:08, Jan Beulich wrote: > >> On 22.01.2021 20:52, Boris Ostrovsky wrote: > >>> On 1/22/21 7:51 AM, Jan Beulich wrote: > On 20.01.2021 23:49, Boris Ostrovsky wrote: > > + > > +

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-01-26 Thread Jan Beulich
On 26.01.2021 17:02, Boris Ostrovsky wrote: > On 21-01-26 10:05:47, Jan Beulich wrote: >> On 25.01.2021 19:42, Boris Ostrovsky wrote: >>> On 21-01-25 11:22:08, Jan Beulich wrote: On 22.01.2021 20:52, Boris Ostrovsky wrote: > "Sibling" in terms of name (yes, it would be) or something else?

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-02-18 Thread Roger Pau Monné
On Wed, Jan 20, 2021 at 05:49:11PM -0500, Boris Ostrovsky wrote: > Starting with commit 84e848fd7a16 ("x86/hvm: disallow access to unknown MSRs") > accesses to unhandled MSRs result in #GP sent to the guest. This caused a > regression for Solaris who tries to acccess MSR_RAPL_POWER_UNIT and (unlike

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-02-18 Thread Jan Beulich
On 18.02.2021 12:24, Roger Pau Monné wrote: > On Wed, Jan 20, 2021 at 05:49:11PM -0500, Boris Ostrovsky wrote: >> --- a/xen/arch/x86/hvm/vmx/vmx.c >> +++ b/xen/arch/x86/hvm/vmx/vmx.c >> @@ -3017,8 +3017,8 @@ static int vmx_msr_read_intercept(unsigned int msr, >> uint64_t *msr_content) >>

Re: [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this

2021-02-18 Thread Roger Pau Monné
On Thu, Feb 18, 2021 at 12:57:13PM +0100, Jan Beulich wrote: > On 18.02.2021 12:24, Roger Pau Monné wrote: > > On Wed, Jan 20, 2021 at 05:49:11PM -0500, Boris Ostrovsky wrote: > >> --- a/xen/arch/x86/hvm/vmx/vmx.c > >> +++ b/xen/arch/x86/hvm/vmx/vmx.c > >> @@ -3017,8 +3017,8 @@ static int vmx_msr_r