# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID d0a4f770a5f493d4459452ab11c164187a282945
# Parent 53467192403901100814b6dd015a160969323035
phys_to_mach and mach_to_phys tables contain long entries, not
32-bit entries.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
diff -r 534671924039 -r d0a4f770a5f4
linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c Tue Sep 6 17:43:36 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c Tue Sep 6 18:01:24 2005
@@ -359,7 +359,7 @@
shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
EXPORT_SYMBOL(HYPERVISOR_shared_info);
-unsigned int *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
+unsigned long *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
EXPORT_SYMBOL(phys_to_machine_mapping);
/* Raw start-of-day parameters from the hypervisor. */
@@ -1206,7 +1206,7 @@
}
#endif
- phys_to_machine_mapping = (unsigned int *)xen_start_info->mfn_list;
+ phys_to_machine_mapping = (unsigned long *)xen_start_info->mfn_list;
}
/*
@@ -1638,15 +1638,15 @@
/* Make sure we have a correctly sized P->M table. */
if (max_pfn != xen_start_info->nr_pages) {
phys_to_machine_mapping = alloc_bootmem_low_pages(
- max_pfn * sizeof(unsigned int));
+ max_pfn * sizeof(unsigned long));
if (max_pfn > xen_start_info->nr_pages) {
/* set to INVALID_P2M_ENTRY */
memset(phys_to_machine_mapping, ~0,
- max_pfn * sizeof(unsigned int));
+ max_pfn * sizeof(unsigned long));
memcpy(phys_to_machine_mapping,
- (unsigned int *)xen_start_info->mfn_list,
- xen_start_info->nr_pages * sizeof(unsigned
int));
+ (unsigned long *)xen_start_info->mfn_list,
+ xen_start_info->nr_pages * sizeof(unsigned
long));
} else {
struct xen_memory_reservation reservation = {
.extent_start = (unsigned long
*)xen_start_info->mfn_list + max_pfn,
@@ -1656,9 +1656,8 @@
};
memcpy(phys_to_machine_mapping,
- (unsigned int *)xen_start_info->mfn_list,
- max_pfn * sizeof(unsigned int));
- /* N.B. below relies on sizeof(int) == sizeof(long). */
+ (unsigned long *)xen_start_info->mfn_list,
+ max_pfn * sizeof(unsigned long));
BUG_ON(HYPERVISOR_memory_op(
XENMEM_decrease_reservation,
&reservation) !=
@@ -1667,11 +1666,11 @@
free_bootmem(
__pa(xen_start_info->mfn_list),
PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
- sizeof(unsigned int))));
+ sizeof(unsigned long))));
}
pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE);
- for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned int)), j++ )
+ for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
{
pfn_to_mfn_frame_list[j] =
virt_to_mfn(&phys_to_machine_mapping[i]);
diff -r 534671924039 -r d0a4f770a5f4
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c Tue Sep 6 17:43:36 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c Tue Sep 6 18:01:24 2005
@@ -81,7 +81,7 @@
extern void time_suspend(void);
extern void time_resume(void);
extern unsigned long max_pfn;
- extern unsigned int *pfn_to_mfn_frame_list;
+ extern unsigned long *pfn_to_mfn_frame_list;
#ifdef CONFIG_SMP
extern void smp_suspend(void);
diff -r 534671924039 -r d0a4f770a5f4
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c Tue Sep 6
17:43:36 2005
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c Tue Sep 6
18:01:24 2005
@@ -90,7 +90,7 @@
{
int i;
- phys_to_machine_mapping = (u32 *)xen_start_info->mfn_list;
+ phys_to_machine_mapping = (unsigned long *)xen_start_info->mfn_list;
start_pfn = (__pa(xen_start_info->pt_base) >> PAGE_SHIFT) +
xen_start_info->nr_pt_frames;
diff -r 534671924039 -r d0a4f770a5f4
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c Tue Sep 6
17:43:36 2005
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c Tue Sep 6
18:01:24 2005
@@ -76,7 +76,7 @@
/* Allows setting of maximum possible memory size */
unsigned long xen_override_max_pfn;
-u32 *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
+unsigned long *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
EXPORT_SYMBOL(phys_to_machine_mapping);
@@ -734,22 +734,22 @@
/* Make sure we have a large enough P->M table. */
if (end_pfn > xen_start_info->nr_pages) {
phys_to_machine_mapping = alloc_bootmem(
- end_pfn * sizeof(u32));
+ end_pfn * sizeof(unsigned long));
memset(phys_to_machine_mapping, ~0,
- end_pfn * sizeof(u32));
+ end_pfn * sizeof(unsigned long));
memcpy(phys_to_machine_mapping,
- (u32 *)xen_start_info->mfn_list,
- xen_start_info->nr_pages * sizeof(u32));
+ (unsigned long *)xen_start_info->mfn_list,
+ xen_start_info->nr_pages * sizeof(unsigned
long));
free_bootmem(
__pa(xen_start_info->mfn_list),
PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
- sizeof(u32))));
+ sizeof(unsigned long))));
}
pfn_to_mfn_frame_list = alloc_bootmem(PAGE_SIZE);
- for ( i=0, j=0; i < end_pfn; i+=(PAGE_SIZE/sizeof(u32)), j++ )
- pfn_to_mfn_frame_list[j] =
+ for ( i=0, j=0; i < end_pfn; i+=(PAGE_SIZE/sizeof(unsigned
long)), j++ )
+ pfn_to_mfn_frame_list[j] =
virt_to_mfn(&phys_to_machine_mapping[i]);
}
#endif
diff -r 534671924039 -r d0a4f770a5f4
linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h Tue Sep 6
17:43:36 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h Tue Sep 6
18:01:24 2005
@@ -60,14 +60,14 @@
#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
/**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
-#define INVALID_P2M_ENTRY (~0U)
-#define FOREIGN_FRAME(m) ((m) | 0x80000000U)
-extern unsigned int *phys_to_machine_mapping;
+#define INVALID_P2M_ENTRY (~0UL)
+#define FOREIGN_FRAME(m) ((m) | (1UL<<31))
+extern unsigned long *phys_to_machine_mapping;
#define pfn_to_mfn(pfn) \
-((unsigned long)phys_to_machine_mapping[(unsigned int)(pfn)] & 0x7FFFFFFFUL)
+(phys_to_machine_mapping[(unsigned int)(pfn)] & ~(1UL<<31))
static inline unsigned long mfn_to_pfn(unsigned long mfn)
{
- unsigned int pfn;
+ unsigned long pfn;
/*
* The array access can fail (e.g., device space beyond end of RAM).
@@ -83,7 +83,7 @@
".previous"
: "=r" (pfn) : "m" (machine_to_phys_mapping[mfn]) );
- return (unsigned long)pfn;
+ return pfn;
}
/* Definitions for machine and pseudophysical addresses. */
diff -r 534671924039 -r d0a4f770a5f4
linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h Tue Sep 6
17:43:36 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h Tue Sep 6
18:01:24 2005
@@ -62,14 +62,14 @@
#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
/**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
-#define INVALID_P2M_ENTRY (~0U)
-#define FOREIGN_FRAME(m) ((m) | 0x80000000U)
-extern u32 *phys_to_machine_mapping;
+#define INVALID_P2M_ENTRY (~0UL)
+#define FOREIGN_FRAME(m) ((m) | (1UL<<63))
+extern unsigned long *phys_to_machine_mapping;
#define pfn_to_mfn(pfn) \
-((unsigned long)phys_to_machine_mapping[(unsigned int)(pfn)] & 0x7FFFFFFFUL)
+(phys_to_machine_mapping[(unsigned int)(pfn)] & ~(1UL << 63))
static inline unsigned long mfn_to_pfn(unsigned long mfn)
{
- unsigned int pfn;
+ unsigned long pfn;
/*
* The array access can fail (e.g., device space beyond end of RAM).
@@ -77,7 +77,7 @@
* but we must handle the fault without crashing!
*/
asm (
- "1: movl %1,%k0\n"
+ "1: movq %1,%0\n"
"2:\n"
".section __ex_table,\"a\"\n"
" .align 8\n"
@@ -85,7 +85,7 @@
".previous"
: "=r" (pfn) : "m" (machine_to_phys_mapping[mfn]) );
- return (unsigned long)pfn;
+ return pfn;
}
/* Definitions for machine and pseudophysical addresses. */
diff -r 534671924039 -r d0a4f770a5f4
linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h Tue Sep 6
17:43:36 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h Tue Sep 6
18:01:24 2005
@@ -307,7 +307,7 @@
#define pte_pfn(_pte) \
({ \
unsigned long mfn = pte_mfn(_pte); \
- unsigned pfn = mfn_to_pfn(mfn); \
+ unsigned long pfn = mfn_to_pfn(mfn); \
if ((pfn >= max_mapnr) || (phys_to_machine_mapping[pfn] != mfn))\
pfn = max_mapnr; /* special: force !pfn_valid() */ \
pfn; \
diff -r 534671924039 -r d0a4f770a5f4 tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c Tue Sep 6 17:43:36 2005
+++ b/tools/libxc/xc_linux_build.c Tue Sep 6 18:01:24 2005
@@ -348,7 +348,7 @@
unsigned long nr_pt_pages;
unsigned long physmap_pfn;
- u32 *physmap, *physmap_e;
+ unsigned long *physmap, *physmap_e;
struct load_funcs load_funcs;
struct domain_setup_info dsi;
diff -r 534671924039 -r d0a4f770a5f4 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c Tue Sep 6 17:43:36 2005
+++ b/xen/arch/x86/domain_build.c Tue Sep 6 18:01:24 2005
@@ -218,7 +218,7 @@
vinitrd_start = round_pgup(dsi.v_end);
vinitrd_end = vinitrd_start + initrd_len;
vphysmap_start = round_pgup(vinitrd_end);
- vphysmap_end = vphysmap_start + (nr_pages * sizeof(u32));
+ vphysmap_end = vphysmap_start + (nr_pages * sizeof(unsigned long));
vstartinfo_start = round_pgup(vphysmap_end);
vstartinfo_end = vstartinfo_start + PAGE_SIZE;
vpt_start = vstartinfo_end;
@@ -613,7 +613,7 @@
if ( !opt_dom0_translate && (pfn > REVERSE_START) )
mfn = alloc_epfn - (pfn - REVERSE_START);
#endif
- ((u32 *)vphysmap_start)[pfn] = mfn;
+ ((unsigned long *)vphysmap_start)[pfn] = mfn;
set_pfn_from_mfn(mfn, pfn);
}
while ( pfn < nr_pages )
@@ -626,7 +626,7 @@
#ifndef NDEBUG
#define pfn (nr_pages - 1 - (pfn - (alloc_epfn - alloc_spfn)))
#endif
- ((u32 *)vphysmap_start)[pfn] = mfn;
+ ((unsigned long *)vphysmap_start)[pfn] = mfn;
set_pfn_from_mfn(mfn, pfn);
#undef pfn
page++; pfn++;
diff -r 534671924039 -r d0a4f770a5f4 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Tue Sep 6 17:43:36 2005
+++ b/xen/arch/x86/mm.c Tue Sep 6 18:01:24 2005
@@ -1450,7 +1450,7 @@
((type & PGT_type_mask) != PGT_l1_page_table) )
MEM_LOG("Bad type (saw %" PRtype_info
"!= exp %" PRtype_info ") "
- "for mfn %lx (pfn %x)",
+ "for mfn %lx (pfn %lx)",
x, type, page_to_pfn(page),
get_pfn_from_mfn(page_to_pfn(page)));
return 0;
diff -r 534671924039 -r d0a4f770a5f4 xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c Tue Sep 6 17:43:36 2005
+++ b/xen/arch/x86/x86_32/mm.c Tue Sep 6 18:01:24 2005
@@ -95,7 +95,7 @@
* Allocate and map the machine-to-phys table and create read-only mapping
* of MPT for guest-OS use.
*/
- mpt_size = (max_page * 4) + (1UL << L2_PAGETABLE_SHIFT) - 1UL;
+ mpt_size = (max_page * BYTES_PER_LONG) + (1UL << L2_PAGETABLE_SHIFT) - 1;
mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
{
diff -r 534671924039 -r d0a4f770a5f4 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c Tue Sep 6 17:43:36 2005
+++ b/xen/arch/x86/x86_64/mm.c Tue Sep 6 18:01:24 2005
@@ -98,7 +98,7 @@
* Allocate and map the machine-to-phys table.
* This also ensures L3 is present for fixmaps.
*/
- mpt_size = (max_page * 4) + (1UL << L2_PAGETABLE_SHIFT) - 1UL;
+ mpt_size = (max_page * BYTES_PER_LONG) + (1UL << L2_PAGETABLE_SHIFT) - 1;
mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
{
diff -r 534671924039 -r d0a4f770a5f4 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h Tue Sep 6 17:43:36 2005
+++ b/xen/include/asm-x86/mm.h Tue Sep 6 18:01:24 2005
@@ -255,9 +255,9 @@
* contiguous (or near contiguous) physical memory.
*/
#undef machine_to_phys_mapping
-#define machine_to_phys_mapping ((u32 *)RDWR_MPT_VIRT_START)
-#define INVALID_M2P_ENTRY (~0U)
-#define VALID_M2P(_e) (!((_e) & (1U<<31)))
+#define machine_to_phys_mapping ((unsigned long *)RDWR_MPT_VIRT_START)
+#define INVALID_M2P_ENTRY (~0UL)
+#define VALID_M2P(_e) (!((_e) & (1UL<<(BITS_PER_LONG-1))))
#define IS_INVALID_M2P_ENTRY(_e) (!VALID_M2P(_e))
#define set_pfn_from_mfn(mfn, pfn) (machine_to_phys_mapping[(mfn)] = (pfn))
diff -r 534671924039 -r d0a4f770a5f4 xen/include/public/arch-x86_32.h
--- a/xen/include/public/arch-x86_32.h Tue Sep 6 17:43:36 2005
+++ b/xen/include/public/arch-x86_32.h Tue Sep 6 18:01:24 2005
@@ -55,7 +55,7 @@
# define HYPERVISOR_VIRT_START (0xFC000000UL)
#endif
#ifndef machine_to_phys_mapping
-#define machine_to_phys_mapping ((u32 *)HYPERVISOR_VIRT_START)
+#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
#endif
/* Maximum number of virtual CPUs in multi-processor guests. */
diff -r 534671924039 -r d0a4f770a5f4 xen/include/public/arch-x86_64.h
--- a/xen/include/public/arch-x86_64.h Tue Sep 6 17:43:36 2005
+++ b/xen/include/public/arch-x86_64.h Tue Sep 6 18:01:24 2005
@@ -71,7 +71,7 @@
/* The machine->physical mapping table starts at this address, read-only. */
#ifndef machine_to_phys_mapping
-#define machine_to_phys_mapping ((u32 *)HYPERVISOR_VIRT_START)
+#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
#endif
/*
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|