diff mbox series

[07/15] KVM: VMX: Support passthrough of architectural LBRs

Message ID 20220831223438.413090-8-weijiang.yang@intel.com (mailing list archive)
State New, archived
Headers show
Series Introduce Architectural LBR for vPMU | expand

Commit Message

Yang, Weijiang Aug. 31, 2022, 10:34 p.m. UTC
From: Paolo Bonzini <pbonzini@redhat.com>

MSR_ARCH_LBR_* can be pointed to by records->from, records->to and
records->info, so list them in is_valid_passthrough_msr.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/vmx/vmx.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Sean Christopherson Sept. 1, 2022, 2:20 p.m. UTC | #1
On Wed, Aug 31, 2022, Yang Weijiang wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> MSR_ARCH_LBR_* can be pointed to by records->from, records->to and
> records->info, so list them in is_valid_passthrough_msr.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

As the person sending the patches, these need your SOB.
Yang, Weijiang Sept. 2, 2022, 3:04 a.m. UTC | #2
On 9/1/2022 10:20 PM, Sean Christopherson wrote:
> On Wed, Aug 31, 2022, Yang Weijiang wrote:
>> From: Paolo Bonzini <pbonzini@redhat.com>
>>
>> MSR_ARCH_LBR_* can be pointed to by records->from, records->to and
>> records->info, so list them in is_valid_passthrough_msr.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> As the person sending the patches, these need your SOB.
Oops,  will add.
diff mbox series

Patch

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 020db207215b..77bad663d804 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -638,6 +638,9 @@  static bool is_valid_passthrough_msr(u32 msr)
 	case MSR_LBR_NHM_TO ... MSR_LBR_NHM_TO + 31:
 	case MSR_LBR_CORE_FROM ... MSR_LBR_CORE_FROM + 8:
 	case MSR_LBR_CORE_TO ... MSR_LBR_CORE_TO + 8:
+	case MSR_ARCH_LBR_FROM_0 ... MSR_ARCH_LBR_FROM_0 + 31:
+	case MSR_ARCH_LBR_TO_0 ... MSR_ARCH_LBR_TO_0 + 31:
+	case MSR_ARCH_LBR_INFO_0 ... MSR_ARCH_LBR_INFO_0 + 31:
 		/* LBR MSRs. These are handled in vmx_update_intercept_for_lbr_msrs() */
 		return true;
 	}