diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-02-12 03:54:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:40 -0500 |
commit | 96958231cea5985e32db2ae1125ec20483e3556b (patch) | |
tree | f8a6a89db6ecd5af726e3e65c55cb122cf29841d /drivers/kvm | |
parent | 54fb996ac15c4014fa4d6b0ec8e42da134204897 (diff) |
[PATCH] kvm: optimize inline assembly
Forms like "0(%rsp)" generate an instruction with an unnecessary one byte
displacement under certain circumstances. replace with the equivalent
"(%rsp)".
Signed-off-by: Avi Kivity <avi@qumranet.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/vmx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 27e05a77e21a..5cc1a6ec0174 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -1786,10 +1786,10 @@ again: | |||
1786 | "kvm_vmx_return: " | 1786 | "kvm_vmx_return: " |
1787 | /* Save guest registers, load host registers, keep flags */ | 1787 | /* Save guest registers, load host registers, keep flags */ |
1788 | #ifdef CONFIG_X86_64 | 1788 | #ifdef CONFIG_X86_64 |
1789 | "xchg %3, 0(%%rsp) \n\t" | 1789 | "xchg %3, (%%rsp) \n\t" |
1790 | "mov %%rax, %c[rax](%3) \n\t" | 1790 | "mov %%rax, %c[rax](%3) \n\t" |
1791 | "mov %%rbx, %c[rbx](%3) \n\t" | 1791 | "mov %%rbx, %c[rbx](%3) \n\t" |
1792 | "pushq 0(%%rsp); popq %c[rcx](%3) \n\t" | 1792 | "pushq (%%rsp); popq %c[rcx](%3) \n\t" |
1793 | "mov %%rdx, %c[rdx](%3) \n\t" | 1793 | "mov %%rdx, %c[rdx](%3) \n\t" |
1794 | "mov %%rsi, %c[rsi](%3) \n\t" | 1794 | "mov %%rsi, %c[rsi](%3) \n\t" |
1795 | "mov %%rdi, %c[rdi](%3) \n\t" | 1795 | "mov %%rdi, %c[rdi](%3) \n\t" |
@@ -1804,24 +1804,24 @@ again: | |||
1804 | "mov %%r15, %c[r15](%3) \n\t" | 1804 | "mov %%r15, %c[r15](%3) \n\t" |
1805 | "mov %%cr2, %%rax \n\t" | 1805 | "mov %%cr2, %%rax \n\t" |
1806 | "mov %%rax, %c[cr2](%3) \n\t" | 1806 | "mov %%rax, %c[cr2](%3) \n\t" |
1807 | "mov 0(%%rsp), %3 \n\t" | 1807 | "mov (%%rsp), %3 \n\t" |
1808 | 1808 | ||
1809 | "pop %%rcx; pop %%r15; pop %%r14; pop %%r13; pop %%r12;" | 1809 | "pop %%rcx; pop %%r15; pop %%r14; pop %%r13; pop %%r12;" |
1810 | "pop %%r11; pop %%r10; pop %%r9; pop %%r8;" | 1810 | "pop %%r11; pop %%r10; pop %%r9; pop %%r8;" |
1811 | "pop %%rbp; pop %%rdi; pop %%rsi;" | 1811 | "pop %%rbp; pop %%rdi; pop %%rsi;" |
1812 | "pop %%rdx; pop %%rbx; pop %%rax \n\t" | 1812 | "pop %%rdx; pop %%rbx; pop %%rax \n\t" |
1813 | #else | 1813 | #else |
1814 | "xchg %3, 0(%%esp) \n\t" | 1814 | "xchg %3, (%%esp) \n\t" |
1815 | "mov %%eax, %c[rax](%3) \n\t" | 1815 | "mov %%eax, %c[rax](%3) \n\t" |
1816 | "mov %%ebx, %c[rbx](%3) \n\t" | 1816 | "mov %%ebx, %c[rbx](%3) \n\t" |
1817 | "pushl 0(%%esp); popl %c[rcx](%3) \n\t" | 1817 | "pushl (%%esp); popl %c[rcx](%3) \n\t" |
1818 | "mov %%edx, %c[rdx](%3) \n\t" | 1818 | "mov %%edx, %c[rdx](%3) \n\t" |
1819 | "mov %%esi, %c[rsi](%3) \n\t" | 1819 | "mov %%esi, %c[rsi](%3) \n\t" |
1820 | "mov %%edi, %c[rdi](%3) \n\t" | 1820 | "mov %%edi, %c[rdi](%3) \n\t" |
1821 | "mov %%ebp, %c[rbp](%3) \n\t" | 1821 | "mov %%ebp, %c[rbp](%3) \n\t" |
1822 | "mov %%cr2, %%eax \n\t" | 1822 | "mov %%cr2, %%eax \n\t" |
1823 | "mov %%eax, %c[cr2](%3) \n\t" | 1823 | "mov %%eax, %c[cr2](%3) \n\t" |
1824 | "mov 0(%%esp), %3 \n\t" | 1824 | "mov (%%esp), %3 \n\t" |
1825 | 1825 | ||
1826 | "pop %%ecx; popa \n\t" | 1826 | "pop %%ecx; popa \n\t" |
1827 | #endif | 1827 | #endif |