aboutsummaryrefslogtreecommitdiff
path: root/target-i386/cpu.h
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2015-12-16 17:06:42 -0200
committerEduardo Habkost <ehabkost@redhat.com>2016-05-23 19:47:37 -0300
commitd71b62a165b6af463f376bd398cfc1aec4e2f213 (patch)
treedf812ef1df50f2340f2df90094ceebcfbfe8a174 /target-i386/cpu.h
parent42ecabaae16c0054dde6d8b0fdf90a8c7cce270d (diff)
target-i386: kvm: Allocate kvm_msrs struct once per VCPU
Instead of using 2400 bytes in the stack for 150 MSR entries in kvm_get_msrs() and kvm_put_msrs(), allocate a buffer once for each VCPU. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target-i386/cpu.h')
-rw-r--r--target-i386/cpu.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index cd26decaaf..0426459bba 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -1124,6 +1124,8 @@ typedef struct CPUX86State {
TPRAccess tpr_access_type;
} CPUX86State;
+struct kvm_msrs;
+
/**
* X86CPU:
* @env: #CPUX86State
@@ -1176,6 +1178,8 @@ struct X86CPU {
struct DeviceState *apic_state;
struct MemoryRegion *cpu_as_root, *cpu_as_mem, *smram;
Notifier machine_done;
+
+ struct kvm_msrs *kvm_msr_buf;
};
static inline X86CPU *x86_env_get_cpu(CPUX86State *env)