linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using asm_volatile_goto for get_user()
@ 2020-09-07  8:49 David Laight
  0 siblings, 0 replies; only message in thread
From: David Laight @ 2020-09-07  8:49 UTC (permalink / raw)
  To: 'Christoph Hellwig',
	Paul Walmsley, Palmer Dabbelt, Arnd Bergmann, Alexander Viro
  Cc: linux-kernel, linux-arch

I had an idea that might let 'asm_volatile_goto' be used for
get_user() even though gcc doesn't allow outputs.

What if (eg) 'register eax asm ("eax") is used for the
output and (probably) given in the 'clobber' list.

Such variables are usually used to get explicit registers
used when there is no suitable constraint.
I don't see why it shouldn't work for 'asm goto' as well
as just 'asm'.

While this forces the read value into a specific register
that probably doesn't make much difference to the code.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-07  8:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07  8:49 Using asm_volatile_goto for get_user() David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).