Re: [PATCH 6/8] nitro_enclaves: Expose CPU pool state under sysfs
From: Arnd Bergmann
Date: Thu Jul 30 2026 - 13:14:41 EST
On Thu, Jul 30, 2026, at 14:53, Alexander Graf wrote:
> +static ssize_t total_show(struct device *dev, struct device_attribute *attr,
> + char *buf)
> +{
> + ssize_t ret;
> +
> + mutex_lock(&ne_cpu_pool.mutex);
> + ret = sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&ne_cpu_pool.pool_cpus));
> + mutex_unlock(&ne_cpu_pool.mutex);
> +
> + return ret;
> +}
> +static DEVICE_ATTR_RO(total);
> +
> +static ssize_t used_show(struct device *dev, struct device_attribute *attr,
> + char *buf)
> +{
> + ssize_t ret;
> +
> + mutex_lock(&ne_cpu_pool.mutex);
> + ret = sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&ne_cpu_pool.claimed_cpus));
> + mutex_unlock(&ne_cpu_pool.mutex);
> +
> + return ret;
> +}
> +static DEVICE_ATTR_RO(used);
The names are a bit inconsistent: you have pool/claimed for the internal
structure but total/used for the ABI. It might help to pick one set of
names here.
Arnd