lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8bPljsAF+lSnWtC@google.com>
Date:   Tue, 17 Jan 2023 16:40:54 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     "Huang, Kai" <kai.huang@...el.com>
Cc:     "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Yamahata, Isaku" <isaku.yamahata@...el.com>,
        "chao.p.peng@...ux.intel.com" <chao.p.peng@...ux.intel.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "Shahar, Sagi" <sagis@...gle.com>,
        "Aktas, Erdem" <erdemaktas@...gle.com>,
        "isaku.yamahata@...il.com" <isaku.yamahata@...il.com>,
        "dmatlack@...gle.com" <dmatlack@...gle.com>
Subject: Re: [PATCH v11 025/113] KVM: TDX: Use private memory for TDX

On Mon, Jan 16, 2023, Huang, Kai wrote:
> On Thu, 2023-01-12 at 08:31 -0800, isaku.yamahata@...el.com wrote:
> > From: Chao Peng <chao.p.peng@...ux.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@...ux.intel.com>
> > Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.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.

Ya.  My thought is

 bool kvm_arch_has_private_mem(struct kvm *kvm)
 {
	return kvm->arch.vm_type != KVM_X86_DEFAULT_VM;
 }

where the VM types end up being:

 #define KVM_X86_DEFAULT_VM	0
 #define KVM_X86_PROTECTED_VM	1
 #define KVM_X86_TDX_VM		2
 #define KVM_X86_SNP_VM		3

Don't spend too much time reworking the TDX series at this point, I'm going to do
a trial run of combining UPM+TDX+SNP sometime in the next few weeks to see how all
the pieces fit together, this is one of the common touchpoints that I'll make sure
to look at.  Though if you have ideas on, by all means post them.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ