From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Like Xu <like.xu.linux@gmail.com>
Subject: [PATCH 20/22] KVM: SVM: Rename SEV implemenations to conform to kvm_x86_ops hooks
Date: Fri, 28 Jan 2022 00:52:06 +0000 [thread overview]
Message-ID: <20220128005208.4008533-21-seanjc@google.com> (raw)
In-Reply-To: <20220128005208.4008533-1-seanjc@google.com>
Rename svm_vm_copy_asid_from() and svm_vm_migrate_from() to conform to
the names used by kvm_x86_ops, and opportunistically use "sev" instead of
"svm" to more precisely identify the role of the hooks.
svm_vm_copy_asid_from() in particular was poorly named as the function
does much more than simply copy the ASID.
No functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
arch/x86/kvm/svm/sev.c | 14 +++++++-------
arch/x86/kvm/svm/svm.c | 14 +++++++-------
arch/x86/kvm/svm/svm.h | 14 +++++++-------
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 7f346ddcae0a..4662e5fd7559 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -1681,7 +1681,7 @@ static int sev_es_migrate_from(struct kvm *dst, struct kvm *src)
return 0;
}
-int svm_vm_migrate_from(struct kvm *kvm, unsigned int source_fd)
+int sev_vm_move_enc_context_from(struct kvm *kvm, unsigned int source_fd)
{
struct kvm_sev_info *dst_sev = &to_kvm_svm(kvm)->sev_info;
struct kvm_sev_info *src_sev, *cg_cleanup_sev;
@@ -1761,7 +1761,7 @@ int svm_vm_migrate_from(struct kvm *kvm, unsigned int source_fd)
return ret;
}
-int svm_mem_enc_ioctl(struct kvm *kvm, void __user *argp)
+int sev_mem_enc_ioctl(struct kvm *kvm, void __user *argp)
{
struct kvm_sev_cmd sev_cmd;
int r;
@@ -1858,8 +1858,8 @@ int svm_mem_enc_ioctl(struct kvm *kvm, void __user *argp)
return r;
}
-int svm_register_enc_region(struct kvm *kvm,
- struct kvm_enc_region *range)
+int sev_mem_enc_register_region(struct kvm *kvm,
+ struct kvm_enc_region *range)
{
struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
struct enc_region *region;
@@ -1932,8 +1932,8 @@ static void __unregister_enc_region_locked(struct kvm *kvm,
kfree(region);
}
-int svm_unregister_enc_region(struct kvm *kvm,
- struct kvm_enc_region *range)
+int sev_mem_enc_unregister_region(struct kvm *kvm,
+ struct kvm_enc_region *range)
{
struct enc_region *region;
int ret;
@@ -1972,7 +1972,7 @@ int svm_unregister_enc_region(struct kvm *kvm,
return ret;
}
-int svm_vm_copy_asid_from(struct kvm *kvm, unsigned int source_fd)
+int sev_vm_copy_enc_context_from(struct kvm *kvm, unsigned int source_fd)
{
struct file *source_kvm_file;
struct kvm *source_kvm;
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 4b9041e931a8..a075c6458a27 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -1574,7 +1574,7 @@ static void svm_set_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
vmcb_mark_dirty(svm->vmcb, VMCB_DT);
}
-static void svm_post_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
+static void sev_post_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
{
struct vcpu_svm *svm = to_svm(vcpu);
@@ -4497,7 +4497,7 @@ static struct kvm_x86_ops svm_x86_ops __initdata = {
.get_cpl = svm_get_cpl,
.get_cs_db_l_bits = svm_get_cs_db_l_bits,
.set_cr0 = svm_set_cr0,
- .post_set_cr3 = svm_post_set_cr3,
+ .post_set_cr3 = sev_post_set_cr3,
.is_valid_cr4 = svm_is_valid_cr4,
.set_cr4 = svm_set_cr4,
.set_efer = svm_set_efer,
@@ -4581,12 +4581,12 @@ static struct kvm_x86_ops svm_x86_ops __initdata = {
.leave_smm = svm_leave_smm,
.enable_smi_window = svm_enable_smi_window,
- .mem_enc_ioctl = svm_mem_enc_ioctl,
- .mem_enc_register_region = svm_register_enc_region,
- .mem_enc_unregister_region = svm_unregister_enc_region,
+ .mem_enc_ioctl = sev_mem_enc_ioctl,
+ .mem_enc_register_region = sev_mem_enc_register_region,
+ .mem_enc_unregister_region = sev_mem_enc_unregister_region,
- .vm_copy_enc_context_from = svm_vm_copy_asid_from,
- .vm_move_enc_context_from = svm_vm_migrate_from,
+ .vm_copy_enc_context_from = sev_vm_copy_enc_context_from,
+ .vm_move_enc_context_from = sev_vm_move_enc_context_from,
.can_emulate_instruction = svm_can_emulate_instruction,
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
index 7cf81e029f9c..67c17509c4c0 100644
--- a/arch/x86/kvm/svm/svm.h
+++ b/arch/x86/kvm/svm/svm.h
@@ -598,13 +598,13 @@ void avic_vcpu_unblocking(struct kvm_vcpu *vcpu);
extern unsigned int max_sev_asid;
void sev_vm_destroy(struct kvm *kvm);
-int svm_mem_enc_ioctl(struct kvm *kvm, void __user *argp);
-int svm_register_enc_region(struct kvm *kvm,
- struct kvm_enc_region *range);
-int svm_unregister_enc_region(struct kvm *kvm,
- struct kvm_enc_region *range);
-int svm_vm_copy_asid_from(struct kvm *kvm, unsigned int source_fd);
-int svm_vm_migrate_from(struct kvm *kvm, unsigned int source_fd);
+int sev_mem_enc_ioctl(struct kvm *kvm, void __user *argp);
+int sev_mem_enc_register_region(struct kvm *kvm,
+ struct kvm_enc_region *range);
+int sev_mem_enc_unregister_region(struct kvm *kvm,
+ struct kvm_enc_region *range);
+int sev_vm_copy_enc_context_from(struct kvm *kvm, unsigned int source_fd);
+int sev_vm_move_enc_context_from(struct kvm *kvm, unsigned int source_fd);
void pre_sev_run(struct vcpu_svm *svm, int cpu);
void __init sev_set_cpu_caps(void);
void __init sev_hardware_setup(void);
--
2.35.0.rc0.227.g00780c9af4-goog
next prev parent reply other threads:[~2022-01-28 0:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 0:51 [PATCH 00/22] KVM: x86: Fill *_x86_ops via kvm-x86-ops.h Sean Christopherson
2022-01-28 0:51 ` [PATCH 01/22] KVM: x86: Drop unnecessary and confusing KVM_X86_OP_NULL macro Sean Christopherson
2022-01-28 10:11 ` Paolo Bonzini
2022-01-28 15:42 ` Sean Christopherson
2022-01-31 14:56 ` Paolo Bonzini
2022-01-31 15:19 ` Maxim Levitsky
2022-01-31 16:48 ` Sean Christopherson
2022-01-28 0:51 ` [PATCH 02/22] KVM: x86: Move delivery of non-APICv interrupt into vendor code Sean Christopherson
2022-01-28 0:51 ` [PATCH 03/22] KVM: x86: Drop export for .tlb_flush_current() static_call key Sean Christopherson
2022-01-28 0:51 ` [PATCH 04/22] KVM: x86: Rename kvm_x86_ops pointers to align w/ preferred vendor names Sean Christopherson
2022-01-28 0:51 ` [PATCH 05/22] KVM: x86: Use static_call() for .vcpu_deliver_sipi_vector() Sean Christopherson
2022-01-28 0:51 ` [PATCH 06/22] KVM: VMX: Call vmx_get_cpl() directly in handle_dr() Sean Christopherson
2022-01-28 0:51 ` [PATCH 07/22] KVM: xen: Use static_call() for invoking kvm_x86_ops hooks Sean Christopherson
2022-01-28 0:51 ` [PATCH 08/22] KVM: nVMX: Refactor PMU refresh to avoid referencing kvm_x86_ops.pmu_ops Sean Christopherson
2022-01-28 0:51 ` [PATCH 09/22] KVM: x86: Uninline and export hv_track_root_tdp() Sean Christopherson
2022-01-31 16:19 ` Vitaly Kuznetsov
2022-01-28 0:51 ` [PATCH 10/22] KVM: x86: Unexport kvm_x86_ops Sean Christopherson
2022-01-28 0:51 ` [PATCH 11/22] KVM: x86: Use static_call() for copy/move encryption context ioctls() Sean Christopherson
2022-01-28 0:51 ` [PATCH 12/22] KVM: x86: Allow different macros for APICv, CVM, and Hyper-V kvm_x86_ops Sean Christopherson
2022-01-28 0:51 ` [PATCH 13/22] KVM: VMX: Rename VMX functions to conform to kvm_x86_ops names Sean Christopherson
2022-01-28 0:52 ` [PATCH 14/22] KVM: VMX: Use kvm-x86-ops.h to fill vmx_x86_ops Sean Christopherson
2022-01-28 0:52 ` [PATCH 15/22] KVM: x86: Move get_cs_db_l_bits() helper to SVM Sean Christopherson
2022-01-28 0:52 ` [PATCH 16/22] KVM: SVM: Rename svm_flush_tlb() to svm_flush_tlb_current() Sean Christopherson
2022-01-28 0:52 ` [PATCH 17/22] KVM: SVM: Remove unused MAX_INST_SIZE #define Sean Christopherson
2022-01-28 0:52 ` [PATCH 18/22] KVM: SVM: Rename AVIC helpers to use "avic" prefix instead of "svm" Sean Christopherson
2022-01-28 0:52 ` [PATCH 19/22] KVM: x86: Use more verbose names for mem encrypt kvm_x86_ops hooks Sean Christopherson
2022-01-28 0:52 ` Sean Christopherson [this message]
2022-01-28 0:52 ` [PATCH 21/22] KVM: SVM: Rename hook implementations to conform to kvm_x86_ops' names Sean Christopherson
2022-01-28 0:52 ` [PATCH 22/22] KVM: SVM: Use kvm-x86-ops.h to fill svm_x86_ops Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220128005208.4008533-21-seanjc@google.com \
--to=seanjc@google.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=like.xu.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.