xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH 2/2] x86/HVM: fix forwarding of internally cached requests (part 2)
Date: Thu, 28 Apr 2016 09:49:11 +0000	[thread overview]
Message-ID: <38c92848f2f341cf8890b4f65317d87d@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <5721F50602000078000E6ACB@prv-mh.provo.novell.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 28 April 2016 10:33
> To: xen-devel
> Cc: Paul Durrant; Wei Liu
> Subject: [PATCH 2/2] x86/HVM: fix forwarding of internally cached requests
> (part 2)
> 
> Commit 96ae556569 ("x86/HVM: fix forwarding of internally cached
> requests") wasn't quite complete: hvmemul_do_io() also needs to
> propagate up the clipped count. (I really should have re-tested the
> forward port resulting in the earlier change, instead of relying on the
> testing done on the older version of Xen which the fix was first needed
> for.)
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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

> 
> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -137,7 +137,7 @@ static int hvmemul_do_io(
>          if ( (p.type != (is_mmio ? IOREQ_TYPE_COPY : IOREQ_TYPE_PIO)) ||
>               (p.addr != addr) ||
>               (p.size != size) ||
> -             (p.count != *reps) ||
> +             (p.count > *reps) ||
>               (p.dir != dir) ||
>               (p.df != df) ||
>               (p.data_is_ptr != data_is_addr) )
> @@ -145,6 +145,8 @@ static int hvmemul_do_io(
> 
>          if ( data_is_addr )
>              return X86EMUL_UNHANDLEABLE;
> +
> +        *reps = p.count;
>          goto finish_access;
>      default:
>          return X86EMUL_UNHANDLEABLE;
> @@ -162,6 +164,13 @@ static int hvmemul_do_io(
> 
>      rc = hvm_io_intercept(&p);
> 
> +    /*
> +     * p.count may have got reduced (see hvm_process_io_intercept()) -
> inform
> +     * our callers and mirror this into latched state.
> +     */
> +    ASSERT(p.count <= *reps);
> +    *reps = vio->io_req.count = p.count;
> +
>      switch ( rc )
>      {
>      case X86EMUL_OKAY:
> 
> 


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

  reply	other threads:[~2016-04-28  9:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28  9:21 [PATCH 0/2] x86/HVM: hvmemul_do_io() fixes Jan Beulich
2016-04-28  9:32 ` [PATCH 1/2] x86/HVM: fix emulation re-issue check Jan Beulich
2016-04-28  9:44   ` Andrew Cooper
2016-04-28  9:33 ` [PATCH 2/2] x86/HVM: fix forwarding of internally cached requests (part 2) Jan Beulich
2016-04-28  9:49   ` Paul Durrant [this message]
2016-04-28  9:52   ` Andrew Cooper
2016-04-28 10:28 ` [PATCH 0/2] x86/HVM: hvmemul_do_io() fixes Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38c92848f2f341cf8890b4f65317d87d@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).