Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:PowerPC
xen
23506-x86_Disable_set_gpfn_from_mfn_until_m2p_t...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 23506-x86_Disable_set_gpfn_from_mfn_until_m2p_table_is_allocated..patch of Package xen
changeset: 23506:d1309a79bde8 user: Keir Fraser <keir@xen.org> date: Fri Jun 10 08:18:33 2011 +0100 files: xen/arch/x86/x86_64/mm.c xen/include/asm-x86/mm.h description: x86: Disable set_gpfn_from_mfn until m2p table is allocated. This is a prerequisite for calling set_gpfn_from_mfn() unconditionally from free_heap_pages(). Signed-off-by: Keir Fraser <keir@xen.org> --- xen/arch/x86/x86_64/mm.c | 4 ++++ xen/include/asm-x86/mm.h | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) Index: xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c =================================================================== --- xen-4.1.2-testing.orig/xen/arch/x86/x86_64/mm.c +++ xen-4.1.2-testing/xen/arch/x86/x86_64/mm.c @@ -47,6 +47,8 @@ unsigned int __read_mostly pfn_pdx_hole_ unsigned int __read_mostly m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START; +bool_t __read_mostly machine_to_phys_mapping_valid = 0; + /* Top-level master (and idle-domain) page directory. */ l4_pgentry_t __attribute__ ((__section__ (".bss.page_aligned"))) idle_pg_table[L4_PAGETABLE_ENTRIES]; @@ -800,6 +802,8 @@ void __init paging_init(void) #undef CNT #undef MFN + machine_to_phys_mapping_valid = 1; + /* Set up linear page table mapping. */ l4e_write(&idle_pg_table[l4_table_offset(LINEAR_PT_VIRT_START)], l4e_from_paddr(__pa(idle_pg_table), __PAGE_HYPERVISOR)); Index: xen-4.1.2-testing/xen/include/asm-x86/mm.h =================================================================== --- xen-4.1.2-testing.orig/xen/include/asm-x86/mm.h +++ xen-4.1.2-testing/xen/include/asm-x86/mm.h @@ -469,7 +469,7 @@ TYPE_SAFE(unsigned long,mfn); #ifdef CONFIG_COMPAT #define compat_machine_to_phys_mapping ((unsigned int *)RDWR_COMPAT_MPT_VIRT_START) -#define set_gpfn_from_mfn(mfn, pfn) ({ \ +#define _set_gpfn_from_mfn(mfn, pfn) ({ \ struct domain *d = page_get_owner(__mfn_to_page(mfn)); \ unsigned long entry = (d && (d == dom_cow)) ? \ SHARED_M2P_ENTRY : (pfn); \ @@ -478,7 +478,7 @@ TYPE_SAFE(unsigned long,mfn); machine_to_phys_mapping[(mfn)] = (entry)); \ }) #else -#define set_gpfn_from_mfn(mfn, pfn) ({ \ +#define _set_gpfn_from_mfn(mfn, pfn) ({ \ struct domain *d = page_get_owner(__mfn_to_page(mfn)); \ if(d && (d == dom_cow)) \ machine_to_phys_mapping[(mfn)] = SHARED_M2P_ENTRY; \ @@ -486,6 +486,17 @@ TYPE_SAFE(unsigned long,mfn); machine_to_phys_mapping[(mfn)] = (pfn); \ }) #endif + +/* + * Disable some users of set_gpfn_from_mfn() (e.g., free_heap_pages()) until + * the machine_to_phys_mapping is actually set up. + */ +extern bool_t machine_to_phys_mapping_valid; +#define set_gpfn_from_mfn(mfn, pfn) do { \ + if ( machine_to_phys_mapping_valid ) \ + _set_gpfn_from_mfn(mfn, pfn); \ +} while (0) + #define get_gpfn_from_mfn(mfn) (machine_to_phys_mapping[(mfn)]) #define mfn_to_gmfn(_d, mfn) \
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor