From owner-freebsd-stable@FreeBSD.ORG Sat Jun 11 00:15:14 2011 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 69450106566C for ; Sat, 11 Jun 2011 00:15:14 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1DFAA8FC08 for ; Sat, 11 Jun 2011 00:15:13 +0000 (UTC) Received: by vxc34 with SMTP id 34so3720729vxc.13 for ; Fri, 10 Jun 2011 17:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=GO9gVdwFOnYQwVHyLJBAhn7IRl3XAdDLCFgLdmRPBmU=; b=EN/ekYWYC3dSo4H2F/gxjwoM1Zx8m8zQJgudhSrUER67wxg3Pv39VS4GsUN35hThZO gxVVGBEikUzMy1+8kurDepz2cSqeUGJpK5NNfFI0xDq/eELsDvnqkYPferN7IozNs73n uowtPR8my39Q+YNiLlmYPfkp9gD3FW52tCzZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=WuEZwULr6YOhRiogoaJIuDJOjYYpLzuiakbaefJZr1ZVlspZB2M75lyDDO5Y8NQ3xT 8Qyb5ijWp/QxzaqLgDmR0qOXTA3BQuB7UEGlG+Q/W+UrMKo9GyQNObDdY5B5Z0HsA383 oIKSJNT6pDyRCcqsFgKOrM6pluTlxuYO0tE7E= MIME-Version: 1.0 Received: by 10.52.97.33 with SMTP id dx1mr766243vdb.34.1307749711981; Fri, 10 Jun 2011 16:48:31 -0700 (PDT) Received: by 10.52.108.132 with HTTP; Fri, 10 Jun 2011 16:48:31 -0700 (PDT) In-Reply-To: <20110610234227.GA54846@icarus.home.lan> References: <20110610221525.A1C791CC0B@ptavv.es.net> <4DF2A5AC.6070804@delphij.net> <20110610234227.GA54846@icarus.home.lan> Date: Fri, 10 Jun 2011 16:48:31 -0700 Message-ID: From: Xin LI To: Jeremy Chadwick Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-stable@freebsd.org Subject: Re: Unable to boot Lenovo T520 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: Sat, 11 Jun 2011 00:15:14 -0000 On Fri, Jun 10, 2011 at 4:42 PM, Jeremy Chadwick wrote: > On Fri, Jun 10, 2011 at 04:15:56PM -0700, Xin LI wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA256 >> >> On 06/10/11 15:15, Kevin Oberman wrote: >> > I am hitting the problem reported some time ago with atkbd and svn >> > 197392. >> > >> > It's not clear that this has ben finally resolved, but I am still >> > hitting it with -stable on my new T520. I really want to get FreeBSD u= p >> > on it, but I am dead in the water at this time. I guess I'll have to >> > build a new kernel with any fix and replace the kernel in the ISO. >> > >> > Also, I am hoping to use it on an amd64 kernel and I am even less sure >> > that any patch will work on that arch. >> > >> > The original thread was >> > http://freebsd.1045724.n5.nabble.com/svn-rev-197392-hangs-during-boot-= td3926276.html >> >> The fix was not (yet) merged back to 8-STABLE. =C2=A0You may use a >> 8.0-RELEASE kernel to boot the system temporarily and apply this patch: >> >> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/atkbdc/atkbd.c.diff?r1= =3D1.63;r2=3D1.64 >> >> (If hunk #1 fails to apply, it's Ok to just ignore it). > > Specifically: > > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/atkbdc/atkbd.c#rev1.64 > > - =C2=A0 =C2=A0 =C2=A0 if (x86bios_get_intr(0x15) =3D=3D 0 || x86bios_get= _intr(0x16) =3D=3D 0) > + =C2=A0 =C2=A0 =C2=A0 if (x86bios_get_intr(0x15) !=3D 0xf000f859 || > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 x86bios_get_intr(0x16) !=3D 0xf000e8= 2e) > > What are these magic numbers? =C2=A0Where did they come from? =C2=A0What = do they > represent? =C2=A0Why are they not documented in the source code/commit > itself? =C2=A0No offence, but this is an open-source project; anyone look= ing > at this code isn't going to know what those vectors represent. =C2=A0The > commit message is also lacking (again: magic values not mentioned), and > expecting a developer to dig through commits/annotations to determine > what this piece of code is for is unreasonable. > > No I'm not in a bad mood (honest!), I just find this kind of thing > infuriating the more I dig through kernel source code. The commit log explicitly say: Validate INT 15h and 16h vectors more strictly. Traditionally these entry points are fixed addresses and (U)EFI CSM specification also mandated that. Unfortunately, (U)EFI CSM specification does not specifically mention this is to call service routine via interrupt vector table or to jump directly to the entry point. As a result, some CSM seems to install two routines and acts differently, depending on how it was executed, unfortunately. When INT 15h is used, it calls a function pointer (which is probably a UEFI service function). When it jumps directly to the entry point, it executes a simple and traditional INT 15h service routine. Therefore, actually ther= e are two possible fixes, i. e., this fix or jumping directly to the fixed entry point. However, we chose this fix because a) keyboard typematic support via BIOS is becoming extremely rarer and b) we cannot support rando= m service routine installed by a firmware or a boot loader. This should fix Lenovo X220 laptop, specifically. Be reasonable, please. Cheers, --=20 Xin LI http://www.delphij.net