Re: [v4.6-rc1 Regression] x86/topology: Create logical package id

From: Ingo Molnar
Date: Sat May 07 2016 - 01:16:24 EST



* Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:

> > I was hoping to get your feedback, since you are the patch author. Do
> > you think gathering any additional data will help diagnose this issue,
> > or would it be best to submit a revert request?
>
> Yuck. That dies with a divide error. And that looks like XEN is supplying crap
> data in the CPUID.
>
> Does the patch below cure the issue?
>
> Thanks,
>
> tglx
>
> 8<---------------
>
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -332,6 +332,11 @@ static void __init smp_init_package_map(
> * primary cores.
> */
> ncpus = boot_cpu_data.x86_max_cores;
> + if (!ncpus) {
> + pr_warn("x86_max_cores == zero !?!?");
> + ncpus = 1;
> + }
> +

Even if the underlying Xen bug is fixed, I think we should add this protective
measure to defend against future CPUID mishaps.

Thanks,

Ingo