[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220408004429.GA2864606@ls.amr.corp.intel.com>
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