On 12/17/2009 11:33 AM, Sheng Yang wrote:
Before enabling, execution of "rdtscp" in guest would result in #UD. Signed-off-by: Sheng Yang<sheng@xxxxxxxxxxxxxxx> --- Reflect guest CPUID on vmcs fields as well, but it involved some more code which would only executed once... Do we need a callback there for post-"cpuid setting"?
I guess we do need a callback.
- /* Otherwise falls through to kvm_set_msr_common */ + ret = kvm_set_msr_common(vcpu, msr_index, data); + break; + case MSR_TSC_AUX: + if (!vcpu->arch.cpuid_rdtscp_enabled || !vmx_rdtscp_supported()) + return 1; + /* Check reserved bit */ + if ((data& 0xffff0000) != 0) + return 1;
It's 0xffffffff00000000...
@@ -913,6 +926,9 @@ static void setup_msrs(struct vcpu_vmx *vmx) index = __find_msr_index(vmx, MSR_CSTAR); if (index>= 0) move_msr_up(vmx, index, save_nmsrs++); + index = __find_msr_index(vmx, MSR_TSC_AUX); + if (index>= 0) + move_msr_up(vmx, index, save_nmsrs++);
Only do this if rdtscp is enabled! -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html