[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9fb55ad9-a69f-bcc3-9e57-d90df5257726@linux.intel.com>
Date: Thu, 17 May 2018 10:52:30 -0700
From: Dave Hansen <dave.hansen@...ux.intel.com>
To: Adrian Hunter <adrian.hunter@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, Andi Kleen <ak@...ux.intel.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Joerg Roedel <joro@...tes.org>, Jiri Olsa <jolsa@...hat.com>,
linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH V2 03/20] x86: Add entry trampolines to kcore
On 05/17/2018 02:21 AM, Adrian Hunter wrote:
> From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
>
> Signed-off-by: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
For the benefit of the poor souls looking at this code in the decades to
come, could you please take a few minutes to write a couple of sentences
about why this is being done?
> diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c
> index d1da5cf4b2de..fb1fbc8538fa 100644
> --- a/arch/x86/mm/cpu_entry_area.c
> +++ b/arch/x86/mm/cpu_entry_area.c
> @@ -3,6 +3,7 @@
> #include <linux/spinlock.h>
> #include <linux/percpu.h>
> #include <linux/kallsyms.h>
> +#include <linux/kcore.h>
>
> #include <asm/cpu_entry_area.h>
> #include <asm/pgtable.h>
> @@ -14,6 +15,7 @@
> #ifdef CONFIG_X86_64
> static DEFINE_PER_CPU_PAGE_ALIGNED(char, exception_stacks
> [(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + DEBUG_STKSZ]);
> +static DEFINE_PER_CPU(struct kcore_list, kcore_entry_trampoline);
> #endif
>
> struct cpu_entry_area *get_cpu_entry_area(int cpu)
> @@ -147,6 +149,9 @@ static void __init setup_cpu_entry_area(int cpu)
>
> cea_set_pte(&get_cpu_entry_area(cpu)->entry_trampoline,
> __pa_symbol(_entry_trampoline), PAGE_KERNEL_RX);
> + kclist_add(&per_cpu(kcore_entry_trampoline, cpu),
> + &get_cpu_entry_area(cpu)->entry_trampoline, PAGE_SIZE,
> + KCORE_TEXT);
> #endif
Any reason not to add a comment like:
/*
* The cpu_entry_area alias addresses are not in the kernel binary
* so they do not show up in /proc/kcore normally. This adds entries
* for them manually.
*/
Powered by blists - more mailing lists