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: <CA+55aFxykes2Vk2YqGN=o=MkJukMBRcpQTN+tjmuTX_3xTstZA@mail.gmail.com>
Date:	Wed, 7 Dec 2011 10:09:57 -0800
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Greg KH <gregkh@...e.de>, Ingo Molnar <mingo@...e.hu>,
	Brian Gerst <brgerst@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	akpm@...ux-foundation.org, alan@...rguk.ukuu.org.uk,
	Tim Blechmann <tim@...ngt.org>, Takashi Iwai <tiwai@...e.de>
Subject: Re: [20/80] ALSA: lx6464es - fix device communication via command bus

On Wed, Dec 7, 2011 at 10:00 AM, H. Peter Anvin <hpa@...or.com> wrote:
>
> I agree in principle, although I am really not happy about the idea of
> disallowing 64-bit writes from device drivers that haven't explicitly
> indicated they won't support it.

I'd really prefer going in the other direction. Especially since
64-bit writes would be optional *anyway* (ie impossible on 32-bit
hosts). So a driver should explicitly say "I can do 64-bit stuff"
rather than having to say "I cannot do it".

And if a driver *has* to have 64-bit accesses, it had better do them
all by hand, using "writeq()" and being dependent on the architecture
actually having that support. No "memcpy_toio" and friends at all.

So adding a "memcpy_toio64()" that defaults to the normal 32-bit max
but *might* do 64-bit copies sounds fine to me. But we really should
default to something that is consistent across architectures, and that
is not 64-bit accesses.

Old PCI setups actually had trouble with 64-bit accesses afaik, and
would literally get them wrong at a hardware level. I'm sure that's
not true of anything you can actually plug into a machine that
actually has a 64-bit x86 in it, but it's an example of actual
hardware limitations. I'm pretty sure there are 64-bit alpha machines
that are from that kind of timeframe, to give an example of a natively
64-bit architecture where a 64-bit write would simply not have worked
on a hardware level.

I'd suggest adding a architecture-neutral weak alias from
memcpy_toio64 to memcpy_toio (and other combinations), and then we can
independently start using it in drivers and/or start adding it in
various architectures. That automatically gives us the default
fallback for architectures that don't care or can't do it.

Hmm?

                     Linus
--
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