Skip to content

Commit aa3b39f

Browse files
vittyvkbonzini
authored andcommitted
KVM: SVM: drop unnecessary code in svm_hv_vmcb_dirty_nested_enlightenments()
Commit 3fa5e8f ("KVM: SVM: delay svm_vcpu_init_msrpm after svm->vmcb is initialized") re-arranged svm_vcpu_init_msrpm() call in svm_create_vcpu(), thus making the comment about vmcb being NULL obsolete. Drop it. While on it, drop superfluous vmcb_is_clean() check: vmcb_mark_dirty() is a bit flip, an extra check is unlikely to bring any performance gain. Drop now-unneeded vmcb_is_clean() helper as well. Fixes: 3fa5e8f ("KVM: SVM: delay svm_vcpu_init_msrpm after svm->vmcb is initialized") Signed-off-by: Vitaly Kuznetsov <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 38dfa83 commit aa3b39f

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

arch/x86/kvm/svm/svm.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,6 @@ static inline void vmcb_mark_all_clean(struct vmcb *vmcb)
304304
& ~VMCB_ALWAYS_DIRTY_MASK;
305305
}
306306

307-
static inline bool vmcb_is_clean(struct vmcb *vmcb, int bit)
308-
{
309-
return (vmcb->control.clean & (1 << bit));
310-
}
311-
312307
static inline void vmcb_mark_dirty(struct vmcb *vmcb, int bit)
313308
{
314309
vmcb->control.clean &= ~(1 << bit);

arch/x86/kvm/svm/svm_onhyperv.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,7 @@ static inline void svm_hv_vmcb_dirty_nested_enlightenments(
8686
struct hv_enlightenments *hve =
8787
(struct hv_enlightenments *)vmcb->control.reserved_sw;
8888

89-
/*
90-
* vmcb can be NULL if called during early vcpu init.
91-
* And its okay not to mark vmcb dirty during vcpu init
92-
* as we mark it dirty unconditionally towards end of vcpu
93-
* init phase.
94-
*/
95-
if (vmcb_is_clean(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS) &&
96-
hve->hv_enlightenments_control.msr_bitmap)
89+
if (hve->hv_enlightenments_control.msr_bitmap)
9790
vmcb_mark_dirty(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS);
9891
}
9992

0 commit comments

Comments
 (0)