]> git.baikalelectronics.ru Git - kernel.git/commit
x86/intel_rdt: Fix data type in parsing callbacks
authorXiaochen Shen <xiaochen.shen@intel.com>
Sat, 15 Sep 2018 21:58:19 +0000 (14:58 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Sep 2018 21:38:05 +0000 (23:38 +0200)
commitae5be4edda11003fce605df4b9b9006c2c011ac1
tree97ad6969ff38d68cbb26ad8496cc5f46cba7efc1
parent5a70e8b863733c1e20286756d4cb453dc2bed38b
x86/intel_rdt: Fix data type in parsing callbacks

Each resource is associated with a parsing callback to parse the data
provided from user space when writing schemata file.

The 'data' parameter in the callbacks is defined as a void pointer which
is error prone due to lack of type check.

parse_bw() processes the 'data' parameter as a string while its caller
actually passes the parameter as a pointer to struct rdt_cbm_parse_data.
Thus, parse_bw() takes wrong data and causes failure of parsing MBA
throttle value.

To fix the issue, the 'data' parameter in all parsing callbacks is defined
and handled as a pointer to struct rdt_parse_data (renamed from struct
rdt_cbm_parse_data).

Fixes: be5e49430eb7 ("x86/intel_rdt: Support flexible data to parsing callbacks")
Fixes: 7b3864c3c560 ("x86/intel_rdt: Ensure requested schemata respects mode")
Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "H Peter Anvin" <hpa@zytor.com>
Cc: "Tony Luck" <tony.luck@intel.com>
Cc: "Chen Yu" <yu.c.chen@intel.com>
Link: https://lkml.kernel.org/r/1537048707-76280-2-git-send-email-fenghua.yu@intel.com
arch/x86/kernel/cpu/intel_rdt.h
arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c