KVM: SVM: Prepare for new bit definition in lbr_ctl
The lbr_ctl variable in the vmcb control area is used to enable or disable Last Branch Record (LBR) virtualization. However, this is to be done using only bit 0 of the variable. To correct this and to prepare for a new feature, change the current usage to work only on a particular bit. Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
This commit is contained in:

committed by
Radim Krčmář

parent
b742c1e6e7
commit
8a77e90966
@@ -947,7 +947,7 @@ static void svm_enable_lbrv(struct vcpu_svm *svm)
|
||||
{
|
||||
u32 *msrpm = svm->msrpm;
|
||||
|
||||
svm->vmcb->control.lbr_ctl = 1;
|
||||
svm->vmcb->control.lbr_ctl |= LBR_CTL_ENABLE_MASK;
|
||||
set_msr_interception(msrpm, MSR_IA32_LASTBRANCHFROMIP, 1, 1);
|
||||
set_msr_interception(msrpm, MSR_IA32_LASTBRANCHTOIP, 1, 1);
|
||||
set_msr_interception(msrpm, MSR_IA32_LASTINTFROMIP, 1, 1);
|
||||
@@ -958,7 +958,7 @@ static void svm_disable_lbrv(struct vcpu_svm *svm)
|
||||
{
|
||||
u32 *msrpm = svm->msrpm;
|
||||
|
||||
svm->vmcb->control.lbr_ctl = 0;
|
||||
svm->vmcb->control.lbr_ctl &= ~LBR_CTL_ENABLE_MASK;
|
||||
set_msr_interception(msrpm, MSR_IA32_LASTBRANCHFROMIP, 0, 0);
|
||||
set_msr_interception(msrpm, MSR_IA32_LASTBRANCHTOIP, 0, 0);
|
||||
set_msr_interception(msrpm, MSR_IA32_LASTINTFROMIP, 0, 0);
|
||||
|
Reference in New Issue
Block a user