[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z1Gri651igCkRVsx@gmail.com>
Date: Thu, 5 Dec 2024 14:32:59 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Mike Rapoport <rppt@...nel.org>
Cc: x86@...nel.org, Andy Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
Ning Sun <ning.sun@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
tboot-devel@...ts.sourceforge.net
Subject: Re: [PATCH 2/4] x86/boot: split kernel resources setup into a helper
function
* Mike Rapoport <rppt@...nel.org> wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@...nel.org>
>
> Makes setup_arch a bit easier to comprehend.
>
> No functional changes.
>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@...nel.org>
> ---
> arch/x86/kernel/setup.c | 36 ++++++++++++++++++++++--------------
> 1 file changed, 22 insertions(+), 14 deletions(-)
>
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index 2383e73fc140..d299fe5bda25 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -524,6 +524,23 @@ void __init reserve_standard_io_resources(void)
>
> }
>
> +static void __init setup_kernel_resources(void)
> +{
> + code_resource.start = __pa_symbol(_text);
> + code_resource.end = __pa_symbol(_etext)-1;
> + rodata_resource.start = __pa_symbol(__start_rodata);
> + rodata_resource.end = __pa_symbol(__end_rodata)-1;
> + data_resource.start = __pa_symbol(_sdata);
> + data_resource.end = __pa_symbol(_edata)-1;
> + bss_resource.start = __pa_symbol(__bss_start);
> + bss_resource.end = __pa_symbol(__bss_stop)-1;
> +
> + insert_resource(&iomem_resource, &code_resource);
> + insert_resource(&iomem_resource, &rodata_resource);
> + insert_resource(&iomem_resource, &data_resource);
> + insert_resource(&iomem_resource, &bss_resource);
> +}
> +
> static bool __init snb_gfx_workaround_needed(void)
> {
> #ifdef CONFIG_PCI
> @@ -842,15 +859,6 @@ void __init setup_arch(char **cmdline_p)
> root_mountflags &= ~MS_RDONLY;
> setup_initial_init_mm(_text, _etext, _edata, (void *)_brk_end);
>
> - code_resource.start = __pa_symbol(_text);
> - code_resource.end = __pa_symbol(_etext)-1;
> - rodata_resource.start = __pa_symbol(__start_rodata);
> - rodata_resource.end = __pa_symbol(__end_rodata)-1;
> - data_resource.start = __pa_symbol(_sdata);
> - data_resource.end = __pa_symbol(_edata)-1;
> - bss_resource.start = __pa_symbol(__bss_start);
> - bss_resource.end = __pa_symbol(__bss_stop)-1;
> -
> /*
> * x86_configure_nx() is called before parse_early_param() to detect
> * whether hardware doesn't support NX (so that the early EHCI debug
> @@ -894,11 +902,11 @@ void __init setup_arch(char **cmdline_p)
> tsc_early_init();
> x86_init.resources.probe_roms();
>
> - /* after parse_early_param, so could debug it */
> - insert_resource(&iomem_resource, &code_resource);
> - insert_resource(&iomem_resource, &rodata_resource);
> - insert_resource(&iomem_resource, &data_resource);
> - insert_resource(&iomem_resource, &bss_resource);
> + /*
> + * Add resources for kernel text and data to the iomem_resource
Missing full stop.
> + * Do it eafter parse_early_param, so could debug it
Typo...
Also, this sentence isn't proper English AFAICS.
Please do not submit write-only comments...
Thanks,
Ingo
Powered by blists - more mailing lists