Linux: error: invalid operand for instruction inl (%dx)

Created on 5 Oct 2019  路  4Comments  路  Source: ClangBuiltLinux/linux

x86_64 allyesconfig AS=clang

arch/x86/kernel/cpu/vmware.c:95:2: error: invalid operand for instruction
        VMWARE_CMD(GETVERSION, eax, ebx, ecx, edx);
        ^
arch/x86/kernel/cpu/vmware.c:84:3: note: expanded from macro 'VMWARE_CMD'
                VMWARE_PORT(cmd, eax, ebx, ecx, edx);           \
                ^
arch/x86/kernel/cpu/vmware.c:52:10: note: expanded from macro 'VMWARE_PORT'
        __asm__("inl (%%dx)" :                                          \
                ^
<inline asm>:1:7: note: instantiated into assembly here
        inl (%dx)
             ^

What's curious is that GAS accepts this (why doesn't Clang), but then there's another difference in the disassembly (after assembling w/ GAS):

$ cat bad2.s 
inl (%dx)
$ llvm-objdump -d a.out 

a.out:  file format ELF64-x86-64


Disassembly of section .text:

0000000000000000 .text:
       0: ed                            inl     %dx, %eax
$ objdump -d a.out 

a.out:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <.text>:
   0:   ed                      in     (%dx),%eax

It looks like %dx is being dereferenced in the GNU disassembler output.

[ARCH] x86_64 [BUG] linux [BUG] llvm [FIXED][LINUX] 5.4 [TOOL] integrated-as

Most helpful comment

All 4 comments

we see this in
drivers/input/mouse/vmmouse.c:255:2: error: invalid operand for instruction

as well.

accepted: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/urgent&id=fbcfb8f0270bf24fe348393540b17a7f2ba577d7

Was this page helpful?
0 / 5 - 0 ratings