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

Re: [PATCH 08/16] x86/P2M: PoD, altp2m, and nested-p2m are HVM-only


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Date: Sat, 5 Feb 2022 21:29:33 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=6A3Tuku/0GdrmDCeToXondAN5ZO6FISbV8Tp3BuboDY=; b=jH6YXy4H767OIK15Tzj0yOuqH3fZJiNXQnor233OD6gnNBuuFuvcgmc12C3Rc6qnDzQ4dKQ7C7OtwVs5K0nM0bhSRnpoh1897f0V+jRQTeCtWRQLAeFhQVm2iIGJXXPwmj65gf/9HxOKTx04j4SWrC4+spBMX8qpTKej1yemfl83UuI4qlT1x0U+pILlspjOrAZLJUacprdqdmThb7TPZQmLCwZaTy53PFqY+/zMuIVyiRlhd05+D2SxKlv46+l+6aT57BKb54Zg17K+Ik8IW3gSQrqFQD5ZJ3bIZjLmlAq/Xtacu/Fq+Gn652geQPlW5JrVzUKrd46WuUnaTQEgnA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YOSbIIY+49IuyjzwPpIULMe314Pr6n4faqc+O6p+7P7uWmZL3b+ksGE1MjjWoHGq+3KPucncQUztPXbHvBNMD+KI4xvL+8fJq31Xys8IcUZAeJ1ROgVwNVNR1Uo5E2TP5fZloXsH4RTG5yN/qZ8Y7ri3RmatrThu7XNXJq6mRMfxc98GQJ/nRO6PjtDMMIwZxFwJVH+4P0Acf8Vlx1hrO0mcnmuDiXNvHKb06F0B8ZPLc5pz4/RqIV/hoDZz7lXGSxICw0/8+wlwrOnq+cuEHMuZOCzuwKxRPRkAw6/9EZ6F6bKhmbX4RzQERP6NiBHO8EJCimsGx4P6UBYcetXcdw==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Andrew Cooper" <Andrew.Cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Sat, 05 Feb 2022 21:29:50 +0000
  • Ironport-data: A9a23:E/B+BKMhhbaWOdXvrR1HkMFynXyQoLVcMsEvi/4bfWQNrUorhTAFn TNMWT2DP/2Dajf1Ldh3aYuzoR4B65LTzNZqHgto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdpJYz/uUGuCJQUNUjMlkfZKhTr6UUsxNbVU8En1500o+w7RRbrNA2rBVPSvc4 bsenOWHULOV82Yc3rU8sv/rRLtH5ZweiRtA1rAMTakjUGz2zhH5OKk3N6CpR0YUd6EPdgKMq 0Qv+5nilo/R109F5tpICd8XeGVSKlLZFVDmZna7x8FOK/WNz8A/+v9TCRYSVatYoxWFxOh8y 9JSiYaTezcQD/WLibQyegYNRkmSPYUekFPGCX22sMjVxEzaaXr8hf5pCSnaP6VBpLwxWzsXs 6VFdnZdNXhvhMrvqF6/YsZhgd4sIY/HIYUbs2lIxjDFF/c2B5vERs0m4PcGh29r3ZsVQJ4yY eJHczp/aSzRTCcWeQwuL7UUsriapGDGJmgwRFW9+vNsvjm7IBZK+KfpGMrYfJqNX8o9tlaVo CfK8nr0BjkeNceD0nyV/3S0nOjNkCjnHoUIG9WQ1NRnnVmSzWw7EwANWB2wpvzRt6Klc4sBc QpOoHNo9PVsshzwJjXgY/GmiF6I5SYRWN1PL/cZ2jG0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tmtJ uIHJIOcOEYYWIK7/oSpTPIburIo+P3s5xA592utEuFJDsCA8oLgmcJaTpzUHcGPjWubaBJSa Z0jfA3wAZIDE5nF/hTcUN1OdQryee78a7OUFojPVoK+QOOhTSn5PrRCB6DxCoTVDtJ3PML7X XFuxaR3NTgj9iLjjvnk0PD5ZVfn9XsjvFZAtaXt8QTIjLwzi61eYVaXaGYtjxdmpDr1L9qqq iJn/4TBbU015rjRBDtnfIr4Xi57N8a0Q6k9bZfuwq5nSW2fkNhNyMLv/MmTvKQ0TtQgDg76t MW44vRjeslMTrQ2Cv6/NTGTBdsiw69pmcji/caizhFXZIZc6I5l/1TwKvEeK1wbB4SxbpXW9 WGNvusrsq+sGnqGEzxry1q2pihT34zFhCJTgwLvdGUySFfmDR8w1EDzMISk38c/NZlIqM0qN jsI+BtjvVDX8UWZaVyCKMIRta2EHXERVbJPHiJKVrqGakbMzbGqoLx4r8y+Oa2EaZ4gKcaid DEShdVpGQyc0XhBYmH24BK6AnERCGnUTHk2qhlltBEU33HNfPW2AG4OSUTevqb0oMi65fgKo SO0bptcoveEVc=
  • Ironport-sdr: lhbLRTjsRHqS6GrYBrCNpcBZmXnqF4pX0ui/8Pco2fsbjPJcMk4C7lL0GmWYoFiHu7lWSQA4/h kG+/b+HxSUb0bempSn4bOXUYJfNUUh6JvExKejG1gQSh/ZFm0MeujnWvk36CMKwt+0jLexlIcC 3DFlNSWv4bIx7BaU032t5bBhjpyeRi3VoXQGwL8ENQux5PaWkfHvyum1VY7j1xPKhb+sD2houZ a8pWeSps+fAxRg6WAec8uRjIH9T9bRwoLxrBo1CWJfVoHddKPd0KcKHKOjaIEx82RuTNXXOwW9 vgqKq+yHLrYRhM/XVRVOtATB
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXcbg9+9E9Zp3QUEWtGX2TK6aCNayGy30A
  • Thread-topic: [PATCH 08/16] x86/P2M: PoD, altp2m, and nested-p2m are HVM-only


> On Jul 5, 2021, at 5:09 PM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
> 
> There's no need to initialize respective data for PV domains. Note that
> p2m_teardown_{alt,nested}p2m() will handle the lack-of-initialization
> case fine.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -102,6 +102,9 @@ static int p2m_initialise(struct domain
>     p2m->default_access = p2m_access_rwx;
>     p2m->p2m_class = p2m_host;
> 
> +    if ( !is_hvm_domain(d) )
> +        return 0;
> +
>     p2m_pod_init(p2m);
>     p2m_nestedp2m_init(p2m);


> 
> @@ -259,7 +262,7 @@ int p2m_init(struct domain *d)
>     int rc;
> 
>     rc = p2m_init_hostp2m(d);
> -    if ( rc )
> +    if ( rc || !is_hvm_domain(d) )
>         return rc;
> 
> #ifdef CONFIG_HVM
> --- a/xen/arch/x86/mm/p2m.h
> +++ b/xen/arch/x86/mm/p2m.h
> @@ -17,6 +17,8 @@
> 
> #include <xen/mem_access.h>
> 
> +void p2m_pod_init(struct p2m_domain *p2m);
> +
> int p2m_add_identity_entry(struct domain *d, unsigned long gfn,
>                            p2m_access_t p2ma, unsigned int flag);
> int p2m_remove_identity_entry(struct domain *d, unsigned long gfn);
> --- a/xen/arch/x86/mm/p2m-pod.c
> +++ b/xen/arch/x86/mm/p2m-pod.c
> @@ -1135,6 +1135,12 @@ p2m_pod_demand_populate(struct p2m_domai
>     mfn_t mfn;
>     unsigned long i;
> 
> +    if ( !p2m_is_hostp2m(p2m) )
> +    {
> +        ASSERT_UNREACHABLE();
> +        return false;
> +    }
> +
>     ASSERT(gfn_locked_by_me(p2m, gfn));
>     pod_lock(p2m);

Why this check rather than something which explicitly says HVM?

If you really mean to check for HVM here but are just using this as a shortcut, 
it needs a comment.

With that addressed:

Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>

 -George




 


Rackspace

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