Skip to content

Commit 5f6a161

Browse files
bostrovsjgross1
authored andcommitted
xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams()
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>
1 parent 6483e31 commit 5f6a161

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

‎arch/x86/xen/enlighten_pvh.c‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ static void xen_pvh_arch_setup(void)
3434
static void __init init_pvh_bootparams(void)
3535
{
3636
struct xen_memory_map memmap;
37-
unsigned int i;
3837
int rc;
3938

4039
memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
@@ -46,26 +45,19 @@ static void __init init_pvh_bootparams(void)
4645
xen_raw_printk("XENMEM_memory_map failed (%d)\n", rc);
4746
BUG();
4847
}
48+
pvh_bootparams.e820_entries = memmap.nr_entries;
4949

50-
if (memmap.nr_entries < E820_MAX_ENTRIES_ZEROPAGE - 1) {
51-
pvh_bootparams.e820_table[memmap.nr_entries].addr =
50+
if (pvh_bootparams.e820_entries < E820_MAX_ENTRIES_ZEROPAGE - 1) {
51+
pvh_bootparams.e820_table[pvh_bootparams.e820_entries].addr =
5252
ISA_START_ADDRESS;
53-
pvh_bootparams.e820_table[memmap.nr_entries].size =
53+
pvh_bootparams.e820_table[pvh_bootparams.e820_entries].size =
5454
ISA_END_ADDRESS - ISA_START_ADDRESS;
55-
pvh_bootparams.e820_table[memmap.nr_entries].type =
55+
pvh_bootparams.e820_table[pvh_bootparams.e820_entries].type =
5656
E820_TYPE_RESERVED;
57-
memmap.nr_entries++;
57+
pvh_bootparams.e820_entries++;
5858
} else
5959
xen_raw_printk("Warning: Can fit ISA range into e820\n");
6060

61-
pvh_bootparams.e820_entries = memmap.nr_entries;
62-
for (i = 0; i < pvh_bootparams.e820_entries; i++)
63-
e820__range_add(pvh_bootparams.e820_table[i].addr,
64-
pvh_bootparams.e820_table[i].size,
65-
pvh_bootparams.e820_table[i].type);
66-
67-
e820__update_table(e820_table);
68-
6961
pvh_bootparams.hdr.cmd_line_ptr =
7062
pvh_start_info.cmdline_paddr;
7163

0 commit comments

Comments
 (0)