KVM: SVM: Let gcc to choose which registers to save (x86_64)
authorLaurent Vivier <Laurent.Vivier@bull.net>
Thu, 25 Oct 2007 12:18:53 +0000 (14:18 +0200)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:52:56 +0000 (17:52 +0200)
commit54a08c0449683f763dc69e653d17e8c120e16299
tree959fd4654d64837d2eeb87d37fe1506a295f5cb7
parentff593e5abebd899b0b41c11280e2fbeff4103375
KVM: SVM: Let gcc to choose which registers to save (x86_64)

This patch lets GCC to determine which registers to save when we
switch to/from a VCPU in the case of AMD x86_64.

* Original code saves following registers:

    rbx, rcx, rdx, rsi, rdi, rbp,
    r8, r9, r10, r11, r12, r13, r14, r15

* Patched code:

  - informs GCC that we modify following registers
    using the clobber description:

    rbx, rcx, rdx, rsi, rdi
    r8, r9, r10, r11, r12, r13, r14, r15

  - 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>
drivers/kvm/svm.c