All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Xen-devel] [PATCH] xen/page_alloc: statically allocate bootmem_region_list
@ 2019-12-17 16:37 Jan Beulich
  2019-12-17 16:47 ` Julien Grall
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2019-12-17 16:37 UTC (permalink / raw)
  To: Xia, Hongyan
  Cc: Stefano Stabellini, Julien Grall, Wei Liu, Konrad Wilk,
	George Dunlap, Andrew Cooper, xen-devel, Ian Jackson

I'm sorry for the non-threaded reply, but my mail client has
mixed up this mail with another one, so I have nothing to
properly reply to. With one stylistic issue taken care of
(blanks around the binary operator / )
Reviewed-by: Jan Beulich <jbeulich@suse.com>
The change would be easy enough to do while committing, but
said mailbox issue would either require someone else to
apply the change, or you to send a v2 (which then hopefully
won't end up garbled).

Iirc this was suggested before, so it would be nice if the
patch could also gain a suitable Suggested-by.

Jan

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

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

* Re: [Xen-devel] [PATCH] xen/page_alloc: statically allocate bootmem_region_list
  2019-12-17 16:37 [Xen-devel] [PATCH] xen/page_alloc: statically allocate bootmem_region_list Jan Beulich
@ 2019-12-17 16:47 ` Julien Grall
  0 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2019-12-17 16:47 UTC (permalink / raw)
  To: Jan Beulich, Xia, Hongyan
  Cc: Stefano Stabellini, Wei Liu, Konrad Wilk, George Dunlap,
	Andrew Cooper, xen-devel, Ian Jackson

Hi,

On 17/12/2019 16:37, Jan Beulich wrote:
> I'm sorry for the non-threaded reply, but my mail client has
> mixed up this mail with another one, so I have nothing to
> properly reply to. With one stylistic issue taken care of
> (blanks around the binary operator / )
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> The change would be easy enough to do while committing, but
> said mailbox issue would either require someone else to
> apply the change, or you to send a v2 (which then hopefully
> won't end up garbled).

I am in the middle of committing other patches on Arm, so I can commit it.

> 
> Iirc this was suggested before, so it would be nice if the
> patch could also gain a suitable Suggested-by.

I suggested it on [1] but this was based on a previous discussion about 
an Arm bug (see [2]). So I am not sure who to put in the Suggested-by 
tag here.

I will commit without it.

Cheers,

[1] <3d7f6e45-4c62-b314-7110-2e998bcdddcc@arm.com>
[2] <5f71588b-274a-bdb7-d324-5ff9177a0490@arm.com>

> 
> Jan
> 

-- 
Julien Grall

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

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

* Re: [Xen-devel] [PATCH] xen/page_alloc: statically allocate bootmem_region_list
  2019-12-17 14:33 Hongyan Xia
@ 2019-12-17 16:23 ` Julien Grall
  0 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2019-12-17 16:23 UTC (permalink / raw)
  To: Hongyan Xia, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Jan Beulich

Hi Hongyan,

On 17/12/2019 14:33, Hongyan Xia wrote:
> The existing code assumes that the first mfn passed to the boot
> allocator is mapped, which creates problems when, e.g., we do not have
> a direct map, and may create other bootstrapping problems in the
> future. Make it static. The size is kept the same as before (1 page).
> 
> Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
> ---
>   xen/common/page_alloc.c | 11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
> index 7cb1bd368b..7afb651b79 100644
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -244,9 +244,12 @@ PAGE_LIST_HEAD(page_broken_list);
>    */
>   mfn_t first_valid_mfn = INVALID_MFN_INITIALIZER;
>   
> -static struct bootmem_region {
> +struct bootmem_region {
>       unsigned long s, e; /* MFNs @s through @e-1 inclusive are free */
> -} *__initdata bootmem_region_list;
> +};
> +/* Statically allocate a page for bootmem_region_list. */
> +static struct bootmem_region __initdata
> +    bootmem_region_list[PAGE_SIZE/sizeof(struct bootmem_region)];

NIT: space before and after /.

Other than that:

Reviewed-by: Julien Grall <julien@xen.org>

Cheers,

-- 
Julien Grall

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

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

* [Xen-devel] [PATCH] xen/page_alloc: statically allocate bootmem_region_list
@ 2019-12-17 14:33 Hongyan Xia
  2019-12-17 16:23 ` Julien Grall
  0 siblings, 1 reply; 4+ messages in thread
From: Hongyan Xia @ 2019-12-17 14:33 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Julien Grall, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Jan Beulich

The existing code assumes that the first mfn passed to the boot
allocator is mapped, which creates problems when, e.g., we do not have
a direct map, and may create other bootstrapping problems in the
future. Make it static. The size is kept the same as before (1 page).

Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
---
 xen/common/page_alloc.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 7cb1bd368b..7afb651b79 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -244,9 +244,12 @@ PAGE_LIST_HEAD(page_broken_list);
  */
 mfn_t first_valid_mfn = INVALID_MFN_INITIALIZER;
 
-static struct bootmem_region {
+struct bootmem_region {
     unsigned long s, e; /* MFNs @s through @e-1 inclusive are free */
-} *__initdata bootmem_region_list;
+};
+/* Statically allocate a page for bootmem_region_list. */
+static struct bootmem_region __initdata
+    bootmem_region_list[PAGE_SIZE/sizeof(struct bootmem_region)];
 static unsigned int __initdata nr_bootmem_regions;
 
 struct scrub_region {
@@ -263,9 +266,6 @@ static void __init bootmem_region_add(unsigned long s, unsigned long e)
 {
     unsigned int i;
 
-    if ( (bootmem_region_list == NULL) && (s < e) )
-        bootmem_region_list = mfn_to_virt(s++);
-
     if ( s >= e )
         return;
 
@@ -1869,7 +1869,6 @@ void __init end_boot_allocator(void)
             init_heap_pages(mfn_to_page(_mfn(r->s)), r->e - r->s);
     }
     nr_bootmem_regions = 0;
-    init_heap_pages(virt_to_page(bootmem_region_list), 1);
 
     if ( !dma_bitsize && (num_online_nodes() > 1) )
         dma_bitsize = arch_get_dma_bitsize();
-- 
2.17.1


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

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

end of thread, other threads:[~2019-12-17 16:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 16:37 [Xen-devel] [PATCH] xen/page_alloc: statically allocate bootmem_region_list Jan Beulich
2019-12-17 16:47 ` Julien Grall
  -- strict thread matches above, loose matches on Subject: below --
2019-12-17 14:33 Hongyan Xia
2019-12-17 16:23 ` Julien Grall

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.