Re: bad asm goto ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 25, 2010 at 03:10:29PM -0700, Christopher Li wrote:
 > On Mon, Oct 25, 2010 at 2:31 PM, Dave Jones <davej@xxxxxxxxxx> wrote:
 > > I just ran sparse on a kernel tree for the first time in ages, and got
 > > hundreds of warnings, many of which related to the tracepoint macros
 > > in the kernel, which use the new asm goto feature.
 > >
 > > Looking at the git log of sparse, I see there was some support added
 > > for asm goto, but it seems to choke every time, printing ..
 > >
 > > include/trace/events/kmem.h:45:1: error: bad asm output
 > > include/trace/events/kmem.h:45:1: error: incompatible types in comparison expression (different address spaces)
 > >
 > >
 > > (this is with a sparse built from git head from a few minutes ago)
 > 
 > Do you have a smaller test case to reproduce the error?

I tried unwinding some of the nested macros, and came up with ..

# define __ASM_FORM(x)  " " #x " "
# define JUMP_LABEL_INITIAL_NOP ".byte 0xe9 \n\t .long 0\n\t"
# define __ASM_SEL(a,b) __ASM_FORM(b)
#define _ASM_PTR        __ASM_SEL(.long, .quad)

# define JUMP_LABEL(key, label)                                 \
        do {                                                    \
                asm goto("1:"                                   \
                        JUMP_LABEL_INITIAL_NOP                  \
                        ".pushsection __jump_table,  \"a\" \n\t"\
                        _ASM_PTR "1b, %l[" #label "], %c0 \n\t" \
                        ".popsection \n\t"                      \
                        : :  "i" (key) :  : label);             \
        } while (0)

int main(int argc, char *argv[])
{
        JUMP_LABEL("1", do_trace );
        return 1;
do_trace:
        return 0;
}

gcc seems to not choke on it, but sparse still does, so I think I managed
to untangle things correctly..

	Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux