All of lore.kernel.org
 help / color / mirror / Atom feed
From: Penny Zheng <Penny.Zheng@arm.com>
To: Julien Grall <julien@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"sstabellini@kernel.org" <sstabellini@kernel.org>
Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Wei Chen <Wei.Chen@arm.com>, nd <nd@arm.com>
Subject: RE: [PATCH 03/10] xen/arm: introduce PGC_reserved
Date: Thu, 20 May 2021 08:40:07 +0000	[thread overview]
Message-ID: <VE1PR08MB5215E19BFE3E7F329229D8E7F72A9@VE1PR08MB5215.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <VE1PR08MB52155DD56E548E98AE937CE8F72A9@VE1PR08MB5215.eurprd08.prod.outlook.com>

Hi julien 

> -----Original Message-----
> From: Penny Zheng
> Sent: Thursday, May 20, 2021 2:20 PM
> To: Julien Grall <julien@xen.org>; xen-devel@lists.xenproject.org;
> sstabellini@kernel.org
> Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>; Wei Chen
> <Wei.Chen@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH 03/10] xen/arm: introduce PGC_reserved
> 
> Hi Julien
> 
> > -----Original Message-----
> > From: Julien Grall <julien@xen.org>
> > Sent: Thursday, May 20, 2021 3:46 AM
> > To: Penny Zheng <Penny.Zheng@arm.com>; xen-devel@lists.xenproject.org;
> > sstabellini@kernel.org
> > Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>; Wei Chen
> > <Wei.Chen@arm.com>; nd <nd@arm.com>
> > Subject: Re: [PATCH 03/10] xen/arm: introduce PGC_reserved
> >
> >
> >
> > On 19/05/2021 04:16, Penny Zheng wrote:
> > > Hi Julien
> >
> > Hi Penny,
> >
> > >
> > >> -----Original Message-----
> > >> From: Julien Grall <julien@xen.org>
> > >> Sent: Tuesday, May 18, 2021 5:46 PM
> > >> To: Penny Zheng <Penny.Zheng@arm.com>;
> > >> xen-devel@lists.xenproject.org; sstabellini@kernel.org
> > >> Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>; Wei Chen
> > >> <Wei.Chen@arm.com>; nd <nd@arm.com>
> > >> Subject: Re: [PATCH 03/10] xen/arm: introduce PGC_reserved
> > >>
> > >>
> > >>
> > >> On 18/05/2021 06:21, Penny Zheng wrote:
> > >>> In order to differentiate pages of static memory, from those
> > >>> allocated from heap, this patch introduces a new page flag
> > >>> PGC_reserved
> > to tell.
> > >>>
> > >>> New struct reserved in struct page_info is to describe reserved
> > >>> page info, that is, which specific domain this page is reserved
> > >>> to. > Helper page_get_reserved_owner and page_set_reserved_owner
> > >>> are designated to get/set reserved page's owner.
> > >>>
> > >>> Struct domain is enlarged to more than PAGE_SIZE, due to
> > >>> newly-imported struct reserved in struct page_info.
> > >>
> > >> struct domain may embed a pointer to a struct page_info but never
> > >> directly embed the structure. So can you clarify what you mean?
> > >>
> > >>>
> > >>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> > >>> ---
> > >>>    xen/include/asm-arm/mm.h | 16 +++++++++++++++-
> > >>>    1 file changed, 15 insertions(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
> > >> index
> > >>> 0b7de3102e..d8922fd5db 100644
> > >>> --- a/xen/include/asm-arm/mm.h
> > >>> +++ b/xen/include/asm-arm/mm.h
> > >>> @@ -88,7 +88,15 @@ struct page_info
> > >>>             */
> > >>>            u32 tlbflush_timestamp;
> > >>>        };
> > >>> -    u64 pad;
> > >>> +
> > >>> +    /* Page is reserved. */
> > >>> +    struct {
> > >>> +        /*
> > >>> +         * Reserved Owner of this page,
> > >>> +         * if this page is reserved to a specific domain.
> > >>> +         */
> > >>> +        struct domain *domain;
> > >>> +    } reserved;
> > >>
> > >> The space in page_info is quite tight, so I would like to avoid
> > >> introducing new fields unless we can't get away from it.
> > >>
> > >> In this case, it is not clear why we need to differentiate the "Owner"
> > >> vs the "Reserved Owner". It might be clearer if this change is
> > >> folded in the first user of the field.
> > >>
> > >> As an aside, for 32-bit Arm, you need to add a 4-byte padding.
> > >>
> > >
> > > Yeah, I may delete this change. I imported this change as
> > > considering the functionality of rebooting domain on static allocation.
> > >
> > > A little more discussion on rebooting domain on static allocation.
> > > Considering the major user cases for domain on static allocation are
> > > system has a total pre-defined, static behavior all the time. No
> > > domain allocation on runtime, while there still exists domain rebooting.
> >
> > Hmmm... With this series it is still possible to allocate memory at
> > runtime outside of the static allocation (see my comment on the design
> document [1]).
> > So is it meant to be complete?
> >
> 
> I'm guessing that the "allocate memory at runtime outside of the static
> allocation" is referring to XEN heap on static allocation, that is, users pre-
> defining heap in device tree configuration to let the whole system more static
> and predictable.
> 
> And I've replied you in the design there, sorry for the late reply. Save your time,
> and I’ll paste here:
> 
> "Right now, on AArch64, all RAM, except reserved memory, will be finally
> given to buddy allocator as heap,  like you said, guest RAM for normal domain
> will be allocated from there, xmalloc eventually is get memory from there, etc.
> So we want to refine the heap here, not iterating through `bootinfo.mem` to
> set up XEN heap, but like iterating `bootinfo. reserved_heap` to set up XEN
> heap.
> 
> On ARM32, xen heap and domain heap are separately mapped, which is more
> complicated here. That's why I only talking about implementing these features
> on AArch64 as first step."
> 
>  Above implementation will be delivered through another patch Serie. This
> patch Serie Is only focusing on Domain on Static Allocation.
> 

Oh, Second thought on this. 
And I think you are referring to balloon in/out here, hmm, also, like
I replied there:
"For issues on ballooning out or in, it is not supported here.
Domain on Static Allocation and 1:1 direct-map are all based on
dom0-less right now, so no PV, grant table, event channel, etc, considered.

Right now, it only supports device got passthrough into the guest."

> > >
> > > And when rebooting domain on static allocation, all these reserved
> > > pages could not go back to heap when freeing them.  So I am
> > > considering to use one global `struct page_info*[DOMID]` value to store.
> > >
> > > As Jan suggested, when domain get rebooted, struct domain will not
> > > exist
> > anymore.
> > > But I think DOMID info could last.
> > You would need to make sure the domid to be reserved. But I am not
> > entirely convinced this is necessary here.
> >
> > When recreating the domain, you need a way to know its configuration.
> > Mostly likely this will come from the Device-Tree. At which point, you
> > can also find the static region from there.
> >
> 
> True, true. I'll dig more in your suggestion, thx. 😉
> 
> > Cheers,
> >
> > [1] <7ab73cb0-39d5-f8bf-660f-b3d77f3247bd@xen.org>
> >
> > --
> > Julien Grall
> 
> Cheers
> 
> Penny

Cheers

Penny


  reply	other threads:[~2021-05-20  8:40 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18  5:21 [PATCH 00/10] Domain on Static Allocation Penny Zheng
2021-05-18  5:21 ` [PATCH 01/10] xen/arm: introduce domain " Penny Zheng
2021-05-18  8:58   ` Julien Grall
2021-05-19  2:22     ` Penny Zheng
2021-05-19 18:27       ` Julien Grall
2021-05-20  6:07         ` Penny Zheng
2021-05-20  8:50           ` Julien Grall
2021-06-02 10:09             ` Penny Zheng
2021-06-03  9:09               ` Julien Grall
2021-06-03 21:32                 ` Stefano Stabellini
2021-06-03 22:07                   ` Julien Grall
2021-06-03 23:55                     ` Stefano Stabellini
2021-06-04  4:00                       ` Penny Zheng
2021-06-05  2:00                         ` Stefano Stabellini
2021-06-07 18:09                       ` Julien Grall
2021-06-09  9:56                         ` Bertrand Marquis
2021-06-09 10:47                           ` Julien Grall
2021-06-15  6:08                             ` Penny Zheng
2021-06-17 11:22                               ` Julien Grall
2021-05-18  5:21 ` [PATCH 02/10] xen/arm: handle static memory in dt_unreserved_regions Penny Zheng
2021-05-18  9:04   ` Julien Grall
2021-05-18  5:21 ` [PATCH 03/10] xen/arm: introduce PGC_reserved Penny Zheng
2021-05-18  9:45   ` Julien Grall
2021-05-19  3:16     ` Penny Zheng
2021-05-19  9:49       ` Jan Beulich
2021-05-19 19:49         ` Julien Grall
2021-05-20  7:05           ` Jan Beulich
2021-05-19 19:46       ` Julien Grall
2021-05-20  6:19         ` Penny Zheng
2021-05-20  8:40           ` Penny Zheng [this message]
2021-05-20  8:59             ` Julien Grall
2021-05-20  9:27               ` Jan Beulich
2021-05-20  9:45                 ` Julien Grall
2021-05-18  5:21 ` [PATCH 04/10] xen/arm: static memory initialization Penny Zheng
2021-05-18  7:15   ` Jan Beulich
2021-05-18  9:51     ` Penny Zheng
2021-05-18 10:43       ` Jan Beulich
2021-05-20  9:04         ` Penny Zheng
2021-05-20  9:32           ` Jan Beulich
2021-05-18 10:00   ` Julien Grall
2021-05-18 10:01     ` Julien Grall
2021-05-19  5:02     ` Penny Zheng
2021-05-18  5:21 ` [PATCH 05/10] xen/arm: introduce alloc_staticmem_pages Penny Zheng
2021-05-18  7:24   ` Jan Beulich
2021-05-18  9:30     ` Penny Zheng
2021-05-18 10:09     ` Julien Grall
2021-05-18 10:15   ` Julien Grall
2021-05-19  5:23     ` Penny Zheng
2021-05-24 10:10       ` Penny Zheng
2021-05-24 10:24         ` Julien Grall
2021-05-18  5:21 ` [PATCH 06/10] xen: replace order with nr_pfns in assign_pages for better compatibility Penny Zheng
2021-05-18  7:27   ` Jan Beulich
2021-05-18  9:11     ` Penny Zheng
2021-05-18 10:20   ` Julien Grall
2021-05-19  5:35     ` Penny Zheng
2021-05-18  5:21 ` [PATCH 07/10] xen/arm: intruduce alloc_domstatic_pages Penny Zheng
2021-05-18  7:34   ` Jan Beulich
2021-05-18  8:57     ` Penny Zheng
2021-05-18 11:23       ` Jan Beulich
2021-05-21  6:41         ` Penny Zheng
2021-05-21  7:09           ` Jan Beulich
2021-06-03  2:44             ` Penny Zheng
2021-05-18 12:13       ` Julien Grall
2021-05-19  7:52         ` Penny Zheng
2021-05-19 20:01           ` Julien Grall
2021-05-18 10:30   ` Julien Grall
2021-05-19  6:03     ` Penny Zheng
2021-05-18  5:21 ` [PATCH 08/10] xen/arm: introduce reserved_page_list Penny Zheng
2021-05-18  7:39   ` Jan Beulich
2021-05-18  8:38     ` Penny Zheng
2021-05-18 11:24       ` Jan Beulich
2021-05-19  6:46         ` Penny Zheng
2021-05-18 11:02   ` Julien Grall
2021-05-19  6:43     ` Penny Zheng
2021-05-18  5:21 ` [PATCH 09/10] xen/arm: parse `xen,static-mem` info during domain construction Penny Zheng
2021-05-18 12:09   ` Julien Grall
2021-05-19  7:58     ` Penny Zheng
2021-05-18  5:21 ` [PATCH 10/10] xen/arm: introduce allocate_static_memory Penny Zheng
2021-05-18 12:05   ` Julien Grall
2021-05-19  7:27     ` Penny Zheng
2021-05-19 20:10       ` Julien Grall
2021-05-20  6:29         ` Penny Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VE1PR08MB5215E19BFE3E7F329229D8E7F72A9@VE1PR08MB5215.eurprd08.prod.outlook.com \
    --to=penny.zheng@arm.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Wei.Chen@arm.com \
    --cc=julien@xen.org \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.