Re: [PATCH 4/4] KVM: VMX: Add instruction rdtscp support for guest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 17 December 2009 18:39:22 Avi Kivity wrote:
> 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...

... /me blame himself...
> 
> > @@ -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!

/me blame himself again...

-- 
regards
Yang, Sheng

--
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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux