Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-18 Thread Tamas K Lengyel
On Wed, Sep 18, 2019 at 4:35 AM Alexandru Stefan ISAILA wrote: > > > > On 18.09.2019 12:47, Jan Beulich wrote: > > On 17.09.2019 17:09, Tamas K Lengyel wrote: > >> On Tue, Sep 17, 2019 at 8:24 AM Razvan Cojocaru > >> wrote: > >>> > >>> On 9/17/19 5:11 PM, Alexandru Stefan ISAILA wrote: >

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-18 Thread Alexandru Stefan ISAILA
On 18.09.2019 12:47, Jan Beulich wrote: > On 17.09.2019 17:09, Tamas K Lengyel wrote: >> On Tue, Sep 17, 2019 at 8:24 AM Razvan Cojocaru >> wrote: >>> >>> On 9/17/19 5:11 PM, Alexandru Stefan ISAILA wrote: +bool hvm_monitor_check_p2m(unsigned long gla, gfn_t gfn, uint32_t

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-18 Thread Jan Beulich
On 17.09.2019 17:09, Tamas K Lengyel wrote: > On Tue, Sep 17, 2019 at 8:24 AM Razvan Cojocaru > wrote: >> >> On 9/17/19 5:11 PM, Alexandru Stefan ISAILA wrote: >>> +bool hvm_monitor_check_p2m(unsigned long gla, gfn_t gfn, uint32_t pfec, >>> + uint16_t kind)

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-18 Thread Jan Beulich
On 17.09.2019 17:39, Alexandru Stefan ISAILA wrote: > On 17.09.2019 18:04, Jan Beulich wrote: >> On 17.09.2019 17:00, Alexandru Stefan ISAILA wrote: >>> There is no problem, I understand the risk of having suspicious return >>> values. I am not hanged on having this return. I used this to skip >>>

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Razvan COJOCARU
On 9/17/19 6:09 PM, Tamas K Lengyel wrote: > On Tue, Sep 17, 2019 at 8:24 AM Razvan Cojocaru > wrote: >> >> On 9/17/19 5:11 PM, Alexandru Stefan ISAILA wrote: >>> +bool hvm_monitor_check_p2m(unsigned long gla, gfn_t gfn, uint32_t pfec, >>> + uint16_t kind)

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Alexandru Stefan ISAILA
On 17.09.2019 18:04, Jan Beulich wrote: > On 17.09.2019 17:00, Alexandru Stefan ISAILA wrote: >> There is no problem, I understand the risk of having suspicious return >> values. I am not hanged on having this return. I used this to skip >> adding a new return value. I can do this if we agree on

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Tamas K Lengyel
On Tue, Sep 17, 2019 at 8:24 AM Razvan Cojocaru wrote: > > On 9/17/19 5:11 PM, Alexandru Stefan ISAILA wrote: > > +bool hvm_monitor_check_p2m(unsigned long gla, gfn_t gfn, uint32_t pfec, > > + uint16_t kind) > > +{ > > +xenmem_access_t access; > >

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Jan Beulich
On 17.09.2019 17:00, Alexandru Stefan ISAILA wrote: > There is no problem, I understand the risk of having suspicious return > values. I am not hanged on having this return. I used this to skip > adding a new return value. I can do this if we agree on a suitable name > for a new return value in

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Alexandru Stefan ISAILA
On 17.09.2019 17:32, Jan Beulich wrote: > On 17.09.2019 16:11, Alexandru Stefan ISAILA wrote: >> >> >> On 17.09.2019 11:09, Jan Beulich wrote: >>> On 17.09.2019 09:52, Alexandru Stefan ISAILA wrote: On 16.09.2019 18:58, Jan Beulich wrote: > On 16.09.2019 10:10, Alexandru Stefan ISAILA

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Jan Beulich
On 17.09.2019 16:11, Alexandru Stefan ISAILA wrote: > > > On 17.09.2019 11:09, Jan Beulich wrote: >> On 17.09.2019 09:52, Alexandru Stefan ISAILA wrote: >>> On 16.09.2019 18:58, Jan Beulich wrote: On 16.09.2019 10:10, Alexandru Stefan ISAILA wrote: > --- a/xen/arch/x86/hvm/hvm.c >

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Razvan Cojocaru
On 9/17/19 5:11 PM, Alexandru Stefan ISAILA wrote: > +bool hvm_monitor_check_p2m(unsigned long gla, gfn_t gfn, uint32_t pfec, > + uint16_t kind) > +{ > +xenmem_access_t access; > +vm_event_request_t req = {}; > +paddr_t gpa =

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Alexandru Stefan ISAILA
On 17.09.2019 11:09, Jan Beulich wrote: > On 17.09.2019 09:52, Alexandru Stefan ISAILA wrote: >> On 16.09.2019 18:58, Jan Beulich wrote: >>> On 16.09.2019 10:10, Alexandru Stefan ISAILA wrote: --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -3224,6 +3224,14 @@ static

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Jan Beulich
On 17.09.2019 09:52, Alexandru Stefan ISAILA wrote: > On 16.09.2019 18:58, Jan Beulich wrote: >> On 16.09.2019 10:10, Alexandru Stefan ISAILA wrote: >>> --- a/xen/arch/x86/hvm/hvm.c >>> +++ b/xen/arch/x86/hvm/hvm.c >>> @@ -3224,6 +3224,14 @@ static enum hvm_translation_result __hvm_copy( >>>

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-17 Thread Alexandru Stefan ISAILA
On 16.09.2019 18:58, Jan Beulich wrote: > On 16.09.2019 10:10, Alexandru Stefan ISAILA wrote: >> --- a/xen/arch/x86/hvm/hvm.c >> +++ b/xen/arch/x86/hvm/hvm.c >> @@ -3224,6 +3224,14 @@ static enum hvm_translation_result __hvm_copy( >> return HVMTRANS_bad_gfn_to_mfn; >> }

Re: [Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-16 Thread Jan Beulich
On 16.09.2019 10:10, Alexandru Stefan ISAILA wrote: > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -3224,6 +3224,14 @@ static enum hvm_translation_result __hvm_copy( > return HVMTRANS_bad_gfn_to_mfn; > } > > +if ( unlikely(v->arch.vm_event) && >

[Xen-devel] [PATCH v10] x86/emulate: Send vm_event from emulate

2019-09-16 Thread Alexandru Stefan ISAILA
A/D bit writes (on page walks) can be considered benign by an introspection agent, so receiving vm_events for them is a pessimization. We try here to optimize by filtering these events out. Currently, we are fully emulating the instruction at RIP when the hardware sees an EPT fault with npfec.kind