From 52bba67f8b8790ae8c9881f742a54b69336de1c1 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Tue, 28 Feb 2017 14:07:09 +0000 Subject: [PATCH] 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 --- xen/common/efi/boot.c | 2 ++ 1 file changed, 2 insertions(+) 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 } /* -- 2.39.5