Re: [PATCH v16 05/16] x86/sgx: Implement basic EPC misc cgroup functionality

From: Huang, Kai
Date: Tue Aug 27 2024 - 06:21:27 EST


On Tue, 2024-08-20 at 18:53 -0700, Haitao Huang wrote:
> +/**
> + * Register capacity and ops for SGX cgroup.
> + * Only called at the end of sgx_init() when SGX is ready to handle the ops
> + * callbacks.
> + */

Got this warning when building with W=1:

arch/x86/kernel/cpu/sgx/epc_cgroup.c:420: warning: This comment starts with
'/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-
doc.rst
* Register capacity and ops for SGX cgroup.

It should be fixed.

> +void __init sgx_cgroup_register(void)
> +{
> + unsigned int nid = first_node(sgx_numa_mask);
> + unsigned int first = nid;
> + u64 capacity = 0;
> +
> + misc_cg_set_ops(MISC_CG_RES_SGX_EPC, &sgx_cgroup_ops);
> +
> + /* sgx_numa_mask is not empty when this is called */
> + do {
> + capacity += sgx_numa_nodes[nid].size;
> + nid = next_node_in(nid, sgx_numa_mask);
> + } while (nid != first);
> + misc_cg_set_capacity(MISC_CG_RES_SGX_EPC, capacity);
> +}

Nit (leave to you):

Is sgx_cgroup_enable() better?