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

Re: [PATCH 2/2] xen: rename wrong named pfn related variables


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 3 Aug 2021 12:42:32 +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:X-MS-Exchange-SenderADCheck; bh=dMkVA/l2nrqW9yireGHA+41NCyqRsWOtb5IB3/UnIjw=; b=f2W3XayjpGWUNhHQPOtdgaLSBkHAW6IqcbLKVLW9MOcTVqChsqgQ9hivC45B+/hTqZQxlMjKA/Iz5PbmI0wRS0gJVqB08yaGCAmCWC2IzJ0h+3KDfejMEscGBO56IfbFb1ZIgDUk67J2sQ6eyaEkcY/JtOCz+/hSnHbecqROzy+eDtar+a4OWhd5TALB0uMQY6bU/NUVXrd66GYsr3bWQXB8nIgiEN2AIOsgsj4P8cBNGAty1mzjUP1m6fX0+pCPyCVD53hadxWOinlQVGTXgp6hmPkzZkZowgXDt36fCrpMzx+70v60oYC4erM2ZLqNVn+OqI8wlTyjSEjtPAomow==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LwMSIVcIp0GVc3UzczpDnOHMuAxPrUj7/A6VpaPMFgb3Lwi9nw37ncS+BF6x27tSHZquUVMeiJydByJOfqXXocaw0n2edh0HYwglCvmi3BYsPnJJDj1QLjkwEsFHMKSqIvrB5YNKasKccQGMaOnN9xupcckz2UslmPut+evP77fW0AL8CfloP2gKS0EUkg+9lmHN8tj/V+/M2rMsnNGmajpYSyv/B1tUV7DFpsXh1bp4Z5yhxQJ7YagiVPZqzdW1Z8ZQisJThBMHVbGr/XCcWk518NHNBk7Qkbu51pjUbxNTtBRcrsSK7chrTYrzYaTPlY0pNE2Ny80VqbD8CvyehA==
  • Authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=suse.com;
  • Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx
  • Delivery-date: Tue, 03 Aug 2021 10:42:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.07.2021 11:00, Juergen Gross wrote:
> On 16.06.21 12:43, Juergen Gross wrote:
>> On 16.06.21 11:56, Jan Beulich wrote:
>>> On 16.06.2021 09:30, Juergen Gross wrote:
>>>> --- a/arch/x86/xen/p2m.c
>>>> +++ b/arch/x86/xen/p2m.c
>>>> @@ -95,8 +95,8 @@ unsigned long *xen_p2m_addr __read_mostly;
>>>>   EXPORT_SYMBOL_GPL(xen_p2m_addr);
>>>>   unsigned long xen_p2m_size __read_mostly;
>>>>   EXPORT_SYMBOL_GPL(xen_p2m_size);
>>>> -unsigned long xen_max_p2m_pfn __read_mostly;
>>>> -EXPORT_SYMBOL_GPL(xen_max_p2m_pfn);
>>>> +unsigned long xen_p2m_max_size __read_mostly;
>>>> +EXPORT_SYMBOL_GPL(xen_p2m_max_size);
>>>
>>> Instead of renaming the exported variable (which will break consumers
>>> anyway), how about dropping the apparently unneeded export at this
>>> occasion?
>>
>> Why do you think it isn't needed? It is being referenced via the inline
>> function __pfn_to_mfn() in arch/x86/include/asm/xen/page.h. And
>> __pfn_to_mfn() is used via lots of other inline functions and macros.
>>
>>> Further it looks to me as if xen_p2m_size and this variable
>>> were actually always kept in sync, so I'd like to put up the question
>>> of dropping one of the two.
>>
>> Hmm, should be possible, yes.
> 
> Looking into this it seems this is not possible.
> 
> xen_p2m_size always holds the number of p2m entries in the p2m table,
> including invalid ones at the end. xen_p2m_pfn_limit however contains
> the (rounded up) index after the last valid p2m entry.

I'm afraid I can't follow:

xen_build_dynamic_phys_to_machine() sets xen_p2m_size and then syncs
its value to what so far has been xen_max_p2m_pfn.

xen_vmalloc_p2m_tree() sets xen_max_p2m_pfn and then syncs its value
to xen_p2m_size.

I therefore can't see how the two values would hold different values,
except for the brief periods between updating one and then the other.

Jan




 


Rackspace

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