From owner-freebsd-current@FreeBSD.ORG Sun Apr 12 17:30:54 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 6E523106566C for ; Sun, 12 Apr 2009 17:30:54 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-ew0-f171.google.com (mail-ew0-f171.google.com [209.85.219.171]) by mx1.freebsd.org (Postfix) with ESMTP id CBC318FC14 for ; Sun, 12 Apr 2009 17:30:53 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by ewy19 with SMTP id 19so1706158ewy.43 for ; Sun, 12 Apr 2009 10:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=DhFoGv+AEGyTEfqUCuiqUfghh3WnV3y7PxuoMi4oRxg=; b=BRMyoa1JHy02lHsXcWPPqVl7QpKlbPwTBPBa4U32BO+lRWrZfnn0QnGLMQ2ZpKPsVw xDjugARzX9sr9DasppoIFdP0caIdJF07uzb8rWejya8a/kT+rMga+q65XRL/LDr+NxO2 ag9NK2tN52RxtTmP11bLR23ppLe3X7PTbJZlI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=JE+1qAu9YhbEzTJAp+79RxRvB4pg1EnkU9v74FpZavoadCj3Hy/SAEcfQGyQyZ2tNO xBzPOsEtA6P84li/+HH2cDt1bvd0ceQAKCJ/ivcCCIGbKCVQasR/+6aMvzEOeN8/xSTw HVhjNk6Lts9QoC//7XYw+nsHPSF2JwbYH+OVo= MIME-Version: 1.0 Sender: maksim.yevmenkin@gmail.com Received: by 10.216.46.79 with SMTP id q57mr1324435web.212.1239555635089; Sun, 12 Apr 2009 10:00:35 -0700 (PDT) In-Reply-To: <20090412170335.5a8a3169@fabiankeil.de> References: <200904082052.n38KqU9p075633@svn.freebsd.org> <20090412170335.5a8a3169@fabiankeil.de> Date: Sun, 12 Apr 2009 10:00:35 -0700 X-Google-Sender-Auth: 8744dcb1db07f36d Message-ID: From: Maksim Yevmenkin To: Fabian Keil Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: svn commit: r190857 - head/sys/dev/kbdmux 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: Sun, 12 Apr 2009 17:30:54 -0000 On Sun, Apr 12, 2009 at 8:03 AM, Fabian Keil wrote: > Maksim Yevmenkin wrote: > >> Author: emax >> Date: Wed Apr =A08 20:52:30 2009 >> New Revision: 190857 >> URL: http://svn.freebsd.org/changeset/base/190857 >> >> Log: >> =A0 Undo SVN rev 183283 >> >> =A0 Do not use Giant for kbdmux(4) locking. This is wrong and apparently >> =A0 causing more problems than it solves. This will re-open the issue >> =A0 where interrupt handlers may race with kbdmux(4) in polling mode. >> =A0 Typical symptoms include (but not limited to) duplicated and/or >> =A0 missing characters when low level console functions (such as gets) >> =A0 are used while interrupts are enabled (for example geli password >> =A0 prompt, mountroot prompt etc.) >> >> =A0 MFC after: =A03 days >> >> Modified: >> =A0 head/sys/dev/kbdmux/kbdmux.c [...] > How about turning this into a compile-time or sysctl option > or at least mentioning the change in /usr/src/UPDATING? i do not believe that compile-time nor sysctl option is the right choice here as it is never allowed to use locks in low-level keyboard drivers. entry in UPDATING is probably a good idea. > With this commit, providing the geli key phrase on > boot is impossible on my AMD64 dual core system. right, i really hate to say this, but the amount of bug reports, lor's etc.that were submitted after this change is far more (imo) than amount of people that ran relatively uncommon setup with encrypted root (which, btw, prompted the original commit). of course, there is no question, it has to be fixed. > Not even enabling the "visible characters" option helps > because obviously backspace is broken too. if you do not need kbdmix(4) you might just want to disable it on your system. i think it should help with your particular problem. > Before theses locks were introduces I worked around the problem > with this gets() hack (which forced me to reduce the key entropy): > http://www.fabiankeil.de/sourcecode/freebsd/gets-no-duplicates.diff > and now I will simply revert your commit locally, but I assume I'm > not the only geli user who prefers to be able to boot the system > without local patches. if your primary keyboard is atkbd(4), you might want to try the following patch. it is completely untested (i did not even compile it), so be warned ... Index: 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 --- atkbd.c (revision 190905) +++ atkbd.c (working copy) @@ -476,7 +476,7 @@ static int atkbd_intr(keyboard_t *kbd, void *arg) { - atkbd_state_t *state; + atkbd_state_t *state =3D (atkbd_state_t *)kbd->kb_data; int delay[2]; int c; @@ -485,7 +485,6 @@ * The keyboard was not detected before; * it must have been reconnected! */ - state =3D (atkbd_state_t *)kbd->kb_data; init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config); KBD_FOUND_DEVICE(kbd); @@ -497,6 +496,9 @@ } if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) { + if (state->ks_polling) + return 0; + /* let the callback function to process the input */ (*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT, kbd->kb_callback.kc_arg); thanks, max