[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH V4 03/10] xen/arm: handle static memory in dt_unreserved_regions


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Mon, 16 Aug 2021 06:00:58 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CXfxLL4+fn4ZMdjKRhjbeDDPs9CeA+0ru8EKsiuVlUE=; b=KObs18iUEWOTQJU6807P01hWSNY8zL+pNsiQ8hiJQp5MqwCPbUzF0T8grgxchYXdXyzxicg4CGCBqZVxwmRd8eT+tag6ApDGtue8NtYWKOzaZvwXOE/wzog1EQX6QLoKFY0FQDVhhRKGuy2p6TPh+/dWTESNi8aiAUjDpYPfd6Iil/hm2QZu9mAkLetLT7tGqc3wutFFYinpTvhbBWpEHpjU+tidusvERCMM+4dxuH8Coa4+h0fxhtq2O3zgXY7O81eNOXXLZGGkUf8BO8OhzQ9gQ9jGHTs2u6harnqDeLybELbsZ7O4024aWuJtVCQcrx94I6BTJugR2cLJ18Hobg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FdIAEWMbhrOj0Vc0RRo6TJbVG5MaHavw502kdYTpnrQbNuuYhmDvrQQjVQZKMmcvPQ+tXXWIQB74/AmSavlSJ0nIBrQ5GAN44xsmsd6YDAavA40nkZZGxOp6b3eNLIkIxulDdvd/NAqrKIIwvhSPBT0RiRKeyVXHXkACYAQU5iudpw5405nedMK/meja2pkoNTIHtxcU3URhAFjsUK5T7tNIEKbmwz2EtkbBF9xj9rLyjjIiYqvxf5gAM6l3UOv12bPTnuFms6uTjOKuJizcGwG42Rgd2QtcQOFXtmlI+tV9wuzoNSo2M7absn8CxN+LlzJhYMcIrbsZobiEXnN7jg==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, nd <nd@xxxxxxx>
  • Delivery-date: Mon, 16 Aug 2021 06:01:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXg5tYZY2FWDgBY02KHlfAdkOUMKtuZ8uAgAdTnkA=
  • Thread-topic: [PATCH V4 03/10] xen/arm: handle static memory in dt_unreserved_regions

Hi Julien 

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: Wednesday, August 11, 2021 9:48 PM
> To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> sstabellini@xxxxxxxxxx
> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>; Wei Chen
> <Wei.Chen@xxxxxxx>; nd <nd@xxxxxxx>
> Subject: Re: [PATCH V4 03/10] xen/arm: handle static memory in
> dt_unreserved_regions
> 
> Hi Penny,
> 
> On 28/07/2021 11:27, Penny Zheng wrote:
> > static memory regions overlap with memory nodes. The overlapping
> > memory is reserved-memory and should be handled accordingly:
> > dt_unreserved_regions should skip these regions the same way they are
> > already skipping mem-reserved regions.
> >
> > Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
> > ---
> >   xen/arch/arm/setup.c | 47 ++++++++++++++++++++++++++++----------------
> >   1 file changed, 30 insertions(+), 17 deletions(-)
> >
> > diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index
> > 63a908e325..f569134317 100644
> > --- a/xen/arch/arm/setup.c
> > +++ b/xen/arch/arm/setup.c
> > @@ -200,6 +200,13 @@ static void __init dt_unreserved_regions(paddr_t s,
> paddr_t e,
> >                                            int first)
> >   {
> >       int i, nr = fdt_num_mem_rsv(device_tree_flattened);
> > +    /*
> > +     * There are two types of reserved memory stored in bootinfo, one
> defines
> > +     * in /reserved-memory node, the other refers to domain on static
> allocation
> > +     * through "xen,static-mem" property.
> > +     */
> > +    int nr_rsv_type = 2, t = 0, prev_nr;
> > +    struct meminfo *rsv_type[2] = {&bootinfo.reserved_mem,
> > + &bootinfo.static_mem};
> 
> Looking at the rest of the series, it doesn't look like there is a real 
> benefits to
> have the static memory and reserved memory in separate arrays as they are
> walked only a few times and they are both meant to be small. In fact, I think
> this code is lot more difficult to read.
> 
> So it would be best to merge the two arrays in one. We can add a flag in the
> structure to differentiate between "static" and "reserved" memory.
> 

How about adding a "static" flag in "struct meminfo" to tell. See the below 
example:
"
struct meminfo {
    int nr_banks;
    struct membank bank[NR_MEM_BANKS];
    bool static;  /* whether memory is reserved as static memory. */
};
"

And I will delete "struct meminfo static_mem" array, all "static" and 
"reserved" memory
will be stored in one "struct meminfo reserved_mem" array.

> Cheers,
> 
> --

Cheers,

--
> Julien Grall

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.