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

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


  • To: Oleksandr <olekstysh@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Sep 2021 10:06:14 +0200
  • 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; bh=p6cVXwCgI3ZhoJUMSTwlj63aGkUFMebjA8TT2q2fUqc=; b=aRzOSkJbmm/j07GCGKYi9BU0HERWkgh3A2k+N7wpg1rBBS2Zr6/EBnZ5ZsK6aoa0SOae/qjLKpZFdDqHk9dmom5z7LGRczy9GYUPRJiDPCIiVLpSZtyqEaATX9msJuAMZebbi3TXP4moyzpmwZxMRohDbS5EIqG/Z+HCOQBsBekLi2XtDbJoRo5kzJpe3rkWifmK7Hn5vITxhUrQk7+sZaXifCMXVjxLcIuVrBKW9g4FhQWA7pLKLUZGXLTbUST/lOgy0Ak32lyxpoUVg/QHfjBDwbWSZiNSLtNRCtyYAw4xLauOhdKn+5xkTjVow4mIr+dc2oWibBk20kRkk+wWlw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eS25SORDsF2HhD4kf64rJbrV6H8CKkMug7zdnjd+InzFa5BBPTnUHa+IBPoQRmRnj9oeLhF23LLLJE46aMkCmbe51pBnx57CKe7hP+10De6amxDol78tSEXDJSOXdiNga2xT9ptE25iR4jpfFpPV696pTaeO4ntAHUvLeyk8xBjXu98UKTGzgudM58ThF+o+BCceKXbazSlI+L77lrb9deFlhF3rM1LzUyErpkNyrrcl9MIAnVSu1fhlqWKeoACBtWpyAYVxNw7H34L3N+Ws+0JnNUGQZTHHZTgua8mxNwRaJvp8IyE1wPTAcfNvCURAWKpix+coxUtH2s5pgQD30g==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 14 Sep 2021 08:06:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.09.2021 21:57, Oleksandr wrote:
> 
> On 13.09.21 09:17, Jan Beulich wrote:
> 
> Hi Jan
> 
>> On 10.09.2021 09:52, Jan Beulich wrote:
>>> On 10.09.2021 01:04, Oleksandr Tyshchenko wrote:
>>>> @@ -731,11 +733,19 @@ static void p2m_put_l3_page(const lpae_t pte)
>>>>        */
>>>>       if ( p2m_is_foreign(pte.p2m.type) )
>>>>       {
>>>> -        mfn_t mfn = lpae_get_mfn(pte);
>>>> -
>>>>           ASSERT(mfn_valid(mfn));
>>>>           put_page(mfn_to_page(mfn));
>>>>       }
>>>> +
>>>> +#ifdef CONFIG_GRANT_TABLE
>>>> +    /*
>>>> +     * Check whether we deal with grant table page. As the grant table 
>>>> page
>>>> +     * is xen_heap page and its entry has known p2m type, detect it and 
>>>> mark
>>>> +     * the stored GFN as invalid.
>>>> +     */
>>>> +    if ( p2m_is_ram(pte.p2m.type) && is_xen_heap_mfn(mfn) )
>>>> +        page_set_frame_gfn(mfn_to_page(mfn), INVALID_GFN);
>>>> +#endif
>>> I take it the write done is benign for other Xen heap pages? I suppose
>>> this would want making very explicit, as such an assumption is easy to
>>> go stale by entirely unrelated changes.
>>>
>>> I also wonder whether you really mean to include p2m_ram_ro pages here
>>> as well.
>> Actually I've meanwhile realized I should put my question here quite
>> differently: Aren't you effectively introducing an M2P here for Arm,
>> except that you artificially limit it to the Xen heap pages needed for
>> the grant table?
> 
> Difficult to say, it might indeed look a bit close to M2P, so the answer 
> to your question is more yes than no. But, I didn't have a plan to 
> introduce M2P on Arm. It turned out that stashing GFN into page_info (as 
> was suggested) avoided huge lookups, so we have got MFN->GFN in the end. 
> The purpose of this patch was just to fix a potential issue with 
> remapping grant-table frame on architecture without the M2P (Arm).

I understand this is the immediate goal. I wonder though if it's helpful
to make this a special case when it can (I think) easily be made general.
But of course there may be (perhaps Arm-specific) aspects which I'm
simply unaware of.

Jan




 


Rackspace

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