Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: invalid operand for instruction inl (%dx) #734

Closed
nickdesaulniers opened this issue Oct 4, 2019 · 4 comments
Closed

error: invalid operand for instruction inl (%dx) #734

nickdesaulniers opened this issue Oct 4, 2019 · 4 comments
Assignees
Labels
[ARCH] x86_64 This bug impacts ARCH=x86_64 [BUG] linux A bug that should be fixed in the mainline kernel. [BUG] llvm A bug that should be fixed in upstream LLVM [FIXED][LINUX] 5.4 This bug was fixed in Linux 5.4 [TOOL] integrated-as The issue is relevant to LLVM integrated assembler

Comments

@nickdesaulniers
Copy link
Member

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.

@nickdesaulniers nickdesaulniers added [BUG] Untriaged Something isn't working [TOOL] integrated-as The issue is relevant to LLVM integrated assembler [ARCH] x86_64 This bug impacts ARCH=x86_64 labels Oct 4, 2019
@nickdesaulniers
Copy link
Member Author

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

as well.

@nickdesaulniers nickdesaulniers added the [PATCH] Submitted A patch has been submitted for review label Oct 7, 2019
@nickdesaulniers nickdesaulniers added [BUG] linux A bug that should be fixed in the mainline kernel. [BUG] llvm A bug that should be fixed in upstream LLVM [PATCH] Accepted A submitted patch has been accepted upstream and removed [BUG] Untriaged Something isn't working [PATCH] Submitted A patch has been submitted for review labels Oct 9, 2019
@samitolvanen
Copy link
Member

Merged in torvalds@fbcfb8f.

@nickdesaulniers nickdesaulniers added [FIXED][LINUX] 5.4 This bug was fixed in Linux 5.4 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] x86_64 This bug impacts ARCH=x86_64 [BUG] linux A bug that should be fixed in the mainline kernel. [BUG] llvm A bug that should be fixed in upstream LLVM [FIXED][LINUX] 5.4 This bug was fixed in Linux 5.4 [TOOL] integrated-as The issue is relevant to LLVM integrated assembler
Projects
None yet
Development

No branches or pull requests

3 participants