Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Apr 2009 17:03:35 +0200
From:      Fabian Keil <freebsd-listen@fabiankeil.de>
To:        Maksim Yevmenkin <emax@FreeBSD.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: svn commit: r190857 - head/sys/dev/kbdmux
Message-ID:  <20090412170335.5a8a3169@fabiankeil.de>
In-Reply-To: <200904082052.n38KqU9p075633@svn.freebsd.org>
References:  <200904082052.n38KqU9p075633@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/XF.egAMdjwX/4xA+pOVvpeE
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Maksim Yevmenkin <emax@FreeBSD.org> wrote:

> Author: emax
> Date: Wed Apr  8 20:52:30 2009
> New Revision: 190857
> URL: http://svn.freebsd.org/changeset/base/190857
>=20
> Log:
>   Undo SVN rev 183283
>  =20
>   Do not use Giant for kbdmux(4) locking. This is wrong and apparently
>   causing more problems than it solves. This will re-open the issue
>   where interrupt handlers may race with kbdmux(4) in polling mode.
>   Typical symptoms include (but not limited to) duplicated and/or
>   missing characters when low level console functions (such as gets)
>   are used while interrupts are enabled (for example geli password
>   prompt, mountroot prompt etc.)
>  =20
>   MFC after:	3 days
>=20
> Modified:
>   head/sys/dev/kbdmux/kbdmux.c
>=20
> Modified: head/sys/dev/kbdmux/kbdmux.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=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/kbdmux/kbdmux.c	Wed Apr  8 20:43:19 2009	(r190856)
> +++ head/sys/dev/kbdmux/kbdmux.c	Wed Apr  8 20:52:30 2009	(r190857)
> @@ -104,10 +104,10 @@ MALLOC_DEFINE(M_KBDMUX, KEYBOARD_NAME, "
> =20
>  #define KBDMUX_LOCK_DESTROY(s)
> =20
> -#define KBDMUX_LOCK(s) \
> -	mtx_lock(&Giant)
> -#define KBDMUX_UNLOCK(s) \
> -	mtx_unlock(&Giant)
> +#define KBDMUX_LOCK(s)
> +
> +#define KBDMUX_UNLOCK(s)
> +
>  #define KBDMUX_LOCK_ASSERT(s, w)
> =20
>  #define KBDMUX_SLEEP(s, f, d, t) \

How about turning this into a compile-time or sysctl option
or at least mentioning the change in /usr/src/UPDATING?

With this commit, providing the geli key phrase on
boot is impossible on my AMD64 dual core system.

Not even enabling the "visible characters" option helps
because obviously backspace is broken too.

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.

Fabian

--Sig_/XF.egAMdjwX/4xA+pOVvpeE
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

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

iEYEARECAAYFAkniAtEACgkQBYqIVf93VJ3sowCfcIFWYNTuYq59ZHML1CnpeH78
WC8AnRh1Elv1zZ/lRpKQ46QJhz2skWiL
=KY0+
-----END PGP SIGNATURE-----

--Sig_/XF.egAMdjwX/4xA+pOVvpeE--



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