From owner-freebsd-current@FreeBSD.ORG Wed Nov 18 17:59:36 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E51B106568F for ; Wed, 18 Nov 2009 17:59:36 +0000 (UTC) (envelope-from serguey-grigoriev@yandex.ru) Received: from forward7.mail.yandex.net (forward7.mail.yandex.net [77.88.61.37]) by mx1.freebsd.org (Postfix) with ESMTP id E8C9B8FC12 for ; Wed, 18 Nov 2009 17:59:35 +0000 (UTC) Received: from webmail63.yandex.ru (webmail63.yandex.ru [77.88.61.8]) by forward7.mail.yandex.net (Yandex) with ESMTP id 583D731011E; Wed, 18 Nov 2009 20:59:34 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by webmail63.yandex.ru (Yandex) with ESMTP id E2101D5402B; Wed, 18 Nov 2009 20:59:33 +0300 (MSK) X-Yandex-Spam: 1 X-Yandex-Front: webmail63 X-Yandex-TimeMark: 1258567173 Received: from [89.223.19.70] ([89.223.19.70]) by mail.yandex.ru with HTTP; Wed, 18 Nov 2009 20:59:33 +0300 From: S.N.Grigoriev To: Andriy Gapon In-Reply-To: <4B0403D0.3090101@icyb.net.ua> References: <1031257439203@webmail57.yandex.ru> <941257966918@webmail42.yandex.ru> <200911111504.14906.jhb@freebsd.org> <20091112195932.5875387e@orwell.free.de> <4AFD140D.7010407@icyb.net.ua> <20091113144804.2c0fb90f@orwell.free.de> <4AFD655E.5020801@icyb.net.ua> <20091114022121.217dd831@orwell.free.de> <4AFE7A32.7060203@icyb.net.ua> <4B025FA9.7020003@icyb.net.ua> <20091117165304.01676555@orwell.free.de> <4B0403D0.3090101@icyb.net.ua> MIME-Version: 1.0 Message-Id: <9461258567173@webmail63.yandex.ru> Date: Wed, 18 Nov 2009 20:59:33 +0300 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain Cc: freebsd-current@freebsd.org Subject: Re: 8.0RC2 amd64 - kernel panic running make buildworld X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2009 17:59:36 -0000 18.11.09, 16:25, "Andriy Gapon" wrote: > Kai, Serguey, > thank you very much for the testing! > This has been an invaluable help. > I am now trying to narrow down possible causes of the issue and to come up with > the most efficient patch. > If/when you have a chance could you please test the following changes? > The patches are against mainline source tree (that is, not against previous > patch(es)). > So, please first try *only* this patch: > diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c > index 44b71f3..33b8c2a 100644 > --- a/sys/amd64/amd64/pmap.c > +++ b/sys/amd64/amd64/pmap.c > @@ -2981,6 +2981,7 @@ setpte: > * Map the superpage. > */ > pde_store(pde, PG_PS | newpde); > + pmap_invalidate_range(pmap, trunc_2mpage(va), trunc_2mpage(va) + NBPDR); > pmap_pde_promotions++; > CTR2(KTR_PMAP, "pmap_promote_pde: success for va %#lx" > Most likely this will fix the buildworld scenario. > But I am not sure if it will fix ZFS scenario. > If it does - then great, if not, please apply the following patch in addition to > the previous one and test again: > diff --git a/sys/amd64/amd64/mca.c b/sys/amd64/amd64/mca.c > index d291d00..d6547a3 100644 > --- a/sys/amd64/amd64/mca.c > +++ b/sys/amd64/amd64/mca.c > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -465,6 +466,8 @@ void > mca_init(void) > { > uint64_t mcg_cap; > + uint64_t ctl; > + int skip; > int i; > /* MCE is required. */ > @@ -482,14 +485,22 @@ mca_init(void) > wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); > for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { > - /* > - * Enable logging of all errors. For P6 > - * processors, MC0_CTL is always enabled. > - * > - * XXX: Better CPU test needed here? > - */ > - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) > - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); > + /* By default enable logging of all errors. */ > + ctl = 0xffffffffffffffffUL; > + skip = 0; > + if (cpu_vendor_id == CPU_VENDOR_INTEL) { > + /* For P6 MC0_CTL is always enabled. */ > + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6) > + skip = 1; > + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { > + /* BKDG for Family 10h: unset GartTblWkEn. */ > + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) { > + ctl &= ~(1UL << 10); > + } > + } > + > + if (!skip) > + wrmsr(MSR_MC_CTL(i), ctl); > /* Clear all errors. */ > wrmsr(MSR_MC_STATUS(i), 0); Andriy, I've successfully tested the first patch above with 'make -j8 buildworld'. -- Regards, S.Grigoriev.