Re: [PATCH v2 3/5] KVM: SVM: Manually context switch DEBUGCTL if LBR virtualization is disabled

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

 



>> Somewhat related but independent: CPU automatically clears DEBUGCTL[BTF]
>> on #DB exception. So, when DEBUGCTL is save/restored by KVM (i.e. when
>> LBR virtualization is disabled), it's KVM's responsibility to clear
>> DEBUGCTL[BTF].
>> ---
>> @@ -2090,6 +2090,14 @@ static int db_interception(struct kvm_vcpu *vcpu)
>>  	      (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP)) &&
>>  		!svm->nmi_singlestep) {
>>  		u32 payload = svm->vmcb->save.dr6 ^ DR6_ACTIVE_LOW;
>> +
>> +		/*
>> +		 * CPU automatically clears DEBUGCTL[BTF] on #DB exception.
>> +		 * Simulate it when DEBUGCTL isn't auto save/restored.
>> +		 */
>> +		if (!(svm->vmcb->control.virt_ext & LBR_CTL_ENABLE_MASK))
>> +			svm->vmcb->save.dbgctl &= ~0x2;
> 
> Any reason not to clear is unconditionally?
> 
> 		svm->vmcb->save.dbgctl &= ~DEBUGCTLMSR_BTF;

No particular reason, just that HW would have already done it when LBRV
is enabled.

Thanks,
Ravi




[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