[PATCH v5 11/13] powerpc/pseries/papr-sysparm: Expose character device to user space

Nathan Lynch nathanl at linux.ibm.com
Wed Dec 13 02:38:49 AEDT 2023


Nathan Lynch via B4 Relay <devnull+nathanl.linux.ibm.com at kernel.org>
writes:
> +static long papr_sysparm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
> +{
> +	void __user *argp = (__force void __user *)arg;
> +	long ret;
> +
> +	switch (ioctl) {
> +	case PAPR_SYSPARM_IOC_GET:
> +		ret = papr_sysparm_ioctl_get(argp);
> +		break;
> +	case PAPR_SYSPARM_IOC_SET:
> +		ret = papr_sysparm_ioctl_set(argp);
> +		break;

Some offline discussion raised the point that updating system parameters
should be allowed only when the device is opened for writing. I've made
this change and added a testcase for v6, coming shortly.


More information about the Linuxppc-dev mailing list