Re: [Xen-devel] [PATCH V3] x86/hvm: fix domain crash when CR3 has the noflush bit set

2018-02-08 Thread Jan Beulich
>>> On 08.02.18 at 09:51, wrote: > On 02/07/2018 07:42 PM, Razvan Cojocaru wrote: >> On 02/07/2018 07:01 PM, Jan Beulich wrote: --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -34,6 +34,9 @@ extern bool_t opt_hvm_fep; #define opt_hvm_fep 0 #end

Re: [Xen-devel] [PATCH V3] x86/hvm: fix domain crash when CR3 has the noflush bit set

2018-02-08 Thread Razvan Cojocaru
On 02/07/2018 07:42 PM, Razvan Cojocaru wrote: > On 02/07/2018 07:01 PM, Jan Beulich wrote: >>> --- a/xen/include/asm-x86/hvm/hvm.h >>> +++ b/xen/include/asm-x86/hvm/hvm.h >>> @@ -34,6 +34,9 @@ extern bool_t opt_hvm_fep; >>> #define opt_hvm_fep 0 >>> #endif >>> >>> +#define X86_CR3_NOFLUSH (1ul

Re: [Xen-devel] [PATCH V3] x86/hvm: fix domain crash when CR3 has the noflush bit set

2018-02-07 Thread Razvan Cojocaru
On 02/07/2018 07:01 PM, Jan Beulich wrote: On 02.02.18 at 09:14, wrote: >> @@ -2313,6 +2314,12 @@ int hvm_set_cr3(unsigned long value, bool_t may_defer) >> } >> } >> >> +if ( hvm_pcid_enabled(v) ) /* Clear the noflush bit. */ >> +{ >> +noflush = !!(value & X86_

Re: [Xen-devel] [PATCH V3] x86/hvm: fix domain crash when CR3 has the noflush bit set

2018-02-07 Thread Jan Beulich
>>> On 02.02.18 at 09:14, wrote: > @@ -2313,6 +2314,12 @@ int hvm_set_cr3(unsigned long value, bool_t may_defer) > } > } > > +if ( hvm_pcid_enabled(v) ) /* Clear the noflush bit. */ > +{ > +noflush = !!(value & X86_CR3_NOFLUSH); Pointless !!. > --- a/xen/include/a

Re: [Xen-devel] [PATCH V3] x86/hvm: fix domain crash when CR3 has the noflush bit set

2018-02-02 Thread Tamas K Lengyel
On Fri, Feb 2, 2018 at 1:14 AM, Razvan Cojocaru wrote: > The emulation layers of Xen lack PCID support, and as we only offer > PCID to HAP guests, all writes to CR3 are handled by hardware, > except when introspection is involved. Consequently, trying to set > CR3 when the noflush bit is set in hv

[Xen-devel] [PATCH V3] x86/hvm: fix domain crash when CR3 has the noflush bit set

2018-02-02 Thread Razvan Cojocaru
The emulation layers of Xen lack PCID support, and as we only offer PCID to HAP guests, all writes to CR3 are handled by hardware, except when introspection is involved. Consequently, trying to set CR3 when the noflush bit is set in hvm_set_cr3() leads to domain crashes. The workaround is to clear