diff options
author | Max Bruning <max@joyent.com> | 2011-09-07 09:56:21 +0000 |
---|---|---|
committer | Super-User <root@max.joyent.us> | 2011-09-07 09:57:57 +0000 |
commit | 9d65acf8d278973795ed67e52b244fbcf5e2144e (patch) | |
tree | 32c214be4f2d46aac1cbced68c7f2be595272046 | |
parent | 14398618fb51518a164d00cba924fc080eb54081 (diff) | |
download | illumos-kvm-9d65acf8d278973795ed67e52b244fbcf5e2144e.tar.gz |
HVM-640 Need to implement vmx_disabled_by_bios
-rw-r--r-- | kvm_vmx.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1303,6 +1303,18 @@ vmx_has_kvm_support(void) } static int +vmx_disabled_by_bios(void) +{ + uint64_t msr; + + rdmsrl(MSR_IA32_FEATURE_CONTROL, msr); + return (msr & (FEATURE_CONTROL_LOCKED | + FEATURE_CONTROL_VMXON_ENABLED)) + == FEATURE_CONTROL_LOCKED; + /* locked but not enabled */ +} + +static int vmx_hardware_enable(void *garbage) { int cpu = curthread->t_cpu->cpu_seqid; @@ -4487,7 +4499,7 @@ vmx_cpuid_update(struct kvm_vcpu *vcpu) struct kvm_x86_ops vmx_x86_ops = { .cpu_has_kvm_support = vmx_has_kvm_support, - .disabled_by_bios = nulldev, /* XXX: vmx_disabled_by_bios? */ + .disabled_by_bios = vmx_disabled_by_bios, .hardware_enable = vmx_hardware_enable, .hardware_disable = vmx_hardware_disable, |