aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/vmx
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-04-29 15:46:15 +0200
committerJan Beulich <jbeulich@suse.com>2013-04-29 15:46:15 +0200
commit0352856935590a6b740306f2559fe204908472c9 (patch)
tree59385b837a4467adc818d2845009c11f8b5e6550 /xen/arch/x86/hvm/vmx
parenta7ac9597a7fc6ca934957eb78b41e26638281953 (diff)
downloadxen-0352856935590a6b740306f2559fe204908472c9.tar.gz
xen-0352856935590a6b740306f2559fe204908472c9.tar.bz2
xen-0352856935590a6b740306f2559fe204908472c9.zip
x86/HVM: move per-vendor function tables into .init.data
hvm_enable() copies the table contents rather than storing the pointer, so there's no need to keep these tables post-boot. Also constify the return values of the per-vendor initialization functions, making clear that once the per-vendor initialization is complete, the vendor specific tables won't get modified anymore. Finally, in hvm_enable(), use the returned pointer for all read accesses as being more efficient than global variable accesses. Writes of course still need to go to the global variable. Signed-off-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/hvm/vmx')
-rw-r--r--xen/arch/x86/hvm/vmx/vmx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 6866cd080b..51187a932a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1502,7 +1502,7 @@ static void vmx_sync_pir_to_irr(struct vcpu *v)
vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]);
}
-static struct hvm_function_table __read_mostly vmx_function_table = {
+static struct hvm_function_table __initdata vmx_function_table = {
.name = "VMX",
.cpu_up_prepare = vmx_cpu_up_prepare,
.cpu_dead = vmx_cpu_dead,
@@ -1557,7 +1557,7 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
.nhvm_hap_walk_L1_p2m = nvmx_hap_walk_L1_p2m,
};
-struct hvm_function_table * __init start_vmx(void)
+const struct hvm_function_table * __init start_vmx(void)
{
set_in_cr4(X86_CR4_VMXE);