From: Jean Guyader Date: Mon, 30 Nov 2009 16:41:50 +0000 (+0000) Subject: grant table v2: sync the grant_entry_v2 struct with xen. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=985779b348db29529a2a91474f862100093763a5;p=xenclient%2Flinux-2.6.27-pq.git grant table v2: sync the grant_entry_v2 struct with xen. --- diff --git a/master/v2_grant_tables b/master/v2_grant_tables index 2d482ce..d0a79d0 100644 --- a/master/v2_grant_tables +++ b/master/v2_grant_tables @@ -4,7 +4,7 @@ Signed-off-by: Steven Smith diff --git a/drivers/xen/core/gnttab.c b/drivers/xen/core/gnttab.c -index aaf526d..1ef44d4 100644 +index aaf526d..f42aa48 100644 --- a/drivers/xen/core/gnttab.c +++ b/drivers/xen/core/gnttab.c @@ -53,19 +53,35 @@ @@ -87,7 +87,7 @@ index aaf526d..1ef44d4 100644 + wmb(); + shared.v1[ref].flags = GTF_permit_access | flags; + } else { -+ shared.v2[ref].frame = frame; ++ shared.v2[ref].full_page.frame = frame; + shared.v2[ref].hdr.domid = domid; + wmb(); + shared.v2[ref].hdr.flags = GTF_permit_access | flags; @@ -346,7 +346,7 @@ index aaf526d..1ef44d4 100644 + wmb(); + shared.v1[ref].flags = GTF_accept_transfer; + } else { -+ shared.v2[ref].frame = pfn; ++ shared.v2[ref].full_page.frame = pfn; + shared.v2[ref].hdr.domid = domid; + wmb(); + shared.v2[ref].hdr.flags = GTF_accept_transfer; @@ -411,7 +411,7 @@ index aaf526d..1ef44d4 100644 + if (grant_table_version == 1) + frame = shared.v1[ref].frame; + else -+ frame = shared.v2[ref].frame; ++ frame = shared.v2[ref].full_page.frame; + BUG_ON(frame == 0); + + return frame; @@ -822,7 +822,7 @@ index bde65fd..b4610d9 100644 void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid, unsigned long pfn); diff --git a/include/xen/interface/grant_table.h b/include/xen/interface/grant_table.h -index c5c2044..20c4915 100644 +index c5c2044..2359822 100644 --- a/include/xen/interface/grant_table.h +++ b/include/xen/interface/grant_table.h @@ -84,12 +84,22 @@ @@ -891,7 +891,7 @@ index c5c2044..20c4915 100644 /* * Subflags for GTF_accept_transfer: -@@ -149,15 +167,76 @@ typedef struct grant_entry grant_entry_t; +@@ -149,15 +167,86 @@ typedef struct grant_entry grant_entry_t; #define _GTF_transfer_completed (3) #define GTF_transfer_completed (1U<<_GTF_transfer_completed) @@ -922,15 +922,23 @@ index c5c2044..20c4915 100644 - * Reference to a grant entry in a specified domain's grant table. + * Version 2 of the grant entry structure. + */ -+struct grant_entry_v2 { ++union grant_entry_v2 { + grant_entry_header_t hdr; + union { + /* -+ * The frame to which we are granting access. This field has -+ * the same meaning as the grant_entry_v1 field of the same -+ * name. ++ * This member is used for V1-style full page grants, where either: ++ * ++ * -- hdr.type is GTF_accept_transfer, or ++ * -- hdr.type is GTF_permit_access and GTF_sub_page is not set. ++ * ++ * In that case, the frame field has the same semantics as the ++ * field of the same name in the V1 entry structure. + */ -+ uint32_t frame; ++ struct { ++ grant_entry_header_t hdr; ++ uint32_t pad0; ++ uint64_t frame; ++ } full_page; + + /* + * If the grant type is GTF_grant_access and GTF_sub_page is @@ -938,9 +946,10 @@ index c5c2044..20c4915 100644 + * [@page_off,@page_off+@length) in frame @frame. + */ + struct { -+ uint32_t frame; ++ grant_entry_header_t hdr; + uint16_t page_off; + uint16_t length; ++ uint64_t frame; + } sub_page; + + /* @@ -953,15 +962,16 @@ index c5c2044..20c4915 100644 + * to be mapped. + */ + struct { ++ grant_entry_header_t hdr; + domid_t trans_domid; + uint16_t pad0; + grant_ref_t gref; + } transitive; + -+ uint32_t __spacer[3]; /* Pad to a power of two */ ++ uint32_t __spacer[4]; /* Pad to a power of two */ + }; +}; -+typedef struct grant_entry_v2 grant_entry_v2_t; ++typedef union grant_entry_v2 grant_entry_v2_t; + +typedef uint16_t grant_status_t; + @@ -972,7 +982,7 @@ index c5c2044..20c4915 100644 /* * Handle to track a mapping created via a grant reference. -@@ -365,6 +444,46 @@ struct gnttab_unmap_and_replace { +@@ -365,6 +454,46 @@ struct gnttab_unmap_and_replace { typedef struct gnttab_unmap_and_replace gnttab_unmap_and_replace_t; DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_and_replace_t);