On 04.01.2022 22:41, Oleksandr wrote: > On 04.01.22 10:36, Jan Beulich wrote: >> On 22.12.2021 13:44, Oleksandr wrote: >>> I also wonder, can we apply pattern for all type of pages here (without >>> differentiating)? >> I'm afraid I don't understand this part: How could we get along without >> differentiating Xen heap and domain heap pages? > > I was thinking, what bad could happen if we would simply use the following: > > diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c > index 50334a0..97cf0d8 100644 > --- a/xen/common/page_alloc.c > +++ b/xen/common/page_alloc.c > @@ -1024,7 +1024,7 @@ static struct page_info *alloc_heap_pages( > &tlbflush_timestamp); > > /* Initialise fields which have other uses for free pages. */ > - pg[i].u.inuse.type_info = 0; > + pg[i].u.inuse.type_info = PGT_TYPE_INFO_INIT_PATTERN; > page_set_owner(&pg[i], NULL); > > } > > > on Arm: > #define PGT_TYPE_INFO_INIT_PATTERN PGT_gfn_mask > or > #define PGT_TYPE_INFO_INIT_PATTERN gfn_x(PGT_INVALID_XENHEAP_GFN) > > on x86: > #define PGT_TYPE_INFO_INIT_PATTERN 0 > > > Yes, we apply this pattern to *all* pages, although the gfn portion is > only used for xenheap pages. > I might mistake but I think this pattern (which doesn't set any bits > outside of the gfn portion) is harmless for non-xenheap pages, albeit an > extra action.
I wouldn't mind this, but it's largely to the Arm maintainers to be happy with it, i.e. not foreseeing present or latent issues. Jan
