Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Nov 2012 16:33:20 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Joel Dahl <joel@freebsd.org>
Cc:        current@freebsd.org, Andriy Gapon <avg@freebsd.org>
Subject:   Re: Reboot during startup with recent head
Message-ID:  <20121108143320.GV73505@kib.kiev.ua>
In-Reply-To: <20121108122313.GB91783@jd.benders.se>
References:  <20121108084523.GW1092@jd.benders.se> <509B8F9E.9040502@FreeBSD.org> <20121108122313.GB91783@jd.benders.se>

next in thread | previous in thread | raw e-mail | index | archive | help

--aObFJ3I/fcifeQec
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 08, 2012 at 01:23:13PM +0100, Joel Dahl wrote:
> On 08-11-2012 12:55, Andriy Gapon wrote:
> > on 08/11/2012 10:45 Joel Dahl said the following:
> > > Hi,
> > >=20
> > > I rebuilt head (r242605) in a VMware virtual machine a couple of days=
 ago, and
> > > now it won't boot anymore. The loader menu appears, the countdown sta=
rts, and boom,
> > > reboot. I tried a fresh head (r242700) but the problem remains.
> > >=20
> > > Going back to r242205 solves the problem, so this was introduced some=
where
> > > between r242205 and r242605.
> > >=20
> > > I managed to record the entire thing with my phone before I had to le=
ave for
> > > work today. You can see it here:
> > >=20
> > >   http://mirror.vnode.se/upload/head-reboots.mov
> > >=20
> > > Any ideas? Any specific revision I should try to back out?
> > >=20
> >=20
> > Rather wild guess - try to back out the recent SMEP commit.
>=20
> Well, it was a good guess. :-) I backed out revision 242433, rebuilt the =
kernel,
> and now it boots again.

The following patch should allow you to boot. Please show me the verbose dm=
esg
of the boot with the patch applied.

diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 06b45b2..7846194 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -598,6 +598,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
 {
 	vm_offset_t va;
 	pt_entry_t *pte, *unused;
+	int smep_enable;
=20
 	/*
 	 * Create an initial set of page tables to run the kernel in.
@@ -613,8 +614,16 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
 	/* XXX do %cr0 as well */
 	load_cr4(rcr4() | CR4_PGE | CR4_PSE);
 	load_cr3(KPML4phys);
-	if (cpu_stdext_feature & CPUID_STDEXT_SMEP)
-		load_cr4(rcr4() | CR4_SMEP);
+	if (cpu_stdext_feature & CPUID_STDEXT_SMEP) {
+		smep_enable =3D 0;
+		TUNABLE_INT_FETCH("hw.smep_enable", &smep_enable);
+		if (smep_enable)
+			load_cr4(rcr4() | CR4_SMEP);
+		else {
+			cpu_stdext_feature &=3D ~CPUID_STDEXT_SMEP;
+			printf("SMEP: disabled\n");
+		}
+	}
=20
 	/*
 	 * Initialize the kernel pmap (which is statically allocated).

--aObFJ3I/fcifeQec
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlCbwrAACgkQC3+MBN1Mb4io7QCg2deFNfZAtY3kwHCMAyYru9cr
1CAAnAkrgJ+frvdHcxlLowezhNG4o4Dt
=QuUk
-----END PGP SIGNATURE-----

--aObFJ3I/fcifeQec--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121108143320.GV73505>