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();
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 )
{
{
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");
}
return 0;
}
-struct hvm_function_table * __init start_svm(void)
+const struct hvm_function_table * __init start_svm(void)
{
bool_t printed = 0;
svm_asid_g_invlpg(curr, vaddr);
}
-static struct hvm_function_table __read_mostly svm_function_table = {
+static struct hvm_function_table __initdata svm_function_table = {
.name = "SVM",
.cpu_up_prepare = svm_cpu_up_prepare,
.cpu_dead = svm_cpu_dead,
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,
.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);
extern bool_t cpu_has_lmsl;
extern s8 hvm_port80_allowed;
-extern struct hvm_function_table *start_svm(void);
-extern struct hvm_function_table *start_vmx(void);
+extern const struct hvm_function_table *start_svm(void);
+extern const struct hvm_function_table *start_vmx(void);
int hvm_domain_initialise(struct domain *d);
void hvm_domain_relinquish_resources(struct domain *d);