aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorLaurent Vivier <Laurent.Vivier@bull.net>2007-10-25 08:18:54 -0400
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:52:57 -0500
commitfe7935d49fbe33308c1b5f0e35137989da851010 (patch)
tree9adf908a42aafda09e1d100072bcb332611c8b85 /drivers/kvm/svm.c
parent54a08c0449683f763dc69e653d17e8c120e16299 (diff)
KVM: SVM: Let gcc to choose which registers to save (i386)
This patch lets GCC to determine which registers to save when we switch to/from a VCPU in the case of AMD i386 * Original code saves following registers: ebx, ecx, edx, esi, edi, ebp * Patched code: - informs GCC that we modify following registers using the clobber description: ebx, ecx, edx, esi, edi - rbp is saved (pop/push) because GCC seems to ignore its use in the clobber description. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index debd0912a016..fe2a5e8b0524 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1501,8 +1501,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1501#ifdef CONFIG_X86_64 1501#ifdef CONFIG_X86_64
1502 "push %%rbp; \n\t" 1502 "push %%rbp; \n\t"
1503#else 1503#else
1504 "push %%ebx; push %%ecx; push %%edx;" 1504 "push %%ebp; \n\t"
1505 "push %%esi; push %%edi; push %%ebp;"
1506#endif 1505#endif
1507 1506
1508#ifdef CONFIG_X86_64 1507#ifdef CONFIG_X86_64
@@ -1573,8 +1572,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1573 "mov %%edi, %c[rdi](%[svm]) \n\t" 1572 "mov %%edi, %c[rdi](%[svm]) \n\t"
1574 "mov %%ebp, %c[rbp](%[svm]) \n\t" 1573 "mov %%ebp, %c[rbp](%[svm]) \n\t"
1575 1574
1576 "pop %%ebp; pop %%edi; pop %%esi;" 1575 "pop %%ebp; \n\t"
1577 "pop %%edx; pop %%ecx; pop %%ebx; \n\t"
1578#endif 1576#endif
1579 : 1577 :
1580 : [svm]"a"(svm), 1578 : [svm]"a"(svm),
@@ -1599,6 +1597,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1599#ifdef CONFIG_X86_64 1597#ifdef CONFIG_X86_64
1600 , "rbx", "rcx", "rdx", "rsi", "rdi" 1598 , "rbx", "rcx", "rdx", "rsi", "rdi"
1601 , "r8", "r9", "r10", "r11" , "r12", "r13", "r14", "r15" 1599 , "r8", "r9", "r10", "r11" , "r12", "r13", "r14", "r15"
1600#else
1601 , "ebx", "ecx", "edx" , "esi", "edi"
1602#endif 1602#endif
1603 ); 1603 );
1604 1604