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

Re: [Xen-devel] [PATCH] x86/HVM: correct last address emulation acceptance check


  • To: Jan Beulich <JBeulich@xxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
  • Date: Tue, 26 Apr 2016 08:37:32 +0000
  • Accept-language: en-GB, en-US
  • Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
  • Delivery-date: Tue, 26 Apr 2016 08:37:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: AQHRn5TWbDocIH/U4ECLCKK/MDW5Vp+b7mbA
  • Thread-topic: [PATCH] x86/HVM: correct last address emulation acceptance check

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: 26 April 2016 09:23
> To: xen-devel
> Cc: Paul Durrant; Wei Liu
> Subject: [PATCH] x86/HVM: correct last address emulation acceptance check
> 
> For REPeated memory access instructions the repeat count also needs to
> be considered. Utilize that "last" already takes this into account.
> 
> Also defer computing "last" until we really know we need it.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>

> 
> --- a/xen/arch/x86/hvm/intercept.c
> +++ b/xen/arch/x86/hvm/intercept.c
> @@ -34,16 +34,16 @@
>  static bool_t hvm_mmio_accept(const struct hvm_io_handler *handler,
>                                const ioreq_t *p)
>  {
> -    paddr_t first = hvm_mmio_first_byte(p);
> -    paddr_t last = hvm_mmio_last_byte(p);
> +    paddr_t first = hvm_mmio_first_byte(p), last;
> 
>      BUG_ON(handler->type != IOREQ_TYPE_COPY);
> 
>      if ( !handler->mmio.ops->check(current, first) )
>          return 0;
> 
> -    /* Make sure the handler will accept the whole access */
> -    if ( p->size > 1 &&
> +    /* Make sure the handler will accept the whole access. */
> +    last = hvm_mmio_last_byte(p);
> +    if ( last != first &&
>           !handler->mmio.ops->check(current, last) )
>          domain_crash(current->domain);
> 
> 
> 


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

 


Rackspace

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