From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 1/3] xen/x86: Drop the uses of invbool_param()
Date: Mon, 8 Feb 2016 17:07:45 +0000 [thread overview]
Message-ID: <1454951267-30034-1-git-send-email-andrew.cooper3@citrix.com> (raw)
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>
---
CC: Jan Beulich <JBeulich@suse.com>
---
xen/arch/x86/cpu/mcheck/mce.c | 8 ++++----
xen/arch/x86/cpu/mcheck/mce_intel.c | 8 ++++----
xen/arch/x86/cpu/mcheck/non-fatal.c | 2 +-
xen/arch/x86/cpu/mcheck/x86_mca.h | 2 +-
xen/arch/x86/cpu/mwait-idle.c | 6 +++---
xen/arch/x86/setup.c | 12 ++++++------
6 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index d746d0e..cc446eb 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -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");
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index 193366b..0b7fe53 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -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();
}
diff --git a/xen/arch/x86/cpu/mcheck/non-fatal.c b/xen/arch/x86/cpu/mcheck/non-fatal.c
index 8cd6635..da5cae9 100644
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c
@@ -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)
diff --git a/xen/arch/x86/cpu/mcheck/x86_mca.h b/xen/arch/x86/cpu/mcheck/x86_mca.h
index 76467d6..e25d619 100644
--- a/xen/arch/x86/cpu/mcheck/x86_mca.h
+++ b/xen/arch/x86/cpu/mcheck/x86_mca.h
@@ -153,6 +153,6 @@ struct mca_error_handler
};
/* Global variables */
-extern bool_t mce_disabled;
+extern bool_t opt_mce;
#endif /* X86_MCA_H */
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 87f0e60..b86bdd7 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -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;
}
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 76c7b0f..b8a28d7 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -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);
--
2.1.4
next reply other threads:[~2016-02-08 17:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 17:07 Andrew Cooper [this message]
2016-02-08 17:07 ` [PATCH 2/3] xen/init: Drop invbool_param() Andrew Cooper
2016-02-09 12:47 ` Jan Beulich
2016-02-08 17:07 ` [PATCH 3/3] xen/init: Annotate all command line parameter infrastructure as const Andrew Cooper
2016-02-09 12:43 ` Jan Beulich
2016-02-09 13:52 ` Andrew Cooper
2016-02-09 14:32 ` Jan Beulich
2016-02-09 14:40 ` Andrew Cooper
2016-02-09 14:50 ` Jan Beulich
2016-02-22 16:36 ` Jan Beulich
2016-02-22 16:41 ` Andrew Cooper
2016-02-22 18:43 ` Doug Goldstein
2016-02-23 8:07 ` Jan Beulich
2016-02-09 12:46 ` [PATCH 1/3] xen/x86: Drop the uses of invbool_param() Jan Beulich
2016-02-11 9:58 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1454951267-30034-1-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).