[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 Tyshchenko <olekstysh@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Sep 2021 08:17:38 +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=VKAl0iYcj7NCke8e9iNAbFLKipAgg52emyZBF3rkWps=; b=faMTdXKpAvDHXO/rI5UdTNY6J7jOWvavTxgpQjUp1dXKIKk4A+oQWKtDWLB+nwo9JjcoBSSZlQMWilMvJa1Kb9VhVNgJyxuVjU2xi0IwXbMG4sRQyL/jd6mU/P3dloaLM7aNC1TLWmlVibuO43GbLrJI4P1IanOfRhL/kHfal3Gk6VLxxg7CfZvRVITnN2Qc/uOVxyJwNX/864VWKosq7171O+zNK9+nHwb2hXkdc8sa+M5Fq/+RIE7w8WfF4CZEVPX+Jc1flcO+BTL11jQUUj/rRPqarH15y1k4C3k36nAvRLkan4iUND0fICEukLqwviRvvb+1iT4q/1sQuOnwOw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hzFBOeusD01//5LjL0aU8j6uXsH44rsKL6NpzUsI+GhCZKEY68nkSpzsy2XonUx62aZvfab1f4oR4KLenM/MTPF4AuMtdG/4IXhclNpfTMr5gGPCpq6Pr/eKIbWENXPNcgIHBw9Q4xXvP2SLTNXQsLa/x0HMq4Qoa7x0SU0oo2jGjQS++/n+UFWJi02MWi53bM5n3G2V72l7iJB3LiPS2T2Suwm1APsftGRRjdwC17flkAWxTO/l14ys0nBhG9L4cXOISNNJ5GtQ8W3nyVZbfjYS6hxFTiYgKbA7FZAKx7s/Y2tBBNjCInJePx04ISYBq3AukDUd5NZ0FIku227biA==
  • 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: Mon, 13 Sep 2021 06:18:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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?

Jan




 


Rackspace

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