Subject: Re: linux-next: build failure after merge of the vfs tree

From: Al Viro <[email-masked]>
Date: Fri, 25 Sep 2020 14:38:20 +0100

On Fri, Sep 25, 2020 at 10:01:28PM +1000, Stephen Rothwell wrote:
> $ x86_64-linux-gnu-gcc --version
> x86_64-linux-gnu-gcc (Debian 10.2.0-9) 10.2.0
> $ x86_64-linux-gnu-ld --version
> GNU ld (GNU Binutils for Debian) 2.35
> 
> and the gcc plugins don't get built for the allnoconfig builds.

> I reverted my Revert commit after I finished linux-next today and built
> the x86_64 allnoconfig verion of lib/iov_iter.s:
> 
> $ grep -A 1 '41 "/home/sfr/next/next/arch/x86/include/asm/barrier.h"' lib/iov_iter.s
> # 41 "/home/sfr/next/next/arch/x86/include/asm/barrier.h" 1
> 	cmp $140737488351232,%rdx; sbb %rcx,%rcx;	#, uaddr, mask

Wait a sec...
static inline unsigned long array_index_mask_nospec(unsigned long index,
                unsigned long size)
{
        unsigned long mask;

        asm volatile ("cmp %1,%2; sbb %0,%0;"
                        :"=r" (mask)
                        :"g"(size),"r" (index)
                        :"cc");
        return mask;
}  

used with large constant size will blow up - "g" is wrong, since cmp allows
64bit arguments to be register or memory ones; immediates can't go past
32bit.

Looks like on the configs where it builds we end up with not seeing it's
a constant...

Josh, any ideas?  We could, of course, make it "r"(size), but that would
be unpleasant in all existing callers...