RE: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the sgx_(vepc_)open()

2025-05-27 Thread Reshetova, Elena
e, Vishal ; linux-kernel@vger.kernel.org; > Mallick, Asit K ; Aktas, Erdem > ; Cai, Chong ; > bond...@google.com; sea...@google.com; dionnagl...@google.com > Subject: Re: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the > sgx_(vepc_)open() > > > > > > > > &g

Re: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the sgx_(vepc_)open()

2025-05-26 Thread Huang, Kai
> > > > > /* > > > diff --git a/arch/x86/kernel/cpu/sgx/main.c > > b/arch/x86/kernel/cpu/sgx/main.c > > > index 2de01b379aa3..a018b01b8736 100644 > > > --- a/arch/x86/kernel/cpu/sgx/main.c > > > +++ b/arch/x86/kernel/cpu/sgx/main.c > > > @@ -917,6 +917,20 @@ int sgx_set_attribute(unsigned long >

RE: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the sgx_(vepc_)open()

2025-05-26 Thread Reshetova, Elena
, > Asit K ; Scarlata, Vincent R > ; Cai, Chong ; Aktas, > Erdem ; Annapurve, Vishal > ; dionnagl...@google.com; > bond...@google.com; Raynor, Scott > Subject: Re: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the > sgx_(vepc_)open() > > On Fri, May 23, 2025 at

RE: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the sgx_(vepc_)open()

2025-05-26 Thread Reshetova, Elena
, Asit K > ; Scarlata, Vincent R > ; Cai, Chong ; Aktas, > Erdem ; Annapurve, Vishal > ; dionnagl...@google.com; > bond...@google.com; Raynor, Scott > Subject: Re: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the > sgx_(vepc_)open() > > /* > > diff --git a/

Re: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the sgx_(vepc_)open()

2025-05-23 Thread Jarkko Sakkinen
On Fri, May 23, 2025 at 08:58:54AM -0700, Dave Hansen wrote: > On 5/23/25 08:54, Jarkko Sakkinen wrote: > >> +void sgx_dec_usage_count(void) > >> +{ > >> + atomic64_dec(&sgx_usage_count); > >> +} > > I think these both should be static inlines in arch/x86/kernel/cpu/sgx.h. > > Global symbols is ov

Re: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the sgx_(vepc_)open()

2025-05-23 Thread Jarkko Sakkinen
On Thu, May 22, 2025 at 12:21:34PM +0300, Elena Reshetova wrote: > Currently SGX does not have a global counter to count the > active users from userspace or hypervisor. Implement such a counter, > sgx_usage_count. It will be used by the driver when attempting > to call EUPDATESVN SGX instruction.

Re: [PATCH v6 1/5] x86/sgx: Introduce a counter to count the sgx_(vepc_)open()

2025-05-23 Thread Dave Hansen
On 5/23/25 08:54, Jarkko Sakkinen wrote: >> +void sgx_dec_usage_count(void) >> +{ >> +atomic64_dec(&sgx_usage_count); >> +} > I think these both should be static inlines in arch/x86/kernel/cpu/sgx.h. > Global symbols is over the top. Even if I think disassembly (when doing > debugging, bug hunt