From owner-freebsd-current@FreeBSD.ORG Mon Jun 6 19:00:26 2011 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 69AA2106566B; Mon, 6 Jun 2011 19:00:26 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0EBF98FC13; Mon, 6 Jun 2011 19:00:25 +0000 (UTC) Received: by gyg13 with SMTP id 13so2426201gyg.13 for ; Mon, 06 Jun 2011 12:00:25 -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=kqWo6dnnLu4TktKhBoGfv/wipcO6wAo2GOf/XGPTS3Q=; b=N7DjqiHuqRAlZqq9llK2+XfIay49cABMWd57Nc2/zr+Irpa3eyNvLvaZ4vXSVmtPiu OmygT4YpEyP5mWvtmnyN5908Av1MZTajJYruEzswx8jeUX3/HC2dAhUwlj2l/wubxrA2 suhF9L3uBiV7QOvlIyRlajA5d5wez6dp+X1cc= 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=PUGXD7CYRqBJK+2TLqNARG4BNpiyb3LUlZgu2PLy1pU1iYFcXWOUCsI0hvEosTcS4x 2uDjuwqXfncQcHnPrMRr7NbsGH9x6HWOSHsqHcfowVsKzZSMqzS0kP1pG90E4Xoh4bUX GEeyJX0e6EZcGJudn1qMv8rTF1ruDqG99+Guw= MIME-Version: 1.0 Received: by 10.151.122.11 with SMTP id z11mr4634210ybm.278.1307386825062; Mon, 06 Jun 2011 12:00:25 -0700 (PDT) Received: by 10.150.186.6 with HTTP; Mon, 6 Jun 2011 12:00:24 -0700 (PDT) In-Reply-To: <201105312003.29931.jkim@FreeBSD.org> References: <201105311650.16164.jkim@FreeBSD.org> <201105312003.29931.jkim@FreeBSD.org> Date: Mon, 6 Jun 2011 12:00:24 -0700 Message-ID: From: Xin LI To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "George V. Neville-Neil" , freebsd-current@freebsd.org, Johannes Dieterich Subject: Re: Boot halts on Thinkpad X220 (Sandy Bridge) 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: Mon, 06 Jun 2011 19:00:26 -0000 On Tue, May 31, 2011 at 5:03 PM, Jung-uk Kim wrote: [...] > I found something strange about this BIOS (well, if we can call it > that). =C2=A0Please try this: > > Index: sys/dev/atkbdc/atkbd.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/atkbdc/atkbd.c =C2=A0 =C2=A0 =C2=A0(revision 222550) > +++ sys/dev/atkbdc/atkbd.c =C2=A0 =C2=A0 =C2=A0(working copy) > @@ -1100,7 +1100,8 @@ get_typematic(keyboard_t *kbd) > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!(kbd->kb_config & KB_CONF_PROBE_TYPEMATIC= )) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (ENODEV); > > - =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) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (ENODEV); > > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Is BIOS system configuration table supporte= d? */ > > You must re-enable typematic probing from loader to test it, of > course. =C2=A0I think the following line should do: > > hint.atkbd.0.flags=3D"0x10" > > Note: You may add printf() before and after the check to make sure it > is being called (and it fails immediately). > > A long answer goes like this. =C2=A0INT 0x15 and 0x16 vectors have fixed > entry points in *real* BIOS, i.e., 0xf000:0xf859 and 0xf000:0xe82e. > For this BIOS (or CSM), INT 0x16 vector is correct but INT 0x15 > vector is not (0xf000:0xb4f1). =C2=A0Funny thing is 0xf000:0xf859 actuall= y > points to a working INT 15h handler, it seems, which confused me > totally. =C2=A0Probably it was done like this because (U)EFI CSM spec. > mandated it to be located @ 0xf000:0xf859. =C2=A0If we follow the > interrupt vector (0xf000:0xb4f1), it gets nowhere (or jumps to an > unknown external interrupt handler). =C2=A0If we follow the fixed address= , > it will exit gracefully. =C2=A0So, actually there are two possible > solutions, i.e., 1) check whether the interrupt vector is modified > (the above patch), or 2) jump directly to the fixed interrupt entry > point. =C2=A0I chose Option #1 because it is very hard to find BIOS > typematic support these days (as you pointed out). Sorry for the delay. I finally got a copy of (U)EFI spec and found the requirement of fixed entry there. Option #1 sounds like a good idea to me too (if the "BIOS" can break one rule, it can also break more). Could you please commit the change (maybe revert mine before that?) and merge it back to -STABLE? Thanks for your time on investigating this! Cheers, --=20 Xin LI http://www.delphij.net