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

Re: [PATCH V4] xen/gnttab: Store frame GFN in struct page_info on Arm


  • To: Oleksandr <olekstysh@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 5 Jan 2022 08:30:54 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7OWzSbjz7WWvMI1pLQNRfR4ujfIx1CWbjr4ISltF/CA=; b=kK9NDD2AgGVqppBQUg/hSSgvApae7jz3VCp4gIeD8rfWEVgejXD4POyQtrLyhuti+VT1Ai6uardZpqPj38SBFOpjwgFI6Zv8Ydr1hZbAPvajKwEgmn1ryqU0ACXwxiGlMI6XvXDM+uTd8qQgGr6HGtSdk+jbV9ys8IJpQcJpeOgC0NBw3bxrOWoMGYBgkfn+HMi/6/XI7p47LB49W5NlTti/S8b/RPYUcwwdpQPGEgRlYvQsxZ9gl4So19RVUGeuxSiVFCt3fNdejbU2TIHvx86UQF5eULhqfC8gQ5AzLs4Cs9iP65Dzich5rq5p7ytRHGu57jftsfl0Iti9YI3npw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P/D8sSHj6wYo+szT5BrEh0OcwYbqrWa5tFmDNTp9ijwzfj+eQi9AQ0sC7b79Z56DMCsQ30wrxZK/wecMPx3tMG2zPIA3mO2Tw45pwbnyMMx0L+/ll/ay9/gfbNCBZ1dUkX+taF9+FtoNU2gcKqeDkbiZwoE3rUQLInBVF0Etf70DFxM/llNKbbV+Yt/p7cg3r9Sr2PBAOeSCjp/+X8/JFnNgnmXKtBHJVkVHpRgy7JL83KyXZ15Ii2HI1U3YhwMBCLvctB5pegFYEvSsmbjiwKNH4+9RqQNj46G5mpOX6hP5Lnf2B90yenjglHIfL3iJK78QUCq5OTSCMNN+iwodwQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Wed, 05 Jan 2022 07:31:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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




 


Rackspace

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