KVM: Use alignment properties of vcpu to simplify FPU ops
Now we use a kmem cache for allocating vcpus, we can get the 16-byte alignment required by fxsave & fxrstor instructions, and avoid manually aligning the buffer. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:

committed by
Avi Kivity

parent
c16f862d02
commit
b114b0804d
@@ -1557,8 +1557,8 @@ again:
|
||||
}
|
||||
|
||||
if (vcpu->fpu_active) {
|
||||
fx_save(vcpu->host_fx_image);
|
||||
fx_restore(vcpu->guest_fx_image);
|
||||
fx_save(&vcpu->host_fx_image);
|
||||
fx_restore(&vcpu->guest_fx_image);
|
||||
}
|
||||
|
||||
asm volatile (
|
||||
@@ -1670,8 +1670,8 @@ again:
|
||||
vcpu->guest_mode = 0;
|
||||
|
||||
if (vcpu->fpu_active) {
|
||||
fx_save(vcpu->guest_fx_image);
|
||||
fx_restore(vcpu->host_fx_image);
|
||||
fx_save(&vcpu->guest_fx_image);
|
||||
fx_restore(&vcpu->host_fx_image);
|
||||
}
|
||||
|
||||
if ((svm->vmcb->save.dr7 & 0xff))
|
||||
|
Reference in New Issue
Block a user