From 28baa78877ebda840603774d6a1e3e9da9546a6e Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 16 Apr 2008 10:05:57 +0100 Subject: stubdom: sparse application's BSS by linking it separately first, put markers at its beginning and end, and then link with mini-os. That permits to stick a bit more to upstream qemu. Signed-off-by: Samuel Thibault --- extras/mini-os/arch/ia64/minios-ia64.lds | 5 ++++- extras/mini-os/arch/x86/minios-x86_32.lds | 1 + extras/mini-os/arch/x86/minios-x86_64.lds | 1 + extras/mini-os/arch/x86/mm.c | 7 +------ 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'extras/mini-os/arch') diff --git a/extras/mini-os/arch/ia64/minios-ia64.lds b/extras/mini-os/arch/ia64/minios-ia64.lds index 96911aa3fd..0b38a34e8e 100644 --- a/extras/mini-os/arch/ia64/minios-ia64.lds +++ b/extras/mini-os/arch/ia64/minios-ia64.lds @@ -59,7 +59,10 @@ SECTIONS { *(.IA_64.unwind) } .bss : AT(ADDR(.bss) - (((5<<(61))+0x100000000) - (1 << 20))) - { *(.bss) } + { + *(.bss) + *(.app.bss) + } _end = .; diff --git a/extras/mini-os/arch/x86/minios-x86_32.lds b/extras/mini-os/arch/x86/minios-x86_32.lds index df5301944f..9bd0b77691 100644 --- a/extras/mini-os/arch/x86/minios-x86_32.lds +++ b/extras/mini-os/arch/x86/minios-x86_32.lds @@ -38,6 +38,7 @@ SECTIONS __bss_start = .; /* BSS */ .bss : { *(.bss) + *(.app.bss) } _end = . ; diff --git a/extras/mini-os/arch/x86/minios-x86_64.lds b/extras/mini-os/arch/x86/minios-x86_64.lds index f93800236b..361b264c5e 100644 --- a/extras/mini-os/arch/x86/minios-x86_64.lds +++ b/extras/mini-os/arch/x86/minios-x86_64.lds @@ -38,6 +38,7 @@ SECTIONS __bss_start = .; /* BSS */ .bss : { *(.bss) + *(.app.bss) } _end = . ; diff --git a/extras/mini-os/arch/x86/mm.c b/extras/mini-os/arch/x86/mm.c index dd556e4741..8bc90eddea 100644 --- a/extras/mini-os/arch/x86/mm.c +++ b/extras/mini-os/arch/x86/mm.c @@ -556,7 +556,6 @@ void *map_frames_ex(unsigned long *f, unsigned long n, unsigned long stride, static void clear_bootstrap(void) { - struct xen_memory_reservation reservation; xen_pfn_t mfns[] = { virt_to_mfn(&shared_info) }; int n = sizeof(mfns)/sizeof(*mfns); pte_t nullpte = { }; @@ -567,11 +566,7 @@ static void clear_bootstrap(void) if (HYPERVISOR_update_va_mapping((unsigned long) &_text, nullpte, UVMF_INVLPG)) printk("Unable to unmap first page\n"); - set_xen_guest_handle(reservation.extent_start, mfns); - reservation.nr_extents = n; - reservation.extent_order = 0; - reservation.domid = DOMID_SELF; - if (HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation) != n) + if (free_physical_pages(mfns, n) != n) printk("Unable to free bootstrap pages\n"); } -- cgit v1.2.3