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]
Date:   Thu, 7 Apr 2022 17:44:29 -0700
From:   Isaku Yamahata <isaku.yamahata@...il.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     isaku.yamahata@...el.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, isaku.yamahata@...il.com,
        Jim Mattson <jmattson@...gle.com>, erdemaktas@...gle.com,
        Connor Kuehl <ckuehl@...hat.com>,
        Sean Christopherson <seanjc@...gle.com>
Subject: Re: [RFC PATCH v5 020/104] KVM: TDX: allocate per-package mutex

On Tue, Apr 05, 2022 at 02:39:51PM +0200,
Paolo Bonzini <pbonzini@...hat.com> wrote:

> On 3/4/22 20:48, isaku.yamahata@...el.com wrote:
> > From: Isaku Yamahata <isaku.yamahata@...el.com>
> > 
> > Several TDX SEAMCALLs are per-package scope (concretely per memory
> > controller) and they need to be serialized per-package.  Allocate mutex for
> > it.
> > 
> > Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.com>
> > ---
> >   arch/x86/kvm/vmx/main.c    |  8 +++++++-
> >   arch/x86/kvm/vmx/tdx.c     | 18 ++++++++++++++++++
> >   arch/x86/kvm/vmx/x86_ops.h |  2 ++
> >   3 files changed, 27 insertions(+), 1 deletion(-)
> 
> Please define here the lock/unlock functions as well:
> 
> static inline int tdx_mng_key_lock(void)
> {
> 	int cpu = get_cpu();
> 	cur_pkg = topology_physical_package_id(cpu);
> 
> 	mutex_lock(&tdx_mng_key_config_lock[cur_pkg]);
> 	return cur_pkg;
> }
> 
> static inline void tdx_mng_key_unlock(int cur_pkg)
> {
> 	mutex_unlock(&tdx_mng_key_config_lock[cur_pkg]);
> 	put_cpu();
> }

Sure, will do in the next respoin.
-- 
Isaku Yamahata <isaku.yamahata@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ