From: Yu Zhang <yu.c.zhang@linux.intel.com>
To: xen-devel@lists.xen.org, Paul.Durrant@citrix.com,
ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com,
ian.campbell@citrix.com, wei.liu2@citrix.com, keir@xen.org,
jbeulich@suse.com, andrew.cooper3@citrix.com
Cc: kevin.tian@intel.com, zhiyuan.lv@intel.com
Subject: [PATCH v6 1/3] Remove identical relationship between ioreq type and rangeset type.
Date: Wed, 19 Aug 2015 17:15:47 +0800 [thread overview]
Message-ID: <1439975749-11225-2-git-send-email-yu.c.zhang@linux.intel.com> (raw)
In-Reply-To: <1439975749-11225-1-git-send-email-yu.c.zhang@linux.intel.com>
This patch uses HVMOP_IO_RANGE_XXX values rather than the raw ioreq
type to select the ioreq server, therefore the identical relationship
between ioreq type and rangeset type is no longer necessary.
Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
---
xen/arch/x86/hvm/hvm.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c957610..bc36b9d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2545,7 +2545,7 @@ struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
PCI_SLOT(CF8_BDF(cf8)),
PCI_FUNC(CF8_BDF(cf8)));
- type = IOREQ_TYPE_PCI_CONFIG;
+ type = HVMOP_IO_RANGE_PCI;
addr = ((uint64_t)sbdf << 32) |
CF8_ADDR_LO(cf8) |
(p->addr & 3);
@@ -2563,7 +2563,8 @@ struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
}
else
{
- type = p->type;
+ type = (p->type == IOREQ_TYPE_PIO) ?
+ HVMOP_IO_RANGE_PORT: HVMOP_IO_RANGE_MEMORY;
addr = p->addr;
}
@@ -2579,31 +2580,28 @@ struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
if ( !s->enabled )
continue;
- BUILD_BUG_ON(IOREQ_TYPE_PIO != HVMOP_IO_RANGE_PORT);
- BUILD_BUG_ON(IOREQ_TYPE_COPY != HVMOP_IO_RANGE_MEMORY);
- BUILD_BUG_ON(IOREQ_TYPE_PCI_CONFIG != HVMOP_IO_RANGE_PCI);
r = s->range[type];
switch ( type )
{
unsigned long end;
- case IOREQ_TYPE_PIO:
+ case HVMOP_IO_RANGE_PORT:
end = addr + p->size - 1;
if ( rangeset_contains_range(r, addr, end) )
return s;
break;
- case IOREQ_TYPE_COPY:
+ case HVMOP_IO_RANGE_MEMORY:
end = addr + (p->size * p->count) - 1;
if ( rangeset_contains_range(r, addr, end) )
return s;
break;
- case IOREQ_TYPE_PCI_CONFIG:
+ case HVMOP_IO_RANGE_PCI:
if ( rangeset_contains_singleton(r, addr >> 32) )
{
- p->type = type;
+ p->type = IOREQ_TYPE_PCI_CONFIG;
p->addr = addr;
return s;
}
--
1.9.1
next prev parent reply other threads:[~2015-08-19 9:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-19 9:15 [PATCH v6 0/3] Refactor ioreq server for better performance Yu Zhang
2015-08-19 9:15 ` Yu Zhang [this message]
2015-08-19 16:13 ` [PATCH v6 1/3] Remove identical relationship between ioreq type and rangeset type Paul Durrant
2015-08-19 9:15 ` [PATCH v6 2/3] Differentiate IO/mem resources tracked by ioreq server Yu Zhang
2015-08-19 16:16 ` Paul Durrant
2015-08-21 2:30 ` Yu, Zhang
2015-08-19 9:15 ` [PATCH v6 3/3] Refactor rangeset structure for better performance Yu Zhang
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=1439975749-11225-2-git-send-email-yu.c.zhang@linux.intel.com \
--to=yu.c.zhang@linux.intel.com \
--cc=Paul.Durrant@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=kevin.tian@intel.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=zhiyuan.lv@intel.com \
/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.