Skip to content

Commit 6986982

Browse files
committed
KVM: x86: rename update_bp_intercept to update_exception_bitmap
We would like to introduce a callback to update the #PF intercept when CPUID changes. Just reuse update_bp_intercept since VMX is already using update_exception_bitmap instead of a bespoke function. While at it, remove an unnecessary assignment in the SVM version, which is already done in the caller (kvm_arch_vcpu_ioctl_set_guest_debug) and has nothing to do with the exception bitmap. Reviewed-by: Jim Mattson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent ec7771a commit 6986982

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

arch/x86/include/asm/kvm_host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ struct kvm_x86_ops {
10571057
void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu);
10581058
void (*vcpu_put)(struct kvm_vcpu *vcpu);
10591059

1060-
void (*update_bp_intercept)(struct kvm_vcpu *vcpu);
1060+
void (*update_exception_bitmap)(struct kvm_vcpu *vcpu);
10611061
int (*get_msr)(struct kvm_vcpu *vcpu, struct msr_data *msr);
10621062
int (*set_msr)(struct kvm_vcpu *vcpu, struct msr_data *msr);
10631063
u64 (*get_segment_base)(struct kvm_vcpu *vcpu, int seg);

arch/x86/kvm/svm/svm.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ static void svm_set_segment(struct kvm_vcpu *vcpu,
16271627
vmcb_mark_dirty(svm->vmcb, VMCB_SEG);
16281628
}
16291629

1630-
static void update_bp_intercept(struct kvm_vcpu *vcpu)
1630+
static void update_exception_bitmap(struct kvm_vcpu *vcpu)
16311631
{
16321632
struct vcpu_svm *svm = to_svm(vcpu);
16331633

@@ -1636,8 +1636,7 @@ static void update_bp_intercept(struct kvm_vcpu *vcpu)
16361636
if (vcpu->guest_debug & KVM_GUESTDBG_ENABLE) {
16371637
if (vcpu->guest_debug & KVM_GUESTDBG_USE_SW_BP)
16381638
set_exception_intercept(svm, BP_VECTOR);
1639-
} else
1640-
vcpu->guest_debug = 0;
1639+
}
16411640
}
16421641

16431642
static void new_asid(struct vcpu_svm *svm, struct svm_cpu_data *sd)
@@ -4037,7 +4036,7 @@ static struct kvm_x86_ops svm_x86_ops __initdata = {
40374036
.vcpu_blocking = svm_vcpu_blocking,
40384037
.vcpu_unblocking = svm_vcpu_unblocking,
40394038

4040-
.update_bp_intercept = update_bp_intercept,
4039+
.update_exception_bitmap = update_exception_bitmap,
40414040
.get_msr_feature = svm_get_msr_feature,
40424041
.get_msr = svm_get_msr,
40434042
.set_msr = svm_set_msr,

arch/x86/kvm/vmx/vmx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7875,7 +7875,7 @@ static struct kvm_x86_ops vmx_x86_ops __initdata = {
78757875
.vcpu_load = vmx_vcpu_load,
78767876
.vcpu_put = vmx_vcpu_put,
78777877

7878-
.update_bp_intercept = update_exception_bitmap,
7878+
.update_exception_bitmap = update_exception_bitmap,
78797879
.get_msr_feature = vmx_get_msr_feature,
78807880
.get_msr = vmx_get_msr,
78817881
.set_msr = vmx_set_msr,

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9316,7 +9316,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
93169316
*/
93179317
kvm_set_rflags(vcpu, rflags);
93189318

9319-
kvm_x86_ops.update_bp_intercept(vcpu);
9319+
kvm_x86_ops.update_exception_bitmap(vcpu);
93209320

93219321
r = 0;
93229322

0 commit comments

Comments
 (0)