All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Paul Durrant <paul.durrant@citrix.com>, xen-devel@lists.xenproject.org
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v5 07/16] x86/hvm: unify dpci portio intercept with standard portio intercept
Date: Thu, 2 Jul 2015 17:50:08 +0100	[thread overview]
Message-ID: <55956BC0.1040702@citrix.com> (raw)
In-Reply-To: <1435669558-5421-8-git-send-email-paul.durrant@citrix.com>

On 30/06/15 14:05, Paul Durrant wrote:
> This patch re-works the dpci portio intercepts so that they can be unified
> with standard portio handling thereby removing a substantial amount of
> code duplication.
>
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Cc: Keir Fraser <keir@xen.org>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
>  xen/arch/x86/hvm/hvm.c         |    2 +
>  xen/arch/x86/hvm/intercept.c   |   22 ++--
>  xen/arch/x86/hvm/io.c          |  220 ++++++++++++----------------------------
>  xen/include/asm-x86/hvm/io.h   |    5 +
>  xen/include/asm-x86/hvm/vcpu.h |    2 +
>  xen/include/xen/iommu.h        |    1 -
>  6 files changed, 80 insertions(+), 172 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 60f8972..6643e0c 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1486,6 +1486,8 @@ int hvm_domain_initialise(struct domain *d)
>      else
>          d->arch.hvm_domain.io_bitmap = hvm_io_bitmap;
>  
> +    register_dpci_portio_handler(d);
> +
>      if ( is_pvh_domain(d) )
>      {
>          register_portio_handler(d, 0, 0x10003, handle_pvh_io);
> diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
> index 42050f4..a613865 100644
> --- a/xen/arch/x86/hvm/intercept.c
> +++ b/xen/arch/x86/hvm/intercept.c
> @@ -124,10 +124,7 @@ static int hvm_process_io_intercept(const struct hvm_io_handler *handler,
>  {
>      struct vcpu *curr = current;
>      struct hvm_vcpu_io *vio = &curr->arch.hvm_vcpu.hvm_io;
> -    const struct hvm_io_ops *ops =
> -        (p->type == IOREQ_TYPE_COPY) ?
> -        &mmio_ops :
> -        &portio_ops;
> +    const struct hvm_io_ops *ops = handler->ops;
>      int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
>      uint64_t data;
>      uint64_t addr;
> @@ -247,10 +244,6 @@ static int hvm_process_io_intercept(const struct hvm_io_handler *handler,
>  static const struct hvm_io_handler *hvm_find_io_handler(ioreq_t *p)
>  {
>      struct domain *curr_d = current->domain;
> -    const struct hvm_io_ops *ops =
> -        (p->type == IOREQ_TYPE_COPY) ?
> -        &mmio_ops :
> -        &portio_ops;
>      unsigned int i;
>  
>      BUG_ON((p->type != IOREQ_TYPE_PIO) &&
> @@ -260,6 +253,7 @@ static const struct hvm_io_handler *hvm_find_io_handler(ioreq_t *p)
>      {
>          const struct hvm_io_handler *handler =
>              &curr_d->arch.hvm_domain.io_handler[i];
> +        const struct hvm_io_ops *ops = handler->ops;
>  
>          if ( handler->type != p->type )
>              continue;
> @@ -275,13 +269,7 @@ int hvm_io_intercept(ioreq_t *p)
>  {
>      const struct hvm_io_handler *handler;
>  
> -    if ( p->type == IOREQ_TYPE_PIO )
> -    {
> -        int rc = dpci_ioport_intercept(p);
> -        if ( (rc == X86EMUL_OKAY) || (rc == X86EMUL_RETRY) )
> -            return rc;
> -    }
> -    else if ( p->type == IOREQ_TYPE_COPY )
> +    if ( p->type == IOREQ_TYPE_COPY )
>      {
>          int rc = stdvga_intercept_mmio(p);
>          if ( (rc == X86EMUL_OKAY) || (rc == X86EMUL_RETRY) )
> @@ -296,7 +284,7 @@ int hvm_io_intercept(ioreq_t *p)
>      return hvm_process_io_intercept(handler, p);
>  }
>  
> -static struct hvm_io_handler *hvm_next_io_handler(struct domain *d)
> +struct hvm_io_handler *hvm_next_io_handler(struct domain *d)

Instead of introducing this as a static in patch 5, then modifying it
here to export it, introduce it directly as an exported function in 5.

Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

  reply	other threads:[~2015-07-02 16:50 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 13:05 [PATCH v5 00/16] x86/hvm: I/O emulation cleanup and fix Paul Durrant
2015-06-30 13:05 ` [PATCH v5 01/16] x86/hvm: make sure emulation is retried if domain is shutting down Paul Durrant
2015-06-30 13:45   ` Andrew Cooper
2015-06-30 16:14     ` Don Slutz
2015-06-30 16:29       ` Paul Durrant
2015-06-30 13:05 ` [PATCH v5 02/16] x86/hvm: remove multiple open coded 'chunking' loops Paul Durrant
2015-07-02 15:37   ` Andrew Cooper
2015-07-02 15:55     ` Paul Durrant
2015-07-02 16:03       ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 03/16] x86/hvm: change hvm_mmio_read_t and hvm_mmio_write_t length argument Paul Durrant
2015-07-02 15:39   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 04/16] x86/hvm: restrict port numbers to uint16_t and sizes to unsigned int Paul Durrant
2015-07-02 15:54   ` Andrew Cooper
2015-07-02 15:56     ` Paul Durrant
2015-06-30 13:05 ` [PATCH v5 05/16] x86/hvm: unify internal portio and mmio intercepts Paul Durrant
2015-07-02 14:52   ` Roger Pau Monné
2015-07-02 15:02     ` Paul Durrant
2015-07-02 15:12       ` Roger Pau Monné
2015-07-02 15:12         ` Paul Durrant
2015-07-02 16:29   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 06/16] x86/hvm: add length to mmio check op Paul Durrant
2015-07-02 16:37   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 07/16] x86/hvm: unify dpci portio intercept with standard portio intercept Paul Durrant
2015-07-02 16:50   ` Andrew Cooper [this message]
2015-06-30 13:05 ` [PATCH v5 08/16] x86/hvm: unify stdvga mmio intercept with standard mmio intercept Paul Durrant
2015-07-02 16:55   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 09/16] x86/hvm: limit reps to avoid the need to handle retry Paul Durrant
2015-07-02 17:10   ` Andrew Cooper
2015-07-02 17:14     ` Paul Durrant
2015-07-02 17:31       ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 10/16] x86/hvm: only call hvm_io_assist() from hvm_wait_for_io() Paul Durrant
2015-07-03 15:03   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 11/16] x86/hvm: split I/O completion handling from state model Paul Durrant
2015-07-03 15:08   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 12/16] x86/hvm: remove HVMIO_dispatched I/O state Paul Durrant
2015-07-03 15:12   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 13/16] x86/hvm: remove hvm_io_state enumeration Paul Durrant
2015-07-03 15:13   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 14/16] x86/hvm: use ioreq_t to track in-flight state Paul Durrant
2015-07-03 15:15   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 15/16] x86/hvm: always re-emulate I/O from a buffer Paul Durrant
2015-07-03 15:26   ` Andrew Cooper
2015-06-30 13:05 ` [PATCH v5 16/16] x86/hvm: track large memory mapped accesses by buffer offset Paul Durrant
2015-07-03 15:26   ` Andrew Cooper
2015-06-30 14:48 ` [PATCH v5 00/16] x86/hvm: I/O emulation cleanup and fix Fabio Fantoni
2015-07-07 11:19   ` Fabio Fantoni

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=55956BC0.1040702@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=paul.durrant@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.