From owner-freebsd-current@FreeBSD.ORG Wed Nov 18 14:25:45 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 501161065676 for ; Wed, 18 Nov 2009 14:25:45 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8270C8FC19 for ; Wed, 18 Nov 2009 14:25:44 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA09297; Wed, 18 Nov 2009 16:25:20 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <4B0403D0.3090101@icyb.net.ua> Date: Wed, 18 Nov 2009 16:25:20 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Kai Gallasch , "S.N.Grigoriev" 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> In-Reply-To: <20091117165304.01676555@orwell.free.de> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 14:25:45 -0000 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 Gapon