[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e6095474-5000-410b-95b3-c0eeaf092042@suse.com>
Date: Thu, 22 Aug 2024 13:38:00 +0200
From: Jürgen Groß <jgross@...e.com>
To: Jan Beulich <jbeulich@...e.com>
Cc: Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, xen-devel@...ts.xenproject.org,
Marek Marczykowski-Górecki
<marmarek@...isiblethingslab.com>, linux-kernel@...r.kernel.org,
x86@...nel.org
Subject: Re: [PATCH v2 4/7] xen: move max_pfn in xen_memory_setup() out of
function scope
On 20.08.24 10:44, Jan Beulich wrote:
> On 20.08.2024 10:20, Juergen Gross wrote:
>> Instead of having max_pfn as a local variable of xen_memory_setup(),
>> make it a static variable in setup.c instead. This avoids having to
>> pass it to subfunctions, which will be needed in more cases in future.
>>
>> Rename it to ini_nr_pages, as the value denotes the currently usable
>> number of memory pages as passed from the hypervisor at boot time.
>>
>> Signed-off-by: Juergen Gross <jgross@...e.com>
>> Tested-by: Marek Marczykowski-Górecki <marmarek@...isiblethingslab.com>
>
> Reviewed-by: Jan Beulich <jbeulich@...e.com>
>
> I wonder though why ...
>
>> @@ -712,9 +713,9 @@ char * __init xen_memory_setup(void)
>> int op;
>>
>> xen_parse_512gb();
>> - max_pfn = xen_get_pages_limit();
>> - max_pfn = min(max_pfn, xen_start_info->nr_pages);
>> - mem_end = PFN_PHYS(max_pfn);
>> + ini_nr_pages = xen_get_pages_limit();
>> + ini_nr_pages = min(ini_nr_pages, xen_start_info->nr_pages);
>
> ... this can't be just
>
> ini_nr_pages = min(xen_get_pages_limit(), xen_start_info->nr_pages);
I just did a mechanical change for all uses of max_pfn.
I agree that your suggestion is an improvement, so I'll modify the
code.
Juergen
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3684 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists