From: kfraser@localhost.localdomain Date: Thu, 2 Nov 2006 18:18:19 +0000 (+0000) Subject: [BLKTAP] Fix Linux and Xen gnttab map operations when mapping into X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=af7afdc2a162a22d81b3b82a9f8784062e784bc0;p=xen.git [BLKTAP] Fix Linux and Xen gnttab map operations when mapping into PTEs above 4GB on PAE systems. Signed-off-by: Steven Rostedt --- diff --git a/linux-2.6-xen-sparse/include/xen/gnttab.h b/linux-2.6-xen-sparse/include/xen/gnttab.h index 676fca5054..c710140ee7 100644 --- a/linux-2.6-xen-sparse/include/xen/gnttab.h +++ b/linux-2.6-xen-sparse/include/xen/gnttab.h @@ -118,7 +118,7 @@ int gnttab_suspend(void); int gnttab_resume(void); static inline void -gnttab_set_map_op(struct gnttab_map_grant_ref *map, unsigned long addr, +gnttab_set_map_op(struct gnttab_map_grant_ref *map, uint64_t addr, uint32_t flags, grant_ref_t ref, domid_t domid) { if (flags & GNTMAP_contains_pte) @@ -134,7 +134,7 @@ gnttab_set_map_op(struct gnttab_map_grant_ref *map, unsigned long addr, } static inline void -gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, unsigned long addr, +gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, uint64_t addr, uint32_t flags, grant_handle_t handle) { if (flags & GNTMAP_contains_pte) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 58009872ca..88d031fac4 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2379,7 +2379,7 @@ int do_mmu_update( static int create_grant_pte_mapping( - unsigned long pte_addr, l1_pgentry_t nl1e, struct vcpu *v) + uint64_t pte_addr, l1_pgentry_t nl1e, struct vcpu *v) { int rc = GNTST_okay; void *va; @@ -2403,7 +2403,7 @@ static int create_grant_pte_mapping( } va = map_domain_page(mfn); - va = (void *)((unsigned long)va + (pte_addr & ~PAGE_MASK)); + va = (void *)((unsigned long)va + ((unsigned long)pte_addr & ~PAGE_MASK)); page = mfn_to_page(mfn); type = page->u.inuse.type_info & PGT_type_mask; @@ -2435,7 +2435,7 @@ static int create_grant_pte_mapping( } static int destroy_grant_pte_mapping( - unsigned long addr, unsigned long frame, struct domain *d) + uint64_t addr, unsigned long frame, struct domain *d) { int rc = GNTST_okay; void *va; @@ -2454,7 +2454,7 @@ static int destroy_grant_pte_mapping( } va = map_domain_page(mfn); - va = (void *)((unsigned long)va + (addr & ~PAGE_MASK)); + va = (void *)((unsigned long)va + ((unsigned long)addr & ~PAGE_MASK)); page = mfn_to_page(mfn); type = page->u.inuse.type_info & PGT_type_mask; @@ -2475,7 +2475,7 @@ static int destroy_grant_pte_mapping( /* Check that the virtual address supplied is actually mapped to frame. */ if ( unlikely((l1e_get_intpte(ol1e) >> PAGE_SHIFT) != frame) ) { - MEM_LOG("PTE entry %lx for address %lx doesn't match frame %lx", + MEM_LOG("PTE entry %lx for address %"PRIx64" doesn't match frame %lx", (unsigned long)l1e_get_intpte(ol1e), addr, frame); put_page_type(page); rc = GNTST_general_error; @@ -2575,7 +2575,7 @@ static int destroy_grant_va_mapping( } int create_grant_host_mapping( - unsigned long addr, unsigned long frame, unsigned int flags) + uint64_t addr, unsigned long frame, unsigned int flags) { l1_pgentry_t pte = l1e_from_pfn(frame, GRANT_PTE_FLAGS); @@ -2590,7 +2590,7 @@ int create_grant_host_mapping( } int destroy_grant_host_mapping( - unsigned long addr, unsigned long frame, unsigned int flags) + uint64_t addr, unsigned long frame, unsigned int flags) { if ( flags & GNTMAP_contains_pte ) return destroy_grant_pte_mapping(addr, frame, current->domain); diff --git a/xen/include/asm-x86/grant_table.h b/xen/include/asm-x86/grant_table.h index 6fa67ff883..9941a5c6f8 100644 --- a/xen/include/asm-x86/grant_table.h +++ b/xen/include/asm-x86/grant_table.h @@ -14,9 +14,9 @@ * must hold a reference to the page. */ int create_grant_host_mapping( - unsigned long addr, unsigned long frame, unsigned int flags); + uint64_t addr, unsigned long frame, unsigned int flags); int destroy_grant_host_mapping( - unsigned long addr, unsigned long frame, unsigned int flags); + uint64_t addr, unsigned long frame, unsigned int flags); #define gnttab_create_shared_page(d, t, i) \ do { \