From: Jack Lange Date: Mon, 24 Sep 2012 20:21:19 +0000 (-0400) Subject: update CPUID to disable unsupported features (MTRRS, ARET, APIC2) and globalize the... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=60628a7a3b37ac2dae5c033d3c4ee9e9f6af7d95;p=palacios.git update CPUID to disable unsupported features (MTRRS, ARET, APIC2) and globalize the hypervisor flag --- diff --git a/palacios/src/extensions/ext_vmware.c b/palacios/src/extensions/ext_vmware.c index 9026db9..ea1c789 100644 --- a/palacios/src/extensions/ext_vmware.c +++ b/palacios/src/extensions/ext_vmware.c @@ -89,13 +89,14 @@ static int vmware_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** priv V3_Print("Using VMWARE virtualization persona\n"); +/* v3_cpuid_add_fields(vm, 0x00000001, 0, 0, 0, 0, 0x80000000, 0x80000000, 0, 0 ); - +*/ v3_hook_io_port(vm, VMWARE_IO_PORT, io_read, io_write, diff --git a/palacios/src/palacios/vmm_cpuid.c b/palacios/src/palacios/vmm_cpuid.c index bd0862b..e36f5c2 100644 --- a/palacios/src/palacios/vmm_cpuid.c +++ b/palacios/src/palacios/vmm_cpuid.c @@ -46,6 +46,27 @@ void v3_init_cpuid_map(struct v3_vm_info * vm) { // Disable MONITOR/MWAIT (cpuid 0x01, ECX bit 3) v3_cpuid_add_fields(vm, 0x01, 0, 0, 0, 0, (1 << 3), 0, 0, 0); + + // disable MTRR + v3_cpuid_add_fields(vm, 0x00000001, 0, 0, 0, 0, 0, 0, (1 << 12), 0); + // disable PAT + v3_cpuid_add_fields(vm, 0x00000001, 0, 0, 0, 0, 0, 0, (1 << 16), 0); + // disable X2APIC + v3_cpuid_add_fields(vm, 0x00000001, 0, 0, 0, 0, (1 << 21), 0, 0, 0); + + + // Demarcate machine as a VM + v3_cpuid_add_fields(vm, 0x00000001, + 0, 0, + 0, 0, + 0x80000000, 0x80000000, + 0, 0 + ); + + + // disable ARAT + v3_cpuid_add_fields(vm, 0x00000006, (1 << 2), 0, 0, 0, 0, 0, 0, 0); + }