From owner-freebsd-stable@FreeBSD.ORG Tue Feb 23 17:30:06 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5034F106568B; Tue, 23 Feb 2010 17:30:06 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 0014D8FC12; Tue, 23 Feb 2010 17:30:05 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 94EC12C2C59; Tue, 23 Feb 2010 11:30:05 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id i8ZQ99ceqq94; Tue, 23 Feb 2010 11:29:57 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 4CE752C2AD0; Tue, 23 Feb 2010 11:29:57 -0600 (CST) Message-ID: <4B841093.2000402@cs.rice.edu> Date: Tue, 23 Feb 2010 11:29:55 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.23 (X11/20100102) MIME-Version: 1.0 To: freebsd-stable@freebsd.org References: <4B72D94A.8030509@icyb.net.ua> <4B72E93C.80102@icyb.net.ua> <9bbcef731002101003r203f5189xf139700a0d48afa0@mail.gmail.com> <4B72F67F.4000209@icyb.net.ua> <9bbcef731002101026k5007075cqf97fc80404ac3fa7@mail.gmail.com> <4B72FC55.2090508@icyb.net.ua> <9bbcef731002101038r1ac04141t505216816489376f@mail.gmail.com> <20100210184623.GA78851@icarus.home.lan> <4B741B7D.1030306@icyb.net.ua> <4B744EB2.3070108@cs.rice.edu> In-Reply-To: <4B744EB2.3070108@cs.rice.edu> Content-Type: multipart/mixed; boundary="------------000801090609000506030801" Cc: alc@freebsd.org, Andriy Gapon , Jeremy Chadwick , Ivan Voras Subject: Re: Strange problem with 8-stable, VMWare vSphere 4 & AMD CPUs (unexpected shutdowns) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 17:30:06 -0000 This is a multi-part message in MIME format. --------------000801090609000506030801 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Alan Cox wrote: > The next public revision guide from AMD will contain an errata (383) > that documents the bug. However, it doesn't really tell us anything > that we didn't already know. Could someone on this list please test the attached patch in an amd64 FreeBSD 8 guest running on vSphere 4 with an AMD Family 10h processor underneath? Before testing the patch, remove the manual setting of vm.pmap.pg_ps_enabled="0" from /boot/loader.conf. After booting the virtual machine, please run "sysctl vm.pmap.pg_ps_enabled" to verify that superpage promotion has been automatically disabled. Thanks, Alan --------------000801090609000506030801 Content-Type: text/plain; name="vm_guest.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="vm_guest.patch" Index: amd64/amd64/pmap.c =================================================================== --- amd64/amd64/pmap.c (revision 204175) +++ amd64/amd64/pmap.c (working copy) @@ -686,6 +686,15 @@ pmap_init(void) pv_entry_high_water = 9 * (pv_entry_max / 10); /* + * Disable large page mappings by default if the kernel is running in + * a virtual machine on an AMD Family 10h processor. This is a work- + * around for Erratum 383. + */ + if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x10) + pg_ps_enabled = 0; + + /* * Are large page mappings enabled? */ TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled); Index: kern/subr_param.c =================================================================== --- kern/subr_param.c (revision 204175) +++ kern/subr_param.c (working copy) @@ -74,10 +74,6 @@ __FBSDID("$FreeBSD$"); #define MAXFILES (maxproc * 2) #endif -/* Values of enum VM_GUEST members are used as indices in - * vm_guest_sysctl_names */ -enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; - static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS); int hz; Index: sys/systm.h =================================================================== --- sys/systm.h (revision 204175) +++ sys/systm.h (working copy) @@ -45,6 +45,10 @@ #include #include /* for people using printf mainly */ +/* Values of enum VM_GUEST members are used as indices in + * vm_guest_sysctl_names */ +enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; + extern int cold; /* nonzero if we are doing a cold boot */ extern int rebooting; /* boot() has been called. */ extern const char *panicstr; /* panic message */ @@ -63,6 +67,7 @@ extern int bootverbose; /* nonzero to print verbo extern int maxusers; /* system tune hint */ extern int ngroups_max; /* max # of supplemental groups */ +extern int vm_guest; /* Running as virtual machine guest? */ #ifdef INVARIANTS /* The option is always available */ #define KASSERT(exp,msg) do { \ --------------000801090609000506030801--