From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Dom0 crash with old style AMD NUMA detection Date: Mon, 17 Sep 2012 15:14:33 -0400 Message-ID: <20120917191432.GA18552@phenom.dumpdata.com> References: <501BC20F.3040205@amd.com> <20120803123628.GB10670@andromeda.dapyr.net> <20120817142237.GA8467@phenom.dumpdata.com> <20120914185822.GA7495@phenom.dumpdata.com> <5056D152.2090708@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5056D152.2090708@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andre Przywara Cc: Konrad Rzeszutek Wilk , Jeremy Fitzhardinge , xen-devel , Dario Faggioli , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Mon, Sep 17, 2012 at 09:29:22AM +0200, Andre Przywara wrote: > On 09/14/2012 08:58 PM, Konrad Rzeszutek Wilk wrote: > >>>>[ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task! > >>>>(XEN) Domain 0 crashed: 'noreboot' set - not rebooting. > >>>> > >>>> > >>>> > >>>>The obvious solution would be to explicitly deny northbridge scanning > >>>>when running as Dom0, though I am not sure how to implement this without > >>>>upsetting the other kernel folks about "that crappy Xen thing" again ;-) > >>> > >>>Heh. > >>>Is there a numa=0 option that could be used to override it to turn it > >>>off? > >> > >>Not compile tested.. but was thinking something like this: > > > >ping? > > That looks good to me - at least for the time being. OK, can I've your Tested-by/Acked-by on it pls? > I just want to check how this interacts with upcoming Dom0 NUMA > support. It wouldn't be too clever if we deliberately disable NUMA We can always revert this patch in future versions of Linux. > and future Xen version will allow us to use it. So let me check if I > can confine this turn-off to the fallback K8 northbridge reading. This potentially could work, but I would prefer to not do it for 3.6. diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index a4790bf..b4edce4 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -483,7 +484,32 @@ void __cpuinit xen_enable_sysenter(void) if(ret != 0) setup_clear_cpu_cap(sysenter_feature); } +#ifdef CONFIG_AMD_NUMA +int __cpuinit xen_amd_k8(void) +{ + int num; + + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) + return -ENOENT; + + for (num = 0; num < 32; num++) { + u32 header; + + header = read_pci_config(0, num, 0, 0x00); + if (header != (PCI_VENDOR_ID_AMD | (0x1100<<16)) && + header != (PCI_VENDOR_ID_AMD | (0x1200<<16)) && + header != (PCI_VENDOR_ID_AMD | (0x1300<<16))) + continue; + header = read_pci_config(0, num, 1, 0x00); + if (header != (PCI_VENDOR_ID_AMD | (0x1101<<16)) && + header != (PCI_VENDOR_ID_AMD | (0x1201<<16)) && + header != (PCI_VENDOR_ID_AMD | (0x1301<<16))) + continue; + return num; + } + return -ENOENT; +#endif void __cpuinit xen_enable_syscall(void) { #ifdef CONFIG_X86_64 @@ -542,4 +568,8 @@ void __init xen_arch_setup(void) disable_cpufreq(); WARN_ON(set_pm_idle_to_default()); fiddle_vdso(); +#ifdef CONFIG_AMD_NUMA + if (xen_amd_k8() >= 0) + numa_off=1; +#endif }