lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20061015123432.4c6b7f15.akpm@osdl.org>
Date:	Sun, 15 Oct 2006 12:34:32 -0700
From:	Andrew Morton <akpm@...l.org>
To:	David Brownell <david-b@...bell.net>
Cc:	alan@...rguk.ukuu.org.uk, matthew@....cx,
	val_henson@...ux.intel.com, netdev@...r.kernel.org,
	linux-pci@...ey.karlin.mff.cuni.cz, linux-kernel@...r.kernel.org,
	gregkh@...e.de
Subject: Re: [PATCH 1/2] [PCI] Check that MWI bit really did get set

On Sun, 15 Oct 2006 12:16:31 -0700
David Brownell <david-b@...bell.net> wrote:

> (From Alan Cox:)
> > The underlying bug is that someone marked pci_set_mwi must-check, that's
> > wrong for most of the drivers that use it. If you remove the must check
> > annotation from it then the problem and a thousand other spurious
> > warnings go away.
> 
> Yes, there seems to be abuse of this new "must_check" feature.
> 
> 
> (From Andrew Morton:)
> > But if MWI _does_ make a difference to performance then we should tell
> > someone that it isn't working rather than silently misbehaving?
> 
> Thing is, a "difference to performance (alone)" != "misbehavior".
> 
> If it affected correctness, then a warning would be appropriate.
> 
> Most drivers should be able to say "enable MWI if possible, but
> don't worry if it's not possible".  Only a few controllers need
> additional setup to make MWI actually work ... if they couldn't
> do that setup, that'd be worth a warning before they backed off
> to run in a non-MWI mode.
> 

So the semantics of pci_set_mwi() are "try to set MWI if this
platform/device supports it".

In that case its interface is misdesigned, because it doesn't discriminate
between "yes-it-does/no-it-doesn't" (which we don't want to report, because
either is expected and legitimate) and "something screwed up", which we do
want to report, because it is always unexpected.

So an appropriate return value protocol would be

0:	No error, unable to set MWI
1:	No error, able to set MWI
-EFOO:	Error
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ