]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/e820: fix 640k - 1M region reservation logic
authorSergey Dyasli <sergey.dyasli@citrix.com>
Wed, 30 Oct 2019 14:54:47 +0000 (14:54 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 21 Nov 2019 15:49:58 +0000 (15:49 +0000)
Converting a guest from PV to PV-in-PVH makes the guest to have 384k
less memory, which may confuse guest's balloon driver. This happens
because Xen unconditionally reserves 640k - 1M region in E820 despite
the fact that it's really a usable RAM in PVH boot mode.

Fix this by skipping region type change in virtualised environments,
trusting whatever memory map our hypervisor has provided.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/e820.c

index 8e8a2c4e1bfc4d6139e4c2ab0f8f4439c856d093..082f9928a145fbc6bff0f5f90fe5dc335d0bead4 100644 (file)
@@ -318,9 +318,9 @@ static int __init copy_e820_map(struct e820entry * biosmap, unsigned int nr_map)
 
         /*
          * Some BIOSes claim RAM in the 640k - 1M region.
-         * Not right. Fix it up.
+         * Not right. Fix it up, but only when running on bare metal.
          */
-        if (type == E820_RAM) {
+        if (!cpu_has_hypervisor && type == E820_RAM) {
             if (start < 0x100000ULL && end > 0xA0000ULL) {
                 if (start < 0xA0000ULL)
                     add_memory_region(start, 0xA0000ULL-start, type);