lkml.org 
[lkml]   [2023]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v11 025/113] KVM: TDX: Use private memory for TDX
Date
On Thu, 2023-01-12 at 08:31 -0800, isaku.yamahata@intel.com wrote:
> From: Chao Peng <chao.p.peng@linux.intel.com>
>
> Override kvm_arch_has_private_mem() to use fd-based private memory.
> Return true when a VM has a type of KVM_X86_TDX_VM.
>
> Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
> Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
> ---
> arch/x86/kvm/x86.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index d548d3af6428..a8b555935fd8 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -13498,6 +13498,11 @@ int kvm_sev_es_string_io(struct kvm_vcpu *vcpu, unsigned int size,
> }
> EXPORT_SYMBOL_GPL(kvm_sev_es_string_io);
>
> +bool kvm_arch_has_private_mem(struct kvm *kvm)
> +{
> + return kvm->arch.vm_type == KVM_X86_TDX_VM;
> +}
> +

AMD's series has a different solution:

https://lore.kernel.org/lkml/20221214194056.161492-3-michael.roth@amd.com/

I think somehow this needs to get aligned.

Simply checking whether VM is TD certainly won't work for AMD, so my first
glance we should use something similar to AMD's solution. But I haven't
thought thoroughly that is absolutely needed, for instance, perhaps we can use
'gfn_shared_mask', etc.

\
 
 \ /
  Last update: 2023-03-26 23:42    [W:0.983 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site