diff options
author | Avi Kivity <avi@redhat.com> | 2010-04-28 08:39:01 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-19 04:36:29 -0400 |
commit | 0ee75bead83da4791e5cbf659806c54d8ee40f12 (patch) | |
tree | 3b3856aac1fc94d153f9e6c27f383f81be06185a /arch/x86 | |
parent | 884a0ff0b68b3ece5987507de168215e14ef7849 (diff) |
KVM: Let vcpu structure alignment be determined at runtime
vmx and svm vcpus have different contents and therefore may have different
alignmment requirements. Let each specify its required alignment.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/svm.c | 2 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 889f66022e57..2511664ff671 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -3319,7 +3319,7 @@ static struct kvm_x86_ops svm_x86_ops = { | |||
3319 | static int __init svm_init(void) | 3319 | static int __init svm_init(void) |
3320 | { | 3320 | { |
3321 | return kvm_init(&svm_x86_ops, sizeof(struct vcpu_svm), | 3321 | return kvm_init(&svm_x86_ops, sizeof(struct vcpu_svm), |
3322 | THIS_MODULE); | 3322 | __alignof__(struct vcpu_svm), THIS_MODULE); |
3323 | } | 3323 | } |
3324 | 3324 | ||
3325 | static void __exit svm_exit(void) | 3325 | static void __exit svm_exit(void) |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 875b785228f6..2e8729678600 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -4245,7 +4245,8 @@ static int __init vmx_init(void) | |||
4245 | 4245 | ||
4246 | set_bit(0, vmx_vpid_bitmap); /* 0 is reserved for host */ | 4246 | set_bit(0, vmx_vpid_bitmap); /* 0 is reserved for host */ |
4247 | 4247 | ||
4248 | r = kvm_init(&vmx_x86_ops, sizeof(struct vcpu_vmx), THIS_MODULE); | 4248 | r = kvm_init(&vmx_x86_ops, sizeof(struct vcpu_vmx), |
4249 | __alignof__(struct vcpu_vmx), THIS_MODULE); | ||
4249 | if (r) | 4250 | if (r) |
4250 | goto out3; | 4251 | goto out3; |
4251 | 4252 | ||