aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/hvm.c
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/hvm.c
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/hvm.c')
-rw-r--r--xen/arch/x86/hvm/hvm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 8522963cb0..c8487b8ebe 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -113,7 +113,7 @@ static struct notifier_block cpu_nfb = {
static int __init hvm_enable(void)
{
- struct hvm_function_table *fns = NULL;
+ const struct hvm_function_table *fns = NULL;
if ( cpu_has_vmx )
fns = start_vmx();
@@ -126,8 +126,8 @@ static int __init hvm_enable(void)
hvm_funcs = *fns;
hvm_enabled = 1;
- printk("HVM: %s enabled\n", hvm_funcs.name);
- if ( !hvm_funcs.hap_supported )
+ printk("HVM: %s enabled\n", fns->name);
+ if ( !fns->hap_supported )
printk("HVM: Hardware Assisted Paging (HAP) not detected\n");
else if ( !opt_hap_enabled )
{
@@ -138,9 +138,9 @@ static int __init hvm_enable(void)
{
printk("HVM: Hardware Assisted Paging (HAP) detected\n");
printk("HVM: HAP page sizes: 4kB");
- if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
+ if ( fns->hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
printk(", 2MB%s", opt_hap_2mb ? "" : " [disabled]");
- if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
+ if ( fns->hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
printk(", 1GB%s", opt_hap_1gb ? "" : " [disabled]");
printk("\n");
}