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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <475E95A3.3070801@davidnewall.com>
Date:	Wed, 12 Dec 2007 00:20:27 +1030
From:	David Newall <david@...idnewall.com>
To:	Rene Herman <rene.herman@...access.nl>
CC:	Paul Rolland <rol@...917.net>, "H. Peter Anvin" <hpa@...or.com>,
	Krzysztof Halasa <khc@...waw.pl>, Pavel Machek <pavel@....cz>,
	Andi Kleen <andi@...stfloor.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	"David P. Reed" <dpreed@...d.com>, linux-kernel@...r.kernel.org,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, rol@...be.net
Subject: Re: RFC: outb 0x80 in inb_p, outb_p harmful on some modern AMD64
 with MCP51 laptops

Rene Herman wrote:
> This particular discussion isn't about anything in general but solely 
> about the delay an outb_p gives you on x86 since what is under 
> discussion is not using an output to port 0x80 on that platform to 
> generate it.

That could be true if outb_p were used only in architecture dependent 
code, but it's not.  It's used in drivers that are supposed to run on 
all sorts of platforms.  Why does a megaraid controller need delays on 
i386 but not on Sparc, PowerPC, Alpha and others?  Is it buggy on most 
platforms, or just unnecessarily slow on Intel?

>> is needed, wouldn't you use a real delay; one that says how long it
>> should be?
> Thinking that _p gives a pause is perhaps too PC-centric. Why, if a delay
>
> Because any possible outb_p delay should be synced to the bus-clock, 
> not to any wall-clock.

You misunderstand.  A delay can be counted in bus cycles.

> In the real world, driver authors aren't perfect and will have used 
> outb_p as a wall-clock delay which they have gotten away with since 
> it's a nicely specified delay in terms of the ISA/LPC clock and the 
> ISA/LPC clock being fairly (old) to very (new) constant.

It's most commonly a zero delay.  Only in the minority of architectures 
is it otherwise.  If a delay is needed, then put one in, but don't put 
in a paper promise that's more likely to be ignored than observed.

Plenty of doubt has been expressed as to whether _p is widely used 
without need.  Not surprising since it has such a vague specific 
meaning.  One could say, Linux on i386 is liberally sprinkled with 
needless delays.  I suppose it has the advantage that Microsoft will be 
hard pressed to catch up when finally we remove them. :-)

I really prefer accurate code, but I'm also pragmatic and realise that 
it's far too much work to fix this any time soon.  But if it were to be 
fixed, then perhaps _p would take an additional parameter, measured in 
cycles of delay.
--
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