Commit 6004311e authored by Kamal Mostafa's avatar Kamal Mostafa Committed by Stefan Bader

UBUNTU: SAUCE: remove ibrs_dump sysctl interface

BugLink: http://bugs.launchpad.net/bugs/1755627

The ibrs_dump sysctl interface landed in the Ubuntu backport
df043b74 ("x86/spec_ctrl: Add sysctl knobs to enable/disable
SPEC_CTRL feature") but nothing like it reached mainline.

This debug interface spams dmesg with many lines of output each time
/proc/sys/kernel/ibrs_dump is accessed (notably, every run of 'sysctl -a')
The interface returns only a dummy sysctl value; it has no other purpose
aside from generating dmesg output.

Remove the interface to squelch the excessive dmesg logging by 'sysctl -a'.

Fixes: df043b74 ("x86/spec_ctrl: Add sysctl knobs to enable/disable SPEC_CTRL feature")
Acked-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarLeann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 7c2dcaed
......@@ -205,8 +205,6 @@ int proc_dointvec_ibrs_ctrl(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
int proc_dointvec_ibpb_ctrl(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
int proc_dointvec_ibrs_dump(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
#endif
#ifdef CONFIG_MAGIC_SYSRQ
......@@ -245,7 +243,6 @@ extern struct ctl_table epoll_table[];
int sysctl_legacy_va_layout;
#endif
u32 sysctl_ibrs_dump = 0;
u32 sysctl_ibrs_enabled = 0;
EXPORT_SYMBOL(sysctl_ibrs_enabled);
u32 sysctl_ibpb_enabled = 0;
......@@ -1254,15 +1251,6 @@ static struct ctl_table kern_table[] = {
.extra1 = &zero,
.extra2 = &one,
},
{
.procname = "ibrs_dump",
.data = &sysctl_ibrs_dump,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_ibrs_dump,
.extra1 = &zero,
.extra2 = &one,
},
#endif
{ }
};
......@@ -2422,34 +2410,6 @@ int proc_dointvec_minmax(struct ctl_table *table, int write,
}
#ifdef CONFIG_X86
int proc_dointvec_ibrs_dump(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret, orig_inuse;
unsigned int cpu;
ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
printk("sysctl_ibrs_enabled = %u, sysctl_ibpb_enabled = %u\n", sysctl_ibrs_enabled, sysctl_ibpb_enabled);
printk("use_ibrs = %d, use_ibpb = %d\n", use_ibrs, use_ibpb);
mutex_lock(&spec_ctrl_mutex);
orig_inuse = use_ibrs;
/* temporary halt to ibrs usage to dump ibrs values */
clear_ibrs_inuse();
for_each_online_cpu(cpu) {
u64 val;
if (boot_cpu_has(X86_FEATURE_SPEC_CTRL))
rdmsrl_on_cpu(cpu, MSR_IA32_SPEC_CTRL, &val);
else
val = 0;
printk("read cpu %d ibrs val %lu\n", cpu, (unsigned long) val);
}
use_ibrs = orig_inuse;
mutex_unlock(&spec_ctrl_mutex);
return ret;
}
int proc_dointvec_ibrs_ctrl(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment