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

RE: [PATCH] xen/arm: Reduce redundant clear root pages when teardown p2m


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Mon, 12 Dec 2022 11:27:26 +0000
  • Accept-language: zh-CN, 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l9B2gp5tmonAmPjqlto2evnFWC14CLjDcuB7zjt6QKU=; b=lqts4GGBqKgRCrYqyp6MYPKbDqYU9iDB476ak9itA6kQPd8GTuuoChHn6+ExxL6Ss04a/2W8m+Bn1PprrJwNuldHP1wmDbqbxrttJl1FMqyD3TXxh8mTnidmFvcAMDiTcQEw7kN2xofdrjOfFk3/yyxuSUK7g0wzR7dn3q+CyMX85YyvLwvhffdnWJ0irwdrMeCpmFl8P+YmBgQ+/CFQU5q7aumNWI7oIN929bD20M7WG8lz5nK6LlcdmK0LpOc98vvkTWyfiHIrcmzTrvz/zs6S7ZpE83MT5C5dP6eVB6YEL3j6eSuFcLCLgy7RCGjCeDRtbINutegttorD8H/zHw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZYhrT1C6zWoCFB9Xe/Br4anbdqxyXg4Ot64oUmTiYVOvUTs56tIHLjoovaD9tHjm8F+MZTjwHLxSydc1m1ULZF2cWoq+U6S7b/VWFn5VolKtSF+Zub9xlhcHRLM7IG6jXzroYtU3pzHZ33dmjVywbkysp8tLeMiZwuDJikYnL/poNbwKhO1696MFOaLKEId68KkcaWWvU446bz/nVluoIy8IAGQZ/iU0J3kFhkWBJuP/0GIbdl3gOEo377lT1MTLnBziKNgqDQUzmrLZTJGurKoJMxqaHHs/OZ7lzH0JEh3ZQSV87szHLzMOcgErmYZK2peLsAjEFdEev0zF4V2WFQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 12 Dec 2022 11:27:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZDfTM8ZVdBcwf4EKHce09rjobqq5qHDOAgAAAaXA=
  • Thread-topic: [PATCH] xen/arm: Reduce redundant clear root pages when teardown p2m

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Subject: Re: [PATCH] xen/arm: Reduce redundant clear root pages when
> teardown p2m
> 
> Hi Henry,
> 
> >       PROGRESS(p2m):
> > +        /*
> > +         * We are about to free the intermediate page-tables, so clear the
> > +         * root to prevent any walk to use them.
> > +         */
> > +        p2m_clear_root_pages(&d->arch.p2m);
> 
> The commit message suggests this should only be called once. However,
> you will still end up to call p2m_clear_root_pages() multiple time if
> p2m_teardown() is preempted.

Thanks for confirming this, would adding another PROGRESS stage
such as PROGRESS(p2m_clean) before PROGRESS(p2m) seem ok to you?

> 
> >           ret = p2m_teardown(d, true);
> >           if ( ret )
> >               return ret;
> > diff --git a/xen/arch/arm/include/asm/p2m.h
> b/xen/arch/arm/include/asm/p2m.h
> > index 91df922e1c..bf5183e53a 100644
> > --- a/xen/arch/arm/include/asm/p2m.h
> > +++ b/xen/arch/arm/include/asm/p2m.h
> > @@ -281,6 +281,7 @@ int p2m_set_entry(struct p2m_domain *p2m,
> >
> >   bool p2m_resolve_translation_fault(struct domain *d, gfn_t gfn);
> >
> > +void p2m_clear_root_pages(struct p2m_domain *p2m);
> >   void p2m_invalidate_root(struct p2m_domain *p2m);
> >
> >   /*
> > diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> > index 948f199d84..0c942c5923 100644
> > --- a/xen/arch/arm/p2m.c
> > +++ b/xen/arch/arm/p2m.c
> > @@ -1314,6 +1314,18 @@ static void p2m_invalidate_table(struct
> p2m_domain *p2m, mfn_t mfn)
> >       p2m->need_flush = true;
> >   }
> >
> >       /*
> >        * The domain will not be scheduled anymore, so in theory we should
> >        * not need to flush the TLBs. Do it for safety purpose.
> 
> This flush needs to be moved in p2m_clear_root_pages().

Sure, will move this in v2.

Kind regards,
Henry

> 
> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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