[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161003222254.GA13651@krava>
Date: Tue, 4 Oct 2016 00:22:54 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Prarit Bhargava <prarit@...hat.com>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Peter Zijlstra <peterz@...radead.org>,
Len Brown <len.brown@...el.com>, Borislav Petkov <bp@...e.de>,
Andi Kleen <ak@...ux.intel.com>,
Juergen Gross <jgross@...e.com>, dyoung@...hat.com,
Eric Biederman <ebiederm@...ssion.com>,
kexec@...ts.infradead.org
Subject: Re: [PATCH] arch/x86: Fix kdump on x86 with physically hotadded CPUs
On Mon, Oct 03, 2016 at 01:07:12PM -0400, Prarit Bhargava wrote:
SNIP
>
> This patch adds the missing generic_processor_info() to
> prefill_possible_map() to ensure the initialization of the boot cpu is
> correct. This results in smp_init_package_map() having correct data and
> properly setting the package map for the hotplugged boot cpu, which in
> turn resolves the kdump kernel panic on physically hotplugged cpus.
>
> [1] This can be simulated in a KVM environment by hot adding a CPU and
> using taskset to force the dump on the newly added CPU.
> [2] prefill_possible_map() is called before smp_store_boot_cpu_info().
> The comment beside the call to smp_store_boot_cpu_info() states that the
> completed call results in "Final full version of the data".
>
> Signed-off-by: Prarit Bhargava <prarit@...hat.com>
> Fixes: 1f12e32f4cd5 ("x86/topology: Create logical package id")
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: x86@...nel.org
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Len Brown <len.brown@...el.com>
> Cc: Borislav Petkov <bp@...e.de>
> Cc: Andi Kleen <ak@...ux.intel.com>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Juergen Gross <jgross@...e.com>
> Cc: dyoung@...hat.com
> Cc: Eric Biederman <ebiederm@...ssion.com>
> Cc: kexec@...ts.infradead.org
Reviewed-by: Jiri Olsa <jolsa@...hat.com>
thanks,
jirka
> ---
> arch/x86/kernel/smpboot.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 4296beb8fdd3..d1272febc13b 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -1406,9 +1406,18 @@ __init void prefill_possible_map(void)
> {
> int i, possible;
>
> - /* no processor from mptable or madt */
> - if (!num_processors)
> - num_processors = 1;
> + /* No boot processor was found in mptable or ACPI MADT */
> + if (!num_processors) {
> + /* Make sure boot cpu is enumerated */
> + if (apic->cpu_present_to_apicid(0) == BAD_APICID &&
> + apic->apic_id_valid(boot_cpu_physical_apicid))
> + generic_processor_info(boot_cpu_physical_apicid,
> + apic_version[boot_cpu_physical_apicid]);
> + if (!num_processors) {
> + pr_warn("CPU 0 not enumerated in mptable or ACPI MADT\n");
> + num_processors = 1;
> + }
> + }
>
> i = setup_max_cpus ?: 1;
> if (setup_possible_cpus == -1) {
> --
> 1.7.9.3
>
Powered by blists - more mailing lists