aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakw27@arcadians.cl.cam.ac.uk <akw27@arcadians.cl.cam.ac.uk>2005-08-13 15:47:53 +0000
committerakw27@arcadians.cl.cam.ac.uk <akw27@arcadians.cl.cam.ac.uk>2005-08-13 15:47:53 +0000
commit104a3d1255c2e016fa57cb73cc0009cc35d0819c (patch)
tree8cc7d13ecfbde07b733944657fe38e6f9d67bec5
parent561b5b9cd3adfada03a77f45389583dc2efb5ff8 (diff)
downloadxen-104a3d1255c2e016fa57cb73cc0009cc35d0819c.tar.gz
xen-104a3d1255c2e016fa57cb73cc0009cc35d0819c.tar.bz2
xen-104a3d1255c2e016fa57cb73cc0009cc35d0819c.zip
Remove unnecessary union in grant table map/unmap ops.
All addresses, host virtual and PTEs, are now passed in the cunningly ambiguous "host_addr" field, rather than in an anonymous union.
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c8
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/blkback/interface.c4
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/netback/netback.c6
-rw-r--r--tools/libxc/xc_gnttab.c4
-rw-r--r--xen/arch/ia64/grant_table.c4
-rw-r--r--xen/common/grant_table.c6
-rw-r--r--xen/include/public/grant_table.h17
7 files changed, 23 insertions, 26 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
index 1121aeb56b..eb26470286 100644
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
@@ -120,10 +120,10 @@ static void fast_flush_area(int idx, int nr_pages)
{
if ( BLKBACK_INVALID_HANDLE != ( handle = pending_handle(idx, i) ) )
{
- unmap[i].host_virt_addr = MMAP_VADDR(idx, i);
+ unmap[i].host_addr = MMAP_VADDR(idx, i);
unmap[i].dev_bus_addr = 0;
unmap[i].handle = handle;
- pending_handle(idx, i) = BLKBACK_INVALID_HANDLE;
+ pending_handle(idx, i) = BLKBACK_INVALID_HANDLE;
invcount++;
}
}
@@ -383,7 +383,7 @@ static void dispatch_probe(blkif_t *blkif, blkif_request_t *req)
{
struct gnttab_map_grant_ref map;
- map.host_virt_addr = MMAP_VADDR(pending_idx, 0);
+ map.host_addr = MMAP_VADDR(pending_idx, 0);
map.flags = GNTMAP_host_map;
map.ref = blkif_gref_from_fas(req->frame_and_sects[0]);
map.dom = blkif->domid;
@@ -480,7 +480,7 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req)
goto bad_descriptor;
preq.nr_sects += seg[i].nsec;
- map[i].host_virt_addr = MMAP_VADDR(pending_idx, i);
+ map[i].host_addr = MMAP_VADDR(pending_idx, i);
map[i].dom = blkif->domid;
map[i].ref = blkif_gref_from_fas(fas);
map[i].flags = GNTMAP_host_map;
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c
index b62c2d345d..14de83c92f 100644
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c
@@ -42,7 +42,7 @@ static void __blkif_disconnect_complete(void *arg)
* must still be notified to the remote driver.
*/
#ifdef CONFIG_XEN_BLKDEV_GRANT
- op.host_virt_addr = blkif->shmem_vaddr;
+ op.host_addr = blkif->shmem_vaddr;
op.handle = blkif->shmem_handle;
op.dev_bus_addr = 0;
BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1));
@@ -204,7 +204,7 @@ void blkif_connect(blkif_be_connect_t *connect)
#else
{ /* Map: Use the Grant table reference */
struct gnttab_map_grant_ref op;
- op.host_virt_addr = VMALLOC_VMADDR(vma->addr);
+ op.host_addr = VMALLOC_VMADDR(vma->addr);
op.flags = GNTMAP_host_map;
op.ref = ref;
op.dom = domid;
diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c
index edc6c67d1f..8be345edea 100644
--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c
@@ -511,9 +511,9 @@ inline static void net_tx_action_dealloc(void)
gop = unmap_ops;
while (dc != dp) {
pending_idx = dealloc_ring[MASK_PEND_IDX(dc++)];
- gop->host_virt_addr = MMAP_VADDR(pending_idx);
+ gop->host_addr = MMAP_VADDR(pending_idx);
gop->dev_bus_addr = 0;
- gop->handle = grant_tx_ref[pending_idx];
+ gop->handle = grant_tx_ref[pending_idx];
grant_tx_ref[pending_idx] = GRANT_INVALID_REF;
gop++;
}
@@ -699,7 +699,7 @@ static void net_tx_action(unsigned long unused)
/* Packets passed to netif_rx() must have some headroom. */
skb_reserve(skb, 16);
#ifdef CONFIG_XEN_NETDEV_GRANT_TX
- mop->host_virt_addr = MMAP_VADDR(pending_idx);
+ mop->host_addr = MMAP_VADDR(pending_idx);
mop->dom = netif->domid;
mop->ref = txreq.addr >> PAGE_SHIFT;
mop->flags = GNTMAP_host_map | GNTMAP_readonly;
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index 4101ca74dd..83fcf9218c 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -50,7 +50,7 @@ int xc_gnttab_map_grant_ref(int xc_handle,
struct gnttab_map_grant_ref op;
int rc;
- op.host_virt_addr = host_virt_addr;
+ op.host_addr = host_virt_addr;
op.dom = (domid_t)dom;
op.ref = ref;
op.flags = flags;
@@ -75,7 +75,7 @@ int xc_gnttab_unmap_grant_ref(int xc_handle,
struct gnttab_unmap_grant_ref op;
int rc;
- op.host_virt_addr = host_virt_addr;
+ op.host_addr = host_virt_addr;
op.dev_bus_addr = dev_bus_addr;
op.handle = handle;
diff --git a/xen/arch/ia64/grant_table.c b/xen/arch/ia64/grant_table.c
index 9436347779..7e25dda2f4 100644
--- a/xen/arch/ia64/grant_table.c
+++ b/xen/arch/ia64/grant_table.c
@@ -355,7 +355,7 @@ __gnttab_map_grant_ref(
/* Bitwise-OR avoids short-circuiting which screws control flow. */
if ( unlikely(__get_user(dom, &uop->dom) |
__get_user(ref, &uop->ref) |
- __get_user(host_virt_addr, &uop->host_virt_addr) |
+ __get_user(host_virt_addr, &uop->host_addr) |
__get_user(dev_hst_ro_flags, &uop->flags)) )
{
DPRINTK("Fault while reading gnttab_map_grant_ref_t.\n");
@@ -500,7 +500,7 @@ __gnttab_unmap_grant_ref(
ld = current->domain;
/* Bitwise-OR avoids short-circuiting which screws control flow. */
- if ( unlikely(__get_user(virt, &uop->host_virt_addr) |
+ if ( unlikely(__get_user(virt, &uop->host_addr) |
__get_user(frame, &uop->dev_bus_addr) |
__get_user(handle, &uop->handle)) )
{
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 3a40b7ca3c..b5bec9e229 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -97,7 +97,7 @@ __gnttab_activate_grant_ref(
* Returns:
* . -ve: error
* . 1: ok
- * . 0: ok and TLB invalidate of host_virt_addr needed.
+ * . 0: ok and TLB invalidate of host_addr needed.
*
* On success, *pframe contains mfn.
*/
@@ -356,7 +356,7 @@ __gnttab_map_grant_ref(
/* Bitwise-OR avoids short-circuiting which screws control flow. */
if ( unlikely(__get_user(dom, &uop->dom) |
__get_user(ref, &uop->ref) |
- __get_user(addr, &uop->host_virt_addr) |
+ __get_user(addr, &uop->host_addr) |
__get_user(dev_hst_ro_flags, &uop->flags)) )
{
DPRINTK("Fault while reading gnttab_map_grant_ref_t.\n");
@@ -512,7 +512,7 @@ __gnttab_unmap_grant_ref(
ld = current->domain;
/* Bitwise-OR avoids short-circuiting which screws control flow. */
- if ( unlikely(__get_user(addr, &uop->host_virt_addr) |
+ if ( unlikely(__get_user(addr, &uop->host_addr) |
__get_user(frame, &uop->dev_bus_addr) |
__get_user(handle, &uop->handle)) )
{
diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
index a0eee5c957..b70bb65856 100644
--- a/xen/include/public/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -142,7 +142,10 @@ typedef u16 grant_ref_t;
* 1. If GNTPIN_map_for_dev is specified then <dev_bus_addr> is the address
* via which I/O devices may access the granted frame.
* 2. If GNTPIN_map_for_host is specified then a mapping will be added at
- * virtual address <host_virt_addr> in the current address space.
+ * either a host virtual address in the current address space, or at
+ * a PTE at the specified machine address. The type of mapping to
+ * perform is selected through the GNTMAP_contains_pte flag, and the
+ * address is specified in <host_addr>.
* 3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
* host mapping is destroyed by other means then it is *NOT* guaranteed
* to be accounted to the correct grant reference!
@@ -150,10 +153,7 @@ typedef u16 grant_ref_t;
#define GNTTABOP_map_grant_ref 0
typedef struct gnttab_map_grant_ref {
/* IN parameters. */
- union {
- memory_t pte_addr;
- memory_t host_virt_addr;
- };
+ memory_t host_addr;
domid_t dom;
grant_ref_t ref;
u16 flags; /* GNTMAP_* */
@@ -164,7 +164,7 @@ typedef struct gnttab_map_grant_ref {
/*
* GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
- * tracked by <handle>. If <host_virt_addr> or <dev_bus_addr> is zero, that
+ * tracked by <handle>. If <host_addr> or <dev_bus_addr> is zero, that
* field is ignored. If non-zero, they must refer to a device/host mapping
* that is tracked by <handle>
* NOTES:
@@ -176,10 +176,7 @@ typedef struct gnttab_map_grant_ref {
#define GNTTABOP_unmap_grant_ref 1
typedef struct gnttab_unmap_grant_ref {
/* IN parameters. */
- union {
- memory_t pte_addr;
- memory_t host_virt_addr;
- };
+ memory_t host_addr;
memory_t dev_bus_addr;
u16 handle;
/* OUT parameters. */