Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread Segher Boessenkool
On Thu, Sep 10, 2020 at 03:31:53PM +, David Laight wrote: > > > asm volatile ("" : "+r" (eax)); > > > // So here eax must contain the value set by the "x" instructions. > > > > No, the register eax will contain the value of the eax variable. In the > > asm; it might well be there

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread Segher Boessenkool
On Wed, Sep 09, 2020 at 02:33:36PM -0700, Linus Torvalds wrote: > On Wed, Sep 9, 2020 at 11:42 AM Segher Boessenkool > wrote: > > > > It will not work like this in GCC, no. The LLVM people know about that. > > I do not know why they insist on pushing this, being incompatible and > > everything.

RE: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread David Laight
> -Original Message- > From: Segher Boessenkool > Sent: 10 September 2020 16:21 > To: David Laight > Cc: 'Christophe Leroy' ; 'Linus Torvalds' > foundation.org>; linux-arch ; Kees Cook > ; the > arch/x86 maintainers ; Nick Desaulniers > ; Linux Kernel > Mailing List ; Alexey

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread Segher Boessenkool
On Thu, Sep 10, 2020 at 12:26:53PM +, David Laight wrote: > Actually this is pretty sound: > __label__ label; > register int eax asm ("eax"); > // Ensure eax can't be reloaded from anywhere > // In particular it can't be reloaded after the asm goto line > asm

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread Segher Boessenkool
On Thu, Sep 10, 2020 at 09:26:28AM +, David Laight wrote: > From: Christophe Leroy > > Sent: 10 September 2020 09:14 > > > > Le 10/09/2020 à 10:04, David Laight a écrit : > > > From: Linus Torvalds > > >> Sent: 09 September 2020 22:34 > > >> On Wed, Sep 9, 2020 at 11:42 AM Segher Boessenkool

RE: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread David Laight
From: David Laight > Sent: 10 September 2020 10:26 ... > > > I had an 'interesting' idea. > > > > > > Can you use a local asm register variable as an input and output to > > > an 'asm volatile goto' statement? > > > > > > Well you can - but is it guaranteed to work :-) > > > > > > > With gcc at

RE: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread David Laight
From: Christophe Leroy > Sent: 10 September 2020 09:14 > > Le 10/09/2020 à 10:04, David Laight a écrit : > > From: Linus Torvalds > >> Sent: 09 September 2020 22:34 > >> On Wed, Sep 9, 2020 at 11:42 AM Segher Boessenkool > >> wrote: > >>> > >>> It will not work like this in GCC, no. The LLVM

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread Christophe Leroy
Le 10/09/2020 à 10:04, David Laight a écrit : From: Linus Torvalds Sent: 09 September 2020 22:34 On Wed, Sep 9, 2020 at 11:42 AM Segher Boessenkool wrote: It will not work like this in GCC, no. The LLVM people know about that. I do not know why they insist on pushing this, being

RE: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread David Laight
From: Linus Torvalds > Sent: 09 September 2020 22:34 > On Wed, Sep 9, 2020 at 11:42 AM Segher Boessenkool > wrote: > > > > It will not work like this in GCC, no. The LLVM people know about that. > > I do not know why they insist on pushing this, being incompatible and > > everything. > > Umm.

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-09 Thread Linus Torvalds
On Wed, Sep 9, 2020 at 11:42 AM Segher Boessenkool wrote: > > It will not work like this in GCC, no. The LLVM people know about that. > I do not know why they insist on pushing this, being incompatible and > everything. Umm. Since they'd be the ones supporting this, *gcc* would be the

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-09 Thread Segher Boessenkool
On Wed, Sep 09, 2020 at 10:31:34AM -0700, Linus Torvalds wrote: > And apparently there are people working on this on the gcc side too, > so it won't just be clang-specific. Nor kernel-specific in that Nick > tells me some other projects are looking at using that asm goto with > outputs too. It

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-09 Thread Linus Torvalds
On Thu, Sep 3, 2020 at 7:28 AM Al Viro wrote: > > I can live with this series; do you want that in vfs.git#for-next? Well, it's apparently there now (at least it's in your base.set_fs branch, I didn't check actual -next). So this is just a heads-up that I plan to merge the "asm goto" changes on

RE: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-05 Thread David Laight
From: Christophe Leroy > Sent: 05 September 2020 08:16 > > Le 04/09/2020 à 23:01, David Laight a écrit : > > From: Alexey Dobriyan > >> Sent: 04 September 2020 18:58 ... > > What is this strange %fs register you are talking about. > > Figure 2-4 only has CS, DS, SS and ES. > > > > Intel added

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-05 Thread Christophe Leroy
Le 04/09/2020 à 23:01, David Laight a écrit : From: Alexey Dobriyan Sent: 04 September 2020 18:58 On Fri, Sep 04, 2020 at 08:00:24AM +0200, Ingo Molnar wrote: * Christoph Hellwig wrote: this series removes the last set_fs() used to force a kernel address space for the uaccess code in the

RE: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-04 Thread David Laight
From: Alexey Dobriyan > Sent: 04 September 2020 18:58 > > On Fri, Sep 04, 2020 at 08:00:24AM +0200, Ingo Molnar wrote: > > * Christoph Hellwig wrote: > > > this series removes the last set_fs() used to force a kernel address > > > space for the uaccess code in the kernel read/write/splice code,

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-04 Thread Linus Torvalds
On Fri, Sep 4, 2020 at 10:58 AM Alexey Dobriyan wrote: > > set_fs() is older than some kernel hackers! > > $ cd linux-0.11/ > $ find . -type f -name '*.h' | xargs grep -e set_fs -w -n -A3 Oh, it's older than that. It was there (as set_fs) in 0.10, and may even predate that. But

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-04 Thread Alexey Dobriyan
On Fri, Sep 04, 2020 at 08:00:24AM +0200, Ingo Molnar wrote: > * Christoph Hellwig wrote: > > this series removes the last set_fs() used to force a kernel address > > space for the uaccess code in the kernel read/write/splice code, and then > > stops implementing the address space overrides

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-04 Thread Ingo Molnar
* Christoph Hellwig wrote: > Hi all, > > this series removes the last set_fs() used to force a kernel address > space for the uaccess code in the kernel read/write/splice code, and then > stops implementing the address space overrides entirely for x86 and > powerpc. Cool! For the x86 bits:

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-03 Thread Linus Torvalds
On Thu, Sep 3, 2020 at 7:22 AM Christoph Hellwig wrote: > > [Note to Linus: I'd like to get this into linux-next rather earlier > than later. Do you think it is ok to add this tree to linux-next?] This whole series looks really good to me now, with each patch looking like a clear cleanup on its

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-03 Thread Christoph Hellwig
On Thu, Sep 03, 2020 at 03:36:29PM +0100, Al Viro wrote: > FWIW, vfs.git#for-next is always a merge of independent branches; I don't > put stuff directly into #for-next - too easy to lose that way. > > IOW, that would be something like #base.set_fs, included into #for-next > merge set. And I've

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-03 Thread Al Viro
On Thu, Sep 03, 2020 at 04:30:03PM +0200, Christoph Hellwig wrote: > On Thu, Sep 03, 2020 at 03:28:03PM +0100, Al Viro wrote: > > On Thu, Sep 03, 2020 at 04:22:28PM +0200, Christoph Hellwig wrote: > > > > > Besides x86 and powerpc I plan to eventually convert all other > > > architectures,

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-03 Thread Christoph Hellwig
On Thu, Sep 03, 2020 at 03:28:03PM +0100, Al Viro wrote: > On Thu, Sep 03, 2020 at 04:22:28PM +0200, Christoph Hellwig wrote: > > > Besides x86 and powerpc I plan to eventually convert all other > > architectures, although this will be a slow process, starting with the > > easier ones once the

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-03 Thread Al Viro
On Thu, Sep 03, 2020 at 04:22:28PM +0200, Christoph Hellwig wrote: > Besides x86 and powerpc I plan to eventually convert all other > architectures, although this will be a slow process, starting with the > easier ones once the infrastructure is merged. The process to convert > architectures is

remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-03 Thread Christoph Hellwig
Hi all, this series removes the last set_fs() used to force a kernel address space for the uaccess code in the kernel read/write/splice code, and then stops implementing the address space overrides entirely for x86 and powerpc. [Note to Linus: I'd like to get this into linux-next rather earlier