All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams()
@ 2017-04-21 15:13 ` Boris Ostrovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2017-04-21 15:13 UTC (permalink / raw)
  To: jgross; +Cc: xen-devel, linux-kernel, Boris Ostrovsky

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>
---
v2:
* Drop sanitize_e820_map() since it will be called later
  anyway, possibly more than once.
* Also use pvh_bootparams.e820_entries instead of memmap.nr_entries
  when adding ISA range.

 arch/x86/xen/enlighten_pvh.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c
index 331d769..2bc7d5b 100644
--- a/arch/x86/xen/enlighten_pvh.c
+++ b/arch/x86/xen/enlighten_pvh.c
@@ -33,7 +33,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));
@@ -45,28 +44,19 @@ static void __init init_pvh_bootparams(void)
 		xen_raw_printk("XENMEM_memory_map failed (%d)\n", rc);
 		BUG();
 	}
+	pvh_bootparams.e820_entries = memmap.nr_entries;
 
-	if (memmap.nr_entries < E820MAX - 1) {
-		pvh_bootparams.e820_map[memmap.nr_entries].addr =
+	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;
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2] xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams()
@ 2017-04-21 15:13 ` Boris Ostrovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2017-04-21 15:13 UTC (permalink / raw)
  To: jgross; +Cc: xen-devel, Boris Ostrovsky, linux-kernel

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>
---
v2:
* Drop sanitize_e820_map() since it will be called later
  anyway, possibly more than once.
* Also use pvh_bootparams.e820_entries instead of memmap.nr_entries
  when adding ISA range.

 arch/x86/xen/enlighten_pvh.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c
index 331d769..2bc7d5b 100644
--- a/arch/x86/xen/enlighten_pvh.c
+++ b/arch/x86/xen/enlighten_pvh.c
@@ -33,7 +33,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));
@@ -45,28 +44,19 @@ static void __init init_pvh_bootparams(void)
 		xen_raw_printk("XENMEM_memory_map failed (%d)\n", rc);
 		BUG();
 	}
+	pvh_bootparams.e820_entries = memmap.nr_entries;
 
-	if (memmap.nr_entries < E820MAX - 1) {
-		pvh_bootparams.e820_map[memmap.nr_entries].addr =
+	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;
 
-- 
2.9.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams()
  2017-04-21 15:13 ` Boris Ostrovsky
  (?)
  (?)
@ 2017-04-24 16:03 ` Juergen Gross
  -1 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2017-04-24 16:03 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: xen-devel, linux-kernel

On 21/04/17 17:13, Boris Ostrovsky wrote:
> 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>


Juergen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams()
  2017-04-21 15:13 ` Boris Ostrovsky
  (?)
@ 2017-04-24 16:03 ` Juergen Gross
  -1 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2017-04-24 16:03 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: xen-devel, linux-kernel

On 21/04/17 17:13, Boris Ostrovsky wrote:
> 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>


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams()
  2017-04-21 15:13 ` Boris Ostrovsky
                   ` (3 preceding siblings ...)
  (?)
@ 2017-04-25  6:59 ` Juergen Gross
  -1 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2017-04-25  6:59 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: xen-devel, linux-kernel

On 21/04/17 17:13, Boris Ostrovsky wrote:
> 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>

Pushed to xen/tip for-linus-4.12


Thanks,

Juergen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams()
  2017-04-21 15:13 ` Boris Ostrovsky
                   ` (2 preceding siblings ...)
  (?)
@ 2017-04-25  6:59 ` Juergen Gross
  -1 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2017-04-25  6:59 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: xen-devel, linux-kernel

On 21/04/17 17:13, Boris Ostrovsky wrote:
> 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>

Pushed to xen/tip for-linus-4.12


Thanks,

Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-25  6:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-21 15:13 [PATCH v2] xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams() Boris Ostrovsky
2017-04-21 15:13 ` Boris Ostrovsky
2017-04-24 16:03 ` Juergen Gross
2017-04-24 16:03 ` Juergen Gross
2017-04-25  6:59 ` Juergen Gross
2017-04-25  6:59 ` Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.