[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1711101354460.1923@nanos>
Date: Fri, 10 Nov 2017 13:56:32 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Prarit Bhargava <prarit@...hat.com>
cc: linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Peter Zijlstra <peterz@...radead.org>,
Dave Hansen <dave.hansen@...el.com>,
Piotr Luc <piotr.luc@...el.com>,
Kan Liang <kan.liang@...el.com>, Borislav Petkov <bp@...e.de>,
Stephane Eranian <eranian@...gle.com>,
Arvind Yadav <arvind.yadav.cs@...il.com>,
Andy Lutomirski <luto@...nel.org>,
Christian Borntraeger <borntraeger@...ibm.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Tom Lendacky <thomas.lendacky@....com>,
He Chen <he.chen@...ux.intel.com>,
Mathias Krause <minipli@...glemail.com>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>
Subject: Re: [PATCH v5 2/3] x86/topology: Avoid wasting 128k for package id
array
On Fri, 10 Nov 2017, Thomas Gleixner wrote:
> On Fri, 10 Nov 2017, Prarit Bhargava wrote:
> > On 11/09/2017 07:43 PM, Thomas Gleixner wrote:
> > > On Sun, 5 Nov 2017, Prarit Bhargava wrote:
> > >> [v5]: Change kmalloc to GFP_ATOMIC to fix "sleeping function" warning on
> > >> virtual machines.
> > >
> > > What has this to do with virtual machines? The very same issue is on
> > > physcial hardware because this is called from the early CPU bringup code
> > > with interrupts and preemption disabled.
> >
> > There was a Intel test bot report of a failure during boot on virtual systems
> > with Andi's patch.
>
> Sure, but the problem has nothing to do with virtual machines at all.
The same is true for the KASAN report of out of bound access:
new = logical_packages++;
- if (new != pkg) {
- pr_info("CPU %u Converting physical %u to logical package %u\n",
- cpu, pkg, new);
+
+ /* Allocate and copy a new array */
+ ltp_pkg_map_new = kmalloc(logical_packages * sizeof(u16), GFP_KERNEL);
+ BUG_ON(!ltp_pkg_map_new);
+ if (logical_to_physical_pkg_map) {
+ memcpy(ltp_pkg_map_new, logical_to_physical_pkg_map,
+ logical_packages * sizeof(u16));
That's caused by incrementing logical_packages _before_ the memcpy(), but
the old array is one u16 shorter than the newly allocated.
That's reported on a VM as well, but is a genuine code bug.
Thanks,
tglx
Powered by blists - more mailing lists