KVM: SVM: Code move follow-up
cover KVM: SVM: Code move follow-up
From: Joerg Roedel <[email protected]>
Hi,
here is small series to follow-up on the review comments for moving the kvm-amd module code to its own sub-directory. The comments were only about renaming structs and symbols, so there are no functional changes in these patches.
The comments addressed here are all from [1].
Regards,
Joerg
[1] https://lore.kernel.org/lkml/[email protected]/
Joerg Roedel (4):
KVM: SVM: Rename struct nested_state to svm_nested_state
KVM: SVM: Add vmcb_ prefix to mark_*() functions
KVM: SVM: Add svm_ prefix to set/clr/is_intercept()
KVM: SVM: Rename svm_nested_virtualize_tpr() to
nested_svm_virtualize_tpr()
arch/x86/kvm/svm/avic.c | 2 +- arch/x86/kvm/svm/nested.c | 8 +-- arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/svm/svm.c | 138 +++++++++++++++++++------------------- arch/x86/kvm/svm/svm.h | 20 +++--- 5 files changed, 85 insertions(+), 85 deletions(-)
Signature · 1 line
2.27.0
PATCH 1/4 KVM: SVM: Rename struct nested_state to svm_nested_state
From: Joerg Roedel <[email protected]>
Renaming is only needed in the svm.h header file.
No functional changes.
--- arch/x86/kvm/svm/svm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/svm/svm.h +2 -2
@@ -81,7 +81,7 @@ struct kvm_svm {struct kvm_vcpu ; -struct nested_state { +struct svm_nested_state {struct vmcb *hsave;u64 hsave_msr;u64 vm_cr_msr;
@@ -133,7 +133,7 @@ struct vcpu_svm {ulong nmi_iret_rip; -struct nested_state nested; +struct svm_nested_state nested;bool nmi_singlestep;u64 nmi_singlestep_guest_rflags;
Signature · 1 line
2.27.0
PATCH 2/4 KVM: SVM: Add vmcb_ prefix to mark_*() functions
In reply to Joerg RoedelFrom: Joerg Roedel <[email protected]>
Make it more clear what data structure these functions operate on.
No functional changes.
--- arch/x86/kvm/svm/avic.c | 2 +- arch/x86/kvm/svm/nested.c | 6 +++--- arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/svm/svm.c | 44 +++++++++++++++++++-------------------- arch/x86/kvm/svm/svm.h | 8 +++---- 5 files changed, 31 insertions(+), 31 deletions(-)
arch/x86/kvm/svm/avic.c +1 -1
@@ -665,7 +665,7 @@ void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) }else { vmcb->control.int_ctl &= ~AVIC_ENABLE_MASK ; } -mark_dirty (vmcb,VMCB_AVIC ); +vmcb_mark_dirty (vmcb,VMCB_AVIC );svm_set_pi_irte_mode (vcpu, activated); }
arch/x86/kvm/svm/nested.c +3 -3
@@ -106,7 +106,7 @@ void recalc_intercepts(struct vcpu_svm *svm) {struct vmcb_control_area *c, *h, *g; -mark_dirty (svm->vmcb,VMCB_INTERCEPTS ); +vmcb_mark_dirty (svm->vmcb,VMCB_INTERCEPTS );if (!is_guest_mode (&svm->vcpu))return ;
@@ -375,7 +375,7 @@ static void nested_prepare_vmcb_control(struct vcpu_svm *svm)*/ recalc_intercepts (svm); -mark_all_dirty (svm->vmcb); +vmcb_mark_all_dirty (svm->vmcb); } void enter_svm_guest_mode(struct vcpu_svm *svm, u64 vmcb_gpa,
@@ -598,7 +598,7 @@ int nested_svm_vmexit(struct vcpu_svm *svm) svm->vmcb->save.cpl =0 ; svm->vmcb->control.exit_int_info =0 ; -mark_all_dirty (svm->vmcb); +vmcb_mark_all_dirty (svm->vmcb); trace_kvm_nested_vmexit_inject(nested_vmcb->control.exit_code, nested_vmcb->control.exit_info_1,
arch/x86/kvm/svm/sev.c +1 -1
@@ -1186,5 +1186,5 @@ void pre_sev_run(struct vcpu_svm *svm, int cpu) svm->last_cpu = cpu; sd->sev_vmcbs[asid] = svm->vmcb; svm->vmcb->control.tlb_ctl =TLB_CONTROL_FLUSH_ASID ; -mark_dirty (svm->vmcb,VMCB_ASID ); +vmcb_mark_dirty (svm->vmcb,VMCB_ASID ); }
arch/x86/kvm/svm/svm.c +22 -22
176 lines not on this page · raw message
arch/x86/kvm/svm/svm.h +4 -4
@@ -188,18 +188,18 @@ static inline struct kvm_svm *to_kvm_svm(struct kvm *kvm) return container_of(kvm, struct kvm_svm, kvm); } -static inline void mark_all_dirty (struct vmcb *vmcb) +static inline void vmcb_mark_all_dirty (struct vmcb *vmcb) { vmcb->control.clean =0 ; } -static inline void mark_all_clean (struct vmcb *vmcb) +static inline void vmcb_mark_all_clean (struct vmcb *vmcb) { vmcb->control.clean = ((1 <<VMCB_DIRTY_MAX ) -1 ) & ~VMCB_ALWAYS_DIRTY_MASK ; } -static inline void mark_dirty (struct vmcb *vmcb,int bit) +static inline void vmcb_mark_dirty (struct vmcb *vmcb,int bit) { vmcb->control.clean &= ~(1 << bit); }
@@ -420,7 +420,7 @@ extern int avic;static inline void avic_update_vapic_bar (struct vcpu_svm *svm,u64 data) { svm->vmcb->control.avic_vapic_bar = data &VMCB_AVIC_APIC_BAR_MASK ; -mark_dirty (svm->vmcb,VMCB_AVIC ); +vmcb_mark_dirty (svm->vmcb,VMCB_AVIC ); }static inline bool avic_vcpu_is_running (struct kvm_vcpu *vcpu)
Signature · 1 line
2.27.0
PATCH 3/4 KVM: SVM: Add svm_ prefix to set/clr/is_intercept()
In reply to Joerg RoedelFrom: Joerg Roedel <[email protected]>
Make clear the symbols belong to the SVM code when they are built-in.
No functional changes.
--- arch/x86/kvm/svm/nested.c | 2 +- arch/x86/kvm/svm/svm.c | 88 +++++++++++++++++++-------------------- arch/x86/kvm/svm/svm.h | 6 +-- 3 files changed, 48 insertions(+), 48 deletions(-)
arch/x86/kvm/svm/nested.c +1 -1
@@ -258,7 +258,7 @@ void sync_nested_vmcb_control(struct vcpu_svm *svm)/* Only a few fields of int_ctl are written by the processor. */ mask =V_IRQ_MASK |V_TPR_MASK ;if (!(svm->nested.ctl.int_ctl &V_INTR_MASKING_MASK ) && -is_intercept (svm,INTERCEPT_VINTR )) { +svm_is_intercept (svm,INTERCEPT_VINTR )) {/* * In order to request an interrupt window, L0 is usurping * svm->vmcb->control.int_ctl and possibly setting V_IRQ
arch/x86/kvm/svm/svm.c +44 -44
172 lines not on this page · raw message
arch/x86/kvm/svm/svm.h +3 -3
@@ -293,7 +293,7 @@ static inline void clr_exception_intercept(struct vcpu_svm *svm, int bit)recalc_intercepts (svm); } -static inline void set_intercept (struct vcpu_svm *svm,int bit) +static inline void svm_set_intercept (struct vcpu_svm *svm,int bit) {struct vmcb *vmcb =get_host_vmcb (svm);
@@ -302,7 +302,7 @@ static inline void set_intercept(struct vcpu_svm *svm, int bit)recalc_intercepts (svm); } -static inline void clr_intercept (struct vcpu_svm *svm,int bit) +static inline void svm_clr_intercept (struct vcpu_svm *svm,int bit) {struct vmcb *vmcb =get_host_vmcb (svm);
@@ -311,7 +311,7 @@ static inline void clr_intercept(struct vcpu_svm *svm, int bit)recalc_intercepts (svm); } -static inline bool is_intercept (struct vcpu_svm *svm,int bit) +static inline bool svm_is_intercept (struct vcpu_svm *svm,int bit) {return (svm->vmcb->control.intercept & (1ULL << bit)) !=0 ; }
Signature · 1 line
2.27.0
PATCH 4/4 KVM: SVM: Rename svm_nested_virtualize_tpr() to nested_svm_virtualize_tpr()
In reply to Joerg RoedelFrom: Joerg Roedel <[email protected]>
Match the naming with other nested svm functions.
No functional changes.
--- arch/x86/kvm/svm/svm.c | 6 +++--- arch/x86/kvm/svm/svm.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/kvm/svm/svm.c +3 -3
@@ -3040,7 +3040,7 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr) {struct vcpu_svm *svm =to_svm (vcpu); -if (svm_nested_virtualize_tpr (vcpu)) +if (nested_svm_virtualize_tpr (vcpu))return ;clr_cr_intercept (svm,INTERCEPT_CR8_WRITE );
@@ -3234,7 +3234,7 @@ static inline void sync_cr8_to_lapic(struct kvm_vcpu *vcpu) {struct vcpu_svm *svm =to_svm (vcpu); -if (svm_nested_virtualize_tpr (vcpu)) +if (nested_svm_virtualize_tpr (vcpu))return ;if (!is_cr_intercept (svm,INTERCEPT_CR8_WRITE )) {
@@ -3248,7 +3248,7 @@ static inline void sync_lapic_to_cr8(struct kvm_vcpu *vcpu)struct vcpu_svm *svm =to_svm (vcpu);u64 cr8; -if (svm_nested_virtualize_tpr (vcpu) || +if (nested_svm_virtualize_tpr (vcpu) ||kvm_vcpu_apicv_active (vcpu))return ;
arch/x86/kvm/svm/svm.h +1 -1
@@ -365,7 +365,7 @@ void svm_set_gif(struct vcpu_svm *svm, bool value);#define NESTED_EXIT_DONE 1/* Exit caused nested vmexit */ #define NESTED_EXIT_CONTINUE 2/* Further checks needed */ -static inline bool svm_nested_virtualize_tpr (struct kvm_vcpu *vcpu) +static inline bool nested_svm_virtualize_tpr (struct kvm_vcpu *vcpu) {struct vcpu_svm *svm =to_svm (vcpu);
Signature · 1 line
2.27.0
Re: [PATCH 4/4] KVM: SVM: Rename svm_nested_virtualize_tpr() to nested_svm_virtualize_tpr()
Quoted 48 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
Match the naming with other nested svm functions.
No functional changes.
Signed-off-by Joerg Roedel <[email protected]>--- arch/x86/kvm/svm/svm.c | 6 +++--- arch/x86/kvm/svm/svm.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)arch/x86/kvm/svm/svm.c +3
-3@@ -3040,7 +3040,7 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr) {struct vcpu_svm *svm =to_svm (vcpu); -if (svm_nested_virtualize_tpr (vcpu)) +if (nested_svm_virtualize_tpr (vcpu))return ;clr_cr_intercept (svm,INTERCEPT_CR8_WRITE );@@ -3234,7 +3234,7 @@ static inline void sync_cr8_to_lapic(struct kvm_vcpu *vcpu) {struct vcpu_svm *svm =to_svm (vcpu); -if (svm_nested_virtualize_tpr (vcpu)) +if (nested_svm_virtualize_tpr (vcpu))return ;if (!is_cr_intercept (svm,INTERCEPT_CR8_WRITE )) {@@ -3248,7 +3248,7 @@ static inline void sync_lapic_to_cr8(struct kvm_vcpu *vcpu)struct vcpu_svm *svm =to_svm (vcpu);u64 cr8; -if (svm_nested_virtualize_tpr (vcpu) || +if (nested_svm_virtualize_tpr (vcpu) ||kvm_vcpu_apicv_active (vcpu))return ;arch/x86/kvm/svm/svm.h +0
-0
arch/x86/kvm/svm/svm.h void svm_set_gif(struct vcpu_svm *svm, bool value); · line 371
Quoted 8 lines
arch/x86/kvm/svm/svm.h +1
-1@@ -365,7 +365,7 @@ void svm_set_gif(struct vcpu_svm *svm, bool value);#define NESTED_EXIT_DONE 1/* Exit caused nested vmexit */ #define NESTED_EXIT_CONTINUE 2/* Further checks needed */ -static inline bool svm_nested_virtualize_tpr (struct kvm_vcpu *vcpu) +static inline bool nested_svm_virtualize_tpr (struct kvm_vcpu *vcpu) {struct vcpu_svm *svm =to_svm (vcpu);
Should the name be changed to svm_nested_virtualized_tpr ? Because svm_nested_virtualize_tpr implies that the action of the function is to virtualize the TPR.
Quoted 9 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
Hi,
here is small series to follow-up on the review comments for moving the kvm-amd module code to its own sub-directory. The comments were only about renaming structs and symbols, so there are no functional changes in these patches.
Quoted 8 lines
The comments addressed here are all from [1].
Regards,
Joerg
Thank you for the follow-up!
Quoted 7 lines
Joerg Roedel (4):
KVM: SVM: Rename structnested_statetosvm_nested_state
KVM: SVM: Addvmcb_prefix to mark_*() functions
KVM: SVM: Addsvm_prefix to set/clr/is_intercept()
KVM: SVM: Renamesvm_nested_virtualize_tpr()to
nested_svm_virtualize_tpr()
Quoted 6 lines
arch/x86/kvm/svm/avic.c | 2 +- arch/x86/kvm/svm/nested.c | 8 +-- arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/svm/svm.c | 138 +++++++++++++++++++------------------- arch/x86/kvm/svm/svm.h | 20 +++--- 5 files changed, 85 insertions(+), 85 deletions(-)
Series:
Signature · 1 line
Vitaly
Quoted 11 lines · Vitaly Kuznetsov
Quoted 9 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
Hi,
here is small series to follow-up on the review comments for moving the kvm-amd module code to its own sub-directory. The comments were only about renaming structs and symbols, so there are no functional changes in these patches.
Quoted 8 lines
Quoted 8 lines
The comments addressed here are all from [1].
Regards,
Joerg
Queued, thanks.
Paolo
Quoted 19 lines
Thank you for the follow-up!
Quoted 7 lines
Joerg Roedel (4):
KVM: SVM: Rename structnested_statetosvm_nested_state
KVM: SVM: Addvmcb_prefix to mark_*() functions
KVM: SVM: Addsvm_prefix to set/clr/is_intercept()
KVM: SVM: Renamesvm_nested_virtualize_tpr()to
nested_svm_virtualize_tpr()Quoted 6 lines
arch/x86/kvm/svm/avic.c | 2 +- arch/x86/kvm/svm/nested.c | 8 +-- arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/svm/svm.c | 138 +++++++++++++++++++------------------- arch/x86/kvm/svm/svm.h | 20 +++--- 5 files changed, 85 insertions(+), 85 deletions(-)Series:
Reviewed-by Vitaly Kuznetsov <[email protected]>
Quoted 24 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
Hi,
here is small series to follow-up on the review comments for moving the kvm-amd module code to its own sub-directory. The comments were only about renaming structs and symbols, so there are no functional changes in these patches.
The comments addressed here are all from [1].
Regards,
Joerg
[1] https://lore.kernel.org/lkml/[email protected]/
Joerg Roedel (4):
KVM: SVM: Rename structnested_statetosvm_nested_state
KVM: SVM: Addvmcb_prefix to mark_*() functions
KVM: SVM: Addsvm_prefix to set/clr/is_intercept()
KVM: SVM: Renamesvm_nested_virtualize_tpr()to
nested_svm_virtualize_tpr()
Quoted 7 lines
arch/x86/kvm/svm/avic.c | 2 +- arch/x86/kvm/svm/nested.c | 8 +-- arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/svm/svm.c | 138 +++++++++++++++++++------------------- arch/x86/kvm/svm/svm.h | 20 +++--- 5 files changed, 85 insertions(+), 85 deletions(-)