lkml.org 
[lkml]   [2022]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v5 020/104] KVM: TDX: allocate per-package mutex
On Tue, Apr 05, 2022 at 02:39:51PM +0200,
Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 3/4/22 20:48, isaku.yamahata@intel.com wrote:
> > From: Isaku Yamahata <isaku.yamahata@intel.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@intel.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@gmail.com>

\
 
 \ /
  Last update: 2022-04-08 02:46    [W:0.166 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site