diff options
author | Juergen Gross <jgross@suse.com> | 2015-01-12 00:05:09 -0500 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2015-01-12 05:09:48 -0500 |
commit | e86f949667127509d95b6c678fdd928b93128d9d (patch) | |
tree | cfad06865b89289687b97721d3d8ae201262d98d | |
parent | f241b0b891c903da2465b7a98eaf650784e666da (diff) |
xen: use correct type for physical addresses
When converting a pfn to a physical address be sure to use 64 bit
wide types or convert the physical address to a pfn if possible.
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
-rw-r--r-- | arch/x86/xen/setup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index feb6d86fa0a0..410210f279bf 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -140,7 +140,7 @@ static void __init xen_del_extra_mem(u64 start, u64 size) | |||
140 | unsigned long __ref xen_chk_extra_mem(unsigned long pfn) | 140 | unsigned long __ref xen_chk_extra_mem(unsigned long pfn) |
141 | { | 141 | { |
142 | int i; | 142 | int i; |
143 | unsigned long addr = PFN_PHYS(pfn); | 143 | phys_addr_t addr = PFN_PHYS(pfn); |
144 | 144 | ||
145 | for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) { | 145 | for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) { |
146 | if (addr >= xen_extra_mem[i].start && | 146 | if (addr >= xen_extra_mem[i].start && |
@@ -284,7 +284,7 @@ static void __init xen_update_mem_tables(unsigned long pfn, unsigned long mfn) | |||
284 | } | 284 | } |
285 | 285 | ||
286 | /* Update kernel mapping, but not for highmem. */ | 286 | /* Update kernel mapping, but not for highmem. */ |
287 | if ((pfn << PAGE_SHIFT) >= __pa(high_memory)) | 287 | if (pfn >= PFN_UP(__pa(high_memory - 1))) |
288 | return; | 288 | return; |
289 | 289 | ||
290 | if (HYPERVISOR_update_va_mapping((unsigned long)__va(pfn << PAGE_SHIFT), | 290 | if (HYPERVISOR_update_va_mapping((unsigned long)__va(pfn << PAGE_SHIFT), |