[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC] x86/vm_event: Allow returning i-cache for emulation



On Fri, 9 Sep 2016, Tamas Lengyel wrote:
> On Fri, Sep 9, 2016 at 5:11 PM, Stefano Stabellini
> <sstabellini@xxxxxxxxxx> wrote:
> > On Fri, 9 Sep 2016, Tamas K Lengyel wrote:
> >> When emulating instructions the emulator maintains a small i-cache fetched
> >> from the guest memory. Under certain scenarios this memory region may 
> >> contain
> >> instructions that a monitor subscriber would prefer to hide, namely INT3, 
> >> and
> >> instead would prefer to emulate a different instruction in-place.
> >>
> >> This patch extends the vm_event interface to allow returning this i-cache 
> >> via
> >> the vm_event response.
> >>
> >> Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxxxxx>
> >>
> >> diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
> >> index 8398af7..161d149 100644
> >> --- a/xen/common/vm_event.c
> >> +++ b/xen/common/vm_event.c
> >> @@ -407,8 +407,11 @@ void vm_event_resume(struct domain *d, struct 
> >> vm_event_domain *ved)
> >>              vm_event_register_write_resume(v, &rsp);
> >>              break;
> >>
> >> +        case VM_EVENT_REASON_SOFTWARE_BREAKPOINT:
> >> +            vm_event_interrupt_emulate_check(v, &rsp);
> >> +            break;
> >> +
> >>  #ifdef CONFIG_HAS_MEM_ACCESS
> >> -        case VM_EVENT_REASON_MEM_ACCESS:
> >>              mem_access_resume(v, &rsp);
> >>              break;
> >>  #endif
> >> diff --git a/xen/include/asm-arm/vm_event.h 
> >> b/xen/include/asm-arm/vm_event.h
> >> index ccc4b60..e56bc78 100644
> >> --- a/xen/include/asm-arm/vm_event.h
> >> +++ b/xen/include/asm-arm/vm_event.h
> >> @@ -40,6 +40,12 @@ static inline void vm_event_toggle_singlestep(struct 
> >> domain *d, struct vcpu *v)
> >>  }
> >>
> >>  static inline
> >> +void vm_event_interrupt_emulate_check(struct vcpu *v, vm_event_response_t 
> >> *rsp)
> >> +{
> >> +    /* Not supported on ARM. */
> >> +}
> >> +
> >> +static inline
> >>  void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t 
> >> *rsp)
> >>  {
> >>      /* Not supported on ARM. */
> >
> > Doesn't it make sense to return some sort of error?
> 
> Not really, there is no path for that error to reach the user who
> triggered this via the vm_event response. Usually if there is an error
> in the operation specified by the response flag we just print a
> message to the Xen console. But since these ops are not supported on
> ARM at all - there is no emulator - it would be kind-of be redundant.

All right then

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.