direct-io.hg

changeset 12213:4eac59fe1abc

[BLKTAP] Fix Linux and Xen gnttab map operations when mapping into
PTEs above 4GB on PAE systems.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
author kfraser@localhost.localdomain
date Thu Nov 02 18:18:19 2006 +0000 (2006-11-02)
parents 45e34f00a78f
children 4c2d9a2ef1b7
files linux-2.6-xen-sparse/include/xen/gnttab.h xen/arch/x86/mm.c xen/include/asm-x86/grant_table.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/xen/gnttab.h	Thu Nov 02 15:55:51 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/include/xen/gnttab.h	Thu Nov 02 18:18:19 2006 +0000
     1.3 @@ -118,7 +118,7 @@ int gnttab_suspend(void);
     1.4  int gnttab_resume(void);
     1.5  
     1.6  static inline void
     1.7 -gnttab_set_map_op(struct gnttab_map_grant_ref *map, unsigned long addr,
     1.8 +gnttab_set_map_op(struct gnttab_map_grant_ref *map, uint64_t addr,
     1.9  		  uint32_t flags, grant_ref_t ref, domid_t domid)
    1.10  {
    1.11  	if (flags & GNTMAP_contains_pte)
    1.12 @@ -134,7 +134,7 @@ gnttab_set_map_op(struct gnttab_map_gran
    1.13  }
    1.14  
    1.15  static inline void
    1.16 -gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, unsigned long addr,
    1.17 +gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, uint64_t addr,
    1.18  		    uint32_t flags, grant_handle_t handle)
    1.19  {
    1.20  	if (flags & GNTMAP_contains_pte)
     2.1 --- a/xen/arch/x86/mm.c	Thu Nov 02 15:55:51 2006 +0000
     2.2 +++ b/xen/arch/x86/mm.c	Thu Nov 02 18:18:19 2006 +0000
     2.3 @@ -2379,7 +2379,7 @@ int do_mmu_update(
     2.4  
     2.5  
     2.6  static int create_grant_pte_mapping(
     2.7 -    unsigned long pte_addr, l1_pgentry_t nl1e, struct vcpu *v)
     2.8 +    uint64_t pte_addr, l1_pgentry_t nl1e, struct vcpu *v)
     2.9  {
    2.10      int rc = GNTST_okay;
    2.11      void *va;
    2.12 @@ -2403,7 +2403,7 @@ static int create_grant_pte_mapping(
    2.13      }
    2.14      
    2.15      va = map_domain_page(mfn);
    2.16 -    va = (void *)((unsigned long)va + (pte_addr & ~PAGE_MASK));
    2.17 +    va = (void *)((unsigned long)va + ((unsigned long)pte_addr & ~PAGE_MASK));
    2.18      page = mfn_to_page(mfn);
    2.19  
    2.20      type = page->u.inuse.type_info & PGT_type_mask;
    2.21 @@ -2435,7 +2435,7 @@ static int create_grant_pte_mapping(
    2.22  }
    2.23  
    2.24  static int destroy_grant_pte_mapping(
    2.25 -    unsigned long addr, unsigned long frame, struct domain *d)
    2.26 +    uint64_t addr, unsigned long frame, struct domain *d)
    2.27  {
    2.28      int rc = GNTST_okay;
    2.29      void *va;
    2.30 @@ -2454,7 +2454,7 @@ static int destroy_grant_pte_mapping(
    2.31      }
    2.32      
    2.33      va = map_domain_page(mfn);
    2.34 -    va = (void *)((unsigned long)va + (addr & ~PAGE_MASK));
    2.35 +    va = (void *)((unsigned long)va + ((unsigned long)addr & ~PAGE_MASK));
    2.36      page = mfn_to_page(mfn);
    2.37  
    2.38      type = page->u.inuse.type_info & PGT_type_mask;
    2.39 @@ -2475,7 +2475,7 @@ static int destroy_grant_pte_mapping(
    2.40      /* Check that the virtual address supplied is actually mapped to frame. */
    2.41      if ( unlikely((l1e_get_intpte(ol1e) >> PAGE_SHIFT) != frame) )
    2.42      {
    2.43 -        MEM_LOG("PTE entry %lx for address %lx doesn't match frame %lx",
    2.44 +        MEM_LOG("PTE entry %lx for address %"PRIx64" doesn't match frame %lx",
    2.45                  (unsigned long)l1e_get_intpte(ol1e), addr, frame);
    2.46          put_page_type(page);
    2.47          rc = GNTST_general_error;
    2.48 @@ -2575,7 +2575,7 @@ static int destroy_grant_va_mapping(
    2.49  }
    2.50  
    2.51  int create_grant_host_mapping(
    2.52 -    unsigned long addr, unsigned long frame, unsigned int flags)
    2.53 +    uint64_t addr, unsigned long frame, unsigned int flags)
    2.54  {
    2.55      l1_pgentry_t pte = l1e_from_pfn(frame, GRANT_PTE_FLAGS);
    2.56  
    2.57 @@ -2590,7 +2590,7 @@ int create_grant_host_mapping(
    2.58  }
    2.59  
    2.60  int destroy_grant_host_mapping(
    2.61 -    unsigned long addr, unsigned long frame, unsigned int flags)
    2.62 +    uint64_t addr, unsigned long frame, unsigned int flags)
    2.63  {
    2.64      if ( flags & GNTMAP_contains_pte )
    2.65          return destroy_grant_pte_mapping(addr, frame, current->domain);
     3.1 --- a/xen/include/asm-x86/grant_table.h	Thu Nov 02 15:55:51 2006 +0000
     3.2 +++ b/xen/include/asm-x86/grant_table.h	Thu Nov 02 18:18:19 2006 +0000
     3.3 @@ -14,9 +14,9 @@
     3.4   * must hold a reference to the page.
     3.5   */
     3.6  int create_grant_host_mapping(
     3.7 -    unsigned long addr, unsigned long frame, unsigned int flags);
     3.8 +    uint64_t addr, unsigned long frame, unsigned int flags);
     3.9  int destroy_grant_host_mapping(
    3.10 -    unsigned long addr, unsigned long frame, unsigned int flags);
    3.11 +    uint64_t addr, unsigned long frame, unsigned int flags);
    3.12  
    3.13  #define gnttab_create_shared_page(d, t, i)                               \
    3.14      do {                                                                 \