[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090520201127.48B54FC38D@magilla.sf.frob.com>
Date: Wed, 20 May 2009 13:11:27 -0700 (PDT)
From: Roland McGrath <roland@...hat.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Ingo Molnar <mingo@...e.hu>, Christoph Hellwig <hch@...radead.org>,
Hiroshi Shimamoto <h-shimamoto@...jp.nec.com>,
Vitaly Mayatskikh <v.mayatskih@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: Q: put_user_try & co (Was: [PATCH 1/5] Split wait_noreap_copyout())
> #define __put_user_asm_ex(...) \
> asm volatile( \
> "1: mov ..." \
> _ASM_EXTABLE(1b, &__efault_label) \
> : : ...)
You mean &&__efault_label here (it's a funny syntax, but that's how it is).
&&label is a GCC extension that I'm not sure the kernel has used before.
I think it can be touchy to have an asm jump into compiled code that way.
e.g., perhaps the compiler produced:
mov reg, 40(sp)
mov $123, reg
#APP
... inside of your asm ...
#NO_APP
mov 40(sp), reg
or some such thing. If you jump away from inside the asm, you won't ever
do "mov 40(sp), reg". But the compiler might think that reg has its
original value at the __efault_label: code location.
Perhaps more important than any particular compiler-confusion scenario we
can come up with is simply that this would be an obscure corner of code
generation in the compiler that the kernel has not evoked before. There
might be bugs or oddities in various compilers of various vintages, that
we don't know about because they never came up before.
Thanks,
Roland
--
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