From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shadbolt.e.decadent.org.uk (shadbolt.e.decadent.org.uk [88.96.1.126]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C2CD5B7CF1 for ; Wed, 24 Mar 2010 00:23:10 +1100 (EST) From: Ben Hutchings To: Paul Mundt In-Reply-To: <20100323074546.GK13417@linux-sh.org> References: <1269126097.18314.111.camel@localhost> <1269126340.18314.115.camel@localhost> <20100323074546.GK13417@linux-sh.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-JxBzKjEiI/A3c1PVSdDJ" Date: Tue, 23 Mar 2010 13:23:00 +0000 Message-ID: <1269350580.18314.260.camel@localhost> Mime-Version: 1.0 Subject: Re: [PATCH 2/4] panic: Allow taint flag for warnings to be changed from TAINT_WARN Cc: linux-s390@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-pci@vger.kernel.org, LKML , Jesse Barnes , linuxppc-dev@ozlabs.org, David Woodhouse List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --=-JxBzKjEiI/A3c1PVSdDJ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2010-03-23 at 16:45 +0900, Paul Mundt wrote: > On Sat, Mar 20, 2010 at 11:05:40PM +0000, Ben Hutchings wrote: > > WARN() is used in some places to report firmware or hardware bugs that > > are then worked-around. These bugs do not affect the stability of the > > kernel and should not set the usual TAINT_WARN flag. To allow for > > this, add WARN_TAINT() and WARN_TAINT_ONCE() macros that take a taint > > flag as argument. > >=20 > > Architectures that implement warnings using trap instructions instead > > of calls to warn_slowpath_*() must now implement __WARN_TAINT(taint) > > instead of __WARN(). > >=20 > > Signed-off-by: Ben Hutchings > > --- > > The architecture-specific changes here are untested and need to be > > reviewed by architecture maintainers. > >=20 > I'm a bit confused about how this is supposed to work, the TAINT_xxx > values are bit positions presently from 0 to 10, while BUGFLAG_xxx are > ranged from 0 up. You've set up BUGFLAG_TAINT() to that the TAINT_xxx > value is shifted up 8 bits but neglected the fact that the trap type is > 16-bits on most (all?) of the platforms using trap-based BUG handling. >=20 > If the 'taint' in question is just the TAINT_xxx value by itself and will > never be a bitmap then that's fine, but there's certainly not enough room > to pass the bitmap in on top of the bugflag otherwise (I don't know if > this is your intention or not though). Yes, the taint value must be a bit number not a flag. Sloppy wording on my part. > Also note that some platforms (like SH) implement additional bugflags, so > we at least want to keep the lower byte available for architecture > private use. I noticed, that's why I started at 8 not 1. > Having said that, the current patch does work for me, although I'm a bit > nervous about someone thinking it's ok to pass in a taint bitmap here. We can maybe use BUILD_BUG_ON() here as the taint bit is already required to be a compile-time constant. Ben. > Tested-by: Paul Mundt >=20 --=20 Ben Hutchings Any smoothly functioning technology is indistinguishable from a rigged demo= . --=-JxBzKjEiI/A3c1PVSdDJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIVAwUAS6jAsue/yOyVhhEJAQKuLRAAo8lRcJIYqpklZT6Ct5UkFmnwQBWniN/J O8B6FmzAV8e44xkctJegxtmxMBQETjVOmcR6YC0KtzZXQ1VRSzF7kNaQ1i4V5uXn aBSXf82IxdIs7h9wDWqOH2uXtrheLeEhKTvTyGKEzGsc0t28l2cMUocxsjlFU8VW oAenqoHUbJAkPvpC1fP8bT42C9rxm5AcO/py0pyqtC+gPaOs/J+606IClqlE4bXi ZHltMfpoFzBWQLJ7ZB7Aeu1vwFozybSfeoz9/p54BjMhcRcmQTaTSBUfKeyC5EsS Q8GbKYFtIwKhdnLJ9QNfuiO+0u3/G3dkPHRWVJdivNpplncsrYYTDlKJV+ivRtV1 6xuJVjIONPh5VwEHkqEbYfEdqf9WFHvUbDWOxeMjQ82vuzObFDgR97oIFcwu5X+e Qbl8XVnRQtk3BhblMnfrDBuwYuudgqMaiuTwYSmQWAoJpL5ftwQRXXYszFrHWVkA wMVUL9V+Cke4xkvxt0szxBo7y20Je+6OnOj/u3G04cK2f2gdAG7yWXm1x6K5jxjc OIVB/hzMuLLT3oW9h/gy3OT617X8wz5W83oqH8jcxsBG34QmpWuCYvhXFWF1DkAg vbxLwPzg4JYcxLjpsJ5ZGuREyf+DQVGu323BV9IdR/JHUahaI73bZ1/L9jo7VKSw IPYASs3GZ2M= =xrOe -----END PGP SIGNATURE----- --=-JxBzKjEiI/A3c1PVSdDJ--