[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: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 7 Feb 2022 16:23:26 +0100
  • 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=05l7ZYLdRIwwriqqWm0poDjmnN1jNoCs55GRcALMQKU=; b=cj+aWaAgbj+YNocVGT4s/z1cNK20TX2H6K2V56sQmy55S2Z66CKgdP3fEGv5HKLV4ihikFDcBmslejemL2G9sLGAxPAHshuCH2Q9Iru2qVssXHGdVye+8u1UD0VOqk59yCVzjavO5G9allORMIPW6HMKa8PTuM+CkQ6T+ml1+nDlEVB5aga7bdC0Y3Cha0Vgt7noqj0iXBI9F9vB0DfTkhEb6d7SEXQXaJYsaHcVrrXoZacZIoSJ/kHx6TSoV1poFXeKY7hefmNGemHFtTPYhlGsFZchwA+3OSfqueRXYchcbK/1pJHv3ziYE19uPzQ409gEGt29kD1rE8TLuiF4Zw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZOUUs8a9G5zGMnx9HaY67MmG3iJPNmYSGXSDI/Wsbzkurxb4ALd13Y9Zq4OQx5PXODvNIheq0QXooeZCdeggBDpd23CcxGj+/4+Pq5PGnhmheDsWxIAiBCmYkp7bbWUykOoBWAe6aYnCRtmK6Y9K0pBCad22F9wVvB9qj8pNhy4Qe7pOrDzSYdYLKNhK0VStHtOU9vbmcbp5FIe5YDH0OsKMdq79bekBAIWS+bfsmR+TEJECnNqBnRPv7KpJ+2M2QB9uXNipRnTSW2u1pF7mI2Jr/1dKMOGIfRV5aDIQ51AnbeN+1XK9xiQVh0sdwHXVuRu1Hxe4WMtrd+GJk2RfDw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.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: Mon, 07 Feb 2022 15:23:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.02.2022 15:45, George Dunlap wrote:
>> On Feb 7, 2022, at 10:11 AM, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> On 05.02.2022 22:29, George Dunlap wrote:
>>>> On Jul 5, 2021, at 5:09 PM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>>> --- 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?
>>
>> Checking for just HVM is too lax here imo. PoD operations should
>> never be invoked for alternative or nested p2ms; see the various
>> uses of p2m_get_hostp2m() in p2m-pod.c.
> 
> The fact remains that it doesn’t match what the patch descriptions says, and 
> you’re making me, the reviewer, guess why you changed it — along with anyone 
> else coming back to try to figure out why the code was this way.
> 
> If you want me to approve of the decision to make the check more strict than 
> simply HVM, then you need to make it clear why you’re doing it.  Adding a 
> sentence in the commit message should be fine.

I've added a paragraph, but already after your first reply I was
asking myself whether I actually need that change here. It's
more of the "just to be on the safe side" nature, I think. But
it's been quite a while since I put this change together, so I
may also have forgotten about some subtle aspect.

Jan




 


Rackspace

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