lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b9556863-1536-4310-8005-f92e8948356c@suse.com>
Date: Tue, 20 Aug 2024 10:44:55 +0200
From: Jan Beulich <jbeulich@...e.com>
To: Juergen Gross <jgross@...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.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);

Jan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ