[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/6 v3] KVM: nSVM: Fill in conforming svm_nested_ops via macro
From: |
Krish Sadhukhan |
Subject: |
[PATCH 3/6 v3] KVM: nSVM: Fill in conforming svm_nested_ops via macro |
Date: |
Tue, 28 Jul 2020 00:10:47 +0000 |
The names of the nested_svm_ops functions do not have a corresponding
'nested_svm_' prefix. Generate the names using a macro so that the names are
conformant. Fixing the naming will help in better readability and
maintenance of the code.
Suggested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
---
arch/x86/kvm/svm/nested.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index 3be6256..7cb834a 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -718,7 +718,7 @@ static int nested_svm_intercept(struct vcpu_svm *svm)
/*
* Host-intercepted exceptions have been checked already in
* nested_svm_exit_special. There is nothing to do here,
- * the vmexit is injected by svm_check_nested_events.
+ * the vmexit is injected by nested_svm_check_events().
*/
vmexit = NESTED_EXIT_DONE;
break;
@@ -850,7 +850,7 @@ static void nested_svm_init(struct vcpu_svm *svm)
}
-static int svm_check_nested_events(struct kvm_vcpu *vcpu)
+static int nested_svm_check_events(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
bool block_nested_events =
@@ -933,7 +933,7 @@ int nested_svm_exit_special(struct vcpu_svm *svm)
return NESTED_EXIT_CONTINUE;
}
-static int svm_get_nested_state(struct kvm_vcpu *vcpu,
+static int nested_svm_get_state(struct kvm_vcpu *vcpu,
struct kvm_nested_state __user
*user_kvm_nested_state,
u32 user_data_size)
{
@@ -990,7 +990,7 @@ static int svm_get_nested_state(struct kvm_vcpu *vcpu,
return kvm_state.size;
}
-static int svm_set_nested_state(struct kvm_vcpu *vcpu,
+static int nested_svm_set_state(struct kvm_vcpu *vcpu,
struct kvm_nested_state __user
*user_kvm_nested_state,
struct kvm_nested_state *kvm_state)
{
@@ -1075,8 +1075,10 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
return 0;
}
+#define KVM_X86_NESTED_OP(name) .name = nested_svm_##name
+
struct kvm_x86_nested_ops svm_nested_ops = {
- .check_events = svm_check_nested_events,
- .get_state = svm_get_nested_state,
- .set_state = svm_set_nested_state,
+ KVM_X86_NESTED_OP(check_events),
+ KVM_X86_NESTED_OP(get_state),
+ KVM_X86_NESTED_OP(set_state),
};
--
1.8.3.1
- [PATCH 0/6 v3] KVM: x86: Fill in conforming {vmx|svm}_x86_ops and {vmx|svm}_nested_ops via macros, Krish Sadhukhan, 2020/07/27
- [PATCH 1/6 v3] KVM: x86: Change names of some of the kvm_x86_ops functions to make them more semantical and readable, Krish Sadhukhan, 2020/07/27
- [PATCH 3/6 v3] KVM: nSVM: Fill in conforming svm_nested_ops via macro,
Krish Sadhukhan <=
- [PATCH 5/6 v3] KVM: nVMX: Fill in conforming vmx_nested_ops via macro, Krish Sadhukhan, 2020/07/27
- [PATCH 2/6 v3] KVM: SVM: Fill in conforming svm_x86_ops via macro, Krish Sadhukhan, 2020/07/27
- [PATCH 6/6 v3] QEMU: x86: Change KVM_MEMORY_ENCRYPT_* #defines to make them conformant to the kernel, Krish Sadhukhan, 2020/07/27
- [PATCH 4/6 v3] KVM: VMX: Fill in conforming vmx_x86_ops via macro, Krish Sadhukhan, 2020/07/27