mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
x86: drop the uses of invbool_param()
There are only four users, and invbool_param() is an unnecessary cognitive overhead to use. Convert the four users to boolean_param(), and consistency use opt_* for the variable name. No change to the behaviour of the command line arguments. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
6dfe0d0aca
commit
fbf56e49ea
6 files changed
+19
-19
No files matched your search
@@ -30,8 +30,8 @@
|
||||
#include "util.h"
|
||||
#include "vmce.h"
|
||||
|
||||
bool_t __read_mostly mce_disabled;
|
||||
invbool_param("mce", mce_disabled);
|
||||
bool_t __read_mostly opt_mce = 1;
|
||||
boolean_param("mce", opt_mce);
|
||||
bool_t __read_mostly mce_broadcast = 0;
|
||||
bool_t is_mc_panic;
|
||||
unsigned int __read_mostly nr_mce_banks;
|
||||
@@ -627,7 +627,7 @@ static void set_poll_bankmask(struct cpuinfo_x86 *c)
|
||||
mb = per_cpu(poll_bankmask, cpu);
|
||||
BUG_ON(!mb);
|
||||
|
||||
if (cmci_support && !mce_disabled) {
|
||||
if (cmci_support && opt_mce) {
|
||||
mb->num = per_cpu(no_cmci_banks, cpu)->num;
|
||||
bitmap_copy(mb->bank_map, per_cpu(no_cmci_banks, cpu)->bank_map,
|
||||
nr_mce_banks);
|
||||
@@ -734,7 +734,7 @@ void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp)
|
||||
{
|
||||
enum mcheck_type inited = mcheck_none;
|
||||
|
||||
if ( mce_disabled )
|
||||
if ( !opt_mce )
|
||||
{
|
||||
if ( bsp )
|
||||
printk(XENLOG_INFO "MCE support disabled by bootparam\n");
|
||||
|
||||
@@ -587,7 +587,7 @@ static void cmci_discover(void)
|
||||
|
||||
static void mce_set_owner(void)
|
||||
{
|
||||
if (!cmci_support || mce_disabled == 1)
|
||||
if (!cmci_support || !opt_mce)
|
||||
return;
|
||||
|
||||
cmci_discover();
|
||||
@@ -600,7 +600,7 @@ static void __cpu_mcheck_distribute_cmci(void *unused)
|
||||
|
||||
static void cpu_mcheck_distribute_cmci(void)
|
||||
{
|
||||
if (cmci_support && !mce_disabled)
|
||||
if (cmci_support && opt_mce)
|
||||
on_each_cpu(__cpu_mcheck_distribute_cmci, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ static void clear_cmci(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!cmci_support || mce_disabled == 1)
|
||||
if (!cmci_support || !opt_mce)
|
||||
return;
|
||||
|
||||
mce_printk(MCE_VERBOSE, "CMCI: clear_cmci support on CPU%d\n",
|
||||
@@ -630,7 +630,7 @@ static void cpu_mcheck_disable(void)
|
||||
{
|
||||
clear_in_cr4(X86_CR4_MCE);
|
||||
|
||||
if (cmci_support && !mce_disabled)
|
||||
if (cmci_support && opt_mce)
|
||||
clear_cmci();
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ static int __init init_nonfatal_mce_checker(void)
|
||||
struct cpuinfo_x86 *c = &boot_cpu_data;
|
||||
|
||||
/* Check for MCE support */
|
||||
if (mce_disabled || !mce_available(c))
|
||||
if (!opt_mce || !mce_available(c))
|
||||
return -ENODEV;
|
||||
|
||||
if (__get_cpu_var(poll_bankmask) == NULL)
|
||||
|
||||
@@ -153,6 +153,6 @@ struct mca_error_handler
|
||||
};
|
||||
|
||||
/* Global variables */
|
||||
extern bool_t mce_disabled;
|
||||
extern bool_t opt_mce;
|
||||
|
||||
#endif /* X86_MCA_H */
|
||||
@@ -70,8 +70,8 @@
|
||||
# define pr_debug(fmt...)
|
||||
#endif
|
||||
|
||||
static __initdata bool_t no_mwait_idle;
|
||||
invbool_param("mwait-idle", no_mwait_idle);
|
||||
static __initdata bool_t opt_mwait_idle = 1;
|
||||
boolean_param("mwait-idle", opt_mwait_idle);
|
||||
|
||||
static unsigned int mwait_substates;
|
||||
|
||||
@@ -832,7 +832,7 @@ static int __init mwait_idle_probe(void)
|
||||
!mwait_substates)
|
||||
return -ENODEV;
|
||||
|
||||
if (!max_cstate || no_mwait_idle) {
|
||||
if (!max_cstate || !opt_mwait_idle) {
|
||||
pr_debug(PREFIX "disabled\n");
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ static unsigned int __initdata max_cpus;
|
||||
integer_param("maxcpus", max_cpus);
|
||||
|
||||
/* smep: Enable/disable Supervisor Mode Execution Protection (default on). */
|
||||
static bool_t __initdata disable_smep;
|
||||
invbool_param("smep", disable_smep);
|
||||
static bool_t __initdata opt_smep = 1;
|
||||
boolean_param("smep", opt_smep);
|
||||
|
||||
/* smap: Enable/disable Supervisor Mode Access Prevention (default on). */
|
||||
static bool_t __initdata disable_smap;
|
||||
invbool_param("smap", disable_smap);
|
||||
static bool_t __initdata opt_smap = 1;
|
||||
boolean_param("smap", opt_smap);
|
||||
|
||||
/* Boot dom0 in pvh mode */
|
||||
static bool_t __initdata opt_dom0pvh;
|
||||
@@ -1297,12 +1297,12 @@ void __init noreturn __start_xen(unsigned long mbi_p)
|
||||
|
||||
set_in_cr4(X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT);
|
||||
|
||||
if ( disable_smep )
|
||||
if ( !opt_smep )
|
||||
setup_clear_cpu_cap(X86_FEATURE_SMEP);
|
||||
if ( cpu_has_smep )
|
||||
set_in_cr4(X86_CR4_SMEP);
|
||||
|
||||
if ( disable_smap )
|
||||
if ( !opt_smap )
|
||||
setup_clear_cpu_cap(X86_FEATURE_SMAP);
|
||||
if ( cpu_has_smap )
|
||||
set_in_cr4(X86_CR4_SMAP);
|
||||
|
||||