From: Andrew Cooper Date: Tue, 28 Feb 2017 14:07:09 +0000 (+0000) Subject: efi/boot: Don't free ebmalloc area at all X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2619 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=52bba67f8b87;p=xen.git efi/boot: Don't free ebmalloc area at all Freeing part of the BSS back for general use proves to be problematic. It is not accounted for in xen_in_range(), causing errors when constructing the IOMMU tables, resulting in a failure to boot. Other smaller issues are that tboot treats the entire BSS as hypervisor data, creating and checking a MAC of it on S3, and that, by being 1MB in size, freeing it guarentees to shatter the hypervisor superpage mappings. This is a stopgap fix to unblock master, while alternatives are discussed. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index b6cbdadbbd..be11d05b09 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -146,6 +146,7 @@ static void __init __maybe_unused *ebmalloc(size_t size) static void __init __maybe_unused free_ebmalloc_unused_mem(void) { +#if 0 /* FIXME: Putting a hole in the BSS breaks the IOMMU mappings for dom0. */ unsigned long start, end; start = (unsigned long)ebmalloc_mem + PAGE_ALIGN(ebmalloc_allocated); @@ -155,6 +156,7 @@ static void __init __maybe_unused free_ebmalloc_unused_mem(void) init_xenheap_pages(__pa(start), __pa(end)); printk(XENLOG_INFO "Freed %lukB unused BSS memory\n", (end - start) >> 10); +#endif } /*