]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams()
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Fri, 21 Apr 2017 15:13:14 +0000 (11:13 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 13 Sep 2017 04:37:58 +0000 (21:37 -0700)
e820 map is updated with information from the zeropage (i.e. pvh_bootparams)
by default_machine_specific_memory_setup(). With the way things are done
now,  we end up with a duplicated e820 map.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
OraBug: 26662731

(cherry picked from commit 5f6a1614fab801834e32b420b60acdc27acfcdec)
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Conflicts:
arch/x86/xen/enlighten_pvh.c
(No enlighten_pvh.c in our tree)

arch/x86/xen/enlighten.c

index 4600fe273367e4ca21327047b6f4d558e79b5eaa..0fbeb1c650280fc681a94de64941884eca4eca89 100644 (file)
@@ -1702,7 +1702,6 @@ static void xen_pvh_arch_setup(void)
 static void __init init_pvh_bootparams(void)
 {
        struct xen_memory_map memmap;
-       unsigned int i;
        int rc;
 
        memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
@@ -1715,27 +1714,19 @@ static void __init init_pvh_bootparams(void)
                BUG();
        }
 
-       if (memmap.nr_entries < E820MAX - 1) {
-               pvh_bootparams.e820_map[memmap.nr_entries].addr =
+       pvh_bootparams.e820_entries = memmap.nr_entries;
+
+       if (pvh_bootparams.e820_entries < E820MAX - 1) {
+               pvh_bootparams.e820_map[pvh_bootparams.e820_entries].addr =
                        ISA_START_ADDRESS;
-               pvh_bootparams.e820_map[memmap.nr_entries].size =
+               pvh_bootparams.e820_map[pvh_bootparams.e820_entries].size =
                        ISA_END_ADDRESS - ISA_START_ADDRESS;
-               pvh_bootparams.e820_map[memmap.nr_entries].type =
+               pvh_bootparams.e820_map[pvh_bootparams.e820_entries].type =
                        E820_RESERVED;
-               memmap.nr_entries++;
+               pvh_bootparams.e820_entries++;
        } else
                xen_raw_printk("Warning: Can fit ISA range into e820\n");
 
-       sanitize_e820_map(pvh_bootparams.e820_map,
-                         ARRAY_SIZE(pvh_bootparams.e820_map),
-                         &memmap.nr_entries);
-
-       pvh_bootparams.e820_entries = memmap.nr_entries;
-       for (i = 0; i < pvh_bootparams.e820_entries; i++)
-               e820_add_region(pvh_bootparams.e820_map[i].addr,
-                               pvh_bootparams.e820_map[i].size,
-                               pvh_bootparams.e820_map[i].type);
-
        pvh_bootparams.hdr.cmd_line_ptr =
                pvh_start_info.cmdline_paddr;