From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 11/18] x86/xstate.c: use plain bool
Date: Fri, 30 Jun 2017 18:01:19 +0100 [thread overview]
Message-ID: <20170630170126.4148-12-wei.liu2@citrix.com> (raw)
In-Reply-To: <20170630170126.4148-1-wei.liu2@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
xen/arch/x86/xstate.c | 30 +++++++++++++++---------------
xen/include/asm-x86/xstate.h | 6 +++---
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index c2a722c60e..845208c189 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -37,7 +37,7 @@ static DEFINE_PER_CPU(uint64_t, xcr0);
/* Because XCR0 is cached for each CPU, xsetbv() is not exposed. Users should
* use set_xcr0() instead.
*/
-static inline bool_t xsetbv(u32 index, u64 xfeatures)
+static inline bool xsetbv(u32 index, u64 xfeatures)
{
u32 hi = xfeatures >> 32;
u32 lo = (u32)xfeatures;
@@ -54,12 +54,12 @@ static inline bool_t xsetbv(u32 index, u64 xfeatures)
return lo != 0;
}
-bool_t set_xcr0(u64 xfeatures)
+bool set_xcr0(u64 xfeatures)
{
if ( !xsetbv(XCR_XFEATURE_ENABLED_MASK, xfeatures) )
- return 0;
+ return false;
this_cpu(xcr0) = xfeatures;
- return 1;
+ return true;
}
uint64_t get_xcr0(void)
@@ -86,7 +86,7 @@ uint64_t get_msr_xss(void)
return this_cpu(xss);
}
-static int setup_xstate_features(bool_t bsp)
+static int setup_xstate_features(bool bsp)
{
unsigned int leaf, eax, ebx, ecx, edx;
@@ -482,10 +482,10 @@ void xrstor(struct vcpu *v, uint64_t mask)
}
}
-bool_t xsave_enabled(const struct vcpu *v)
+bool xsave_enabled(const struct vcpu *v)
{
if ( !cpu_has_xsave )
- return 0;
+ return false;
ASSERT(xsave_cntxt_size >= XSTATE_AREA_MIN_SIZE);
ASSERT(v->arch.xsave_area);
@@ -551,7 +551,7 @@ static unsigned int _xstate_ctxt_size(u64 xcr0)
{
u64 act_xcr0 = get_xcr0();
u32 eax, ebx = 0, ecx, edx;
- bool_t ok = set_xcr0(xcr0);
+ bool ok = set_xcr0(xcr0);
ASSERT(ok);
cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
@@ -577,10 +577,10 @@ unsigned int xstate_ctxt_size(u64 xcr0)
/* Collect the information of processor's extended state */
void xstate_init(struct cpuinfo_x86 *c)
{
- static bool_t __initdata use_xsave = 1;
+ static bool __initdata use_xsave = true;
boolean_param("xsave", use_xsave);
- bool_t bsp = c == &boot_cpu_data;
+ bool bsp = c == &boot_cpu_data;
u32 eax, ebx, ecx, edx;
u64 feature_mask;
@@ -645,25 +645,25 @@ void xstate_init(struct cpuinfo_x86 *c)
BUG();
}
-static bool_t valid_xcr0(u64 xcr0)
+static bool valid_xcr0(u64 xcr0)
{
/* FP must be unconditionally set. */
if ( !(xcr0 & XSTATE_FP) )
- return 0;
+ return false;
/* YMM depends on SSE. */
if ( (xcr0 & XSTATE_YMM) && !(xcr0 & XSTATE_SSE) )
- return 0;
+ return false;
if ( xcr0 & (XSTATE_OPMASK | XSTATE_ZMM | XSTATE_HI_ZMM) )
{
/* OPMASK, ZMM, and HI_ZMM require YMM. */
if ( !(xcr0 & XSTATE_YMM) )
- return 0;
+ return false;
/* OPMASK, ZMM, and HI_ZMM must be the same. */
if ( ~xcr0 & (XSTATE_OPMASK | XSTATE_ZMM | XSTATE_HI_ZMM) )
- return 0;
+ return false;
}
/* BNDREGS and BNDCSR must be the same. */
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index b31ad75bdb..d36f422b59 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -107,7 +107,7 @@ struct xstate_bndcsr {
};
/* extended state operations */
-bool_t __must_check set_xcr0(u64 xfeatures);
+bool __must_check set_xcr0(u64 xfeatures);
uint64_t get_xcr0(void);
void set_msr_xss(u64 xss);
uint64_t get_msr_xss(void);
@@ -115,7 +115,7 @@ uint64_t read_bndcfgu(void);
void xsave(struct vcpu *v, uint64_t mask);
void xrstor(struct vcpu *v, uint64_t mask);
void xstate_set_init(uint64_t mask);
-bool_t xsave_enabled(const struct vcpu *v);
+bool xsave_enabled(const struct vcpu *v);
int __must_check validate_xstate(u64 xcr0, u64 xcr0_accum,
const struct xsave_hdr *);
int __must_check handle_xsetbv(u32 index, u64 new_bv);
@@ -128,7 +128,7 @@ int xstate_alloc_save_area(struct vcpu *v);
void xstate_init(struct cpuinfo_x86 *c);
unsigned int xstate_ctxt_size(u64 xcr0);
-static inline bool_t xstate_all(const struct vcpu *v)
+static inline bool xstate_all(const struct vcpu *v)
{
/*
* XSTATE_FP_SSE may be excluded, because the offsets of XSTATE_FP_SSE
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-06-30 17:16 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 17:01 [PATCH 00/18] x86: more bool_t to bool cleanup Wei Liu
2017-06-30 17:01 ` [PATCH 01/18] x86/acpi: use plain bool Wei Liu
2017-06-30 17:01 ` [PATCH 02/18] x86/apic.c: " Wei Liu
2017-06-30 17:26 ` Andrew Cooper
2017-06-30 17:01 ` [PATCH 03/18] x86/debug.c: " Wei Liu
2017-06-30 17:28 ` Andrew Cooper
2017-06-30 17:01 ` [PATCH 04/18] x86/dmi.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 05/18] x86/domctl: " Wei Liu
2017-06-30 17:01 ` [PATCH 06/18] x86/hpet.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 07/18] x86/e820.c: use plan bool Wei Liu
2017-06-30 17:01 ` [PATCH 08/18] x86/i387.c: use plain bool Wei Liu
2017-06-30 17:01 ` [PATCH 09/18] x86/i8259.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 10/18] x86/monitor.c: " Wei Liu
2017-06-30 17:45 ` Andrew Cooper
2017-06-30 18:30 ` Razvan Cojocaru
2017-06-30 17:01 ` Wei Liu [this message]
2017-06-30 17:01 ` [PATCH 12/18] x86/srat.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 13/18] x86/smpboot.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 14/18] x86/io_apic.c: " Wei Liu
2017-06-30 17:53 ` Andrew Cooper
2017-06-30 17:01 ` [PATCH 15/18] x86/mpparse.c: " Wei Liu
2017-06-30 17:54 ` Andrew Cooper
2017-06-30 17:01 ` [PATCH 16/18] x86/numa.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 17/18] x86/msi.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 18/18] x86/psr.c: " Wei Liu
2017-06-30 18:00 ` [PATCH 00/18] x86: more bool_t to bool cleanup Andrew Cooper
2017-07-03 8:10 ` Jan Beulich
2017-07-03 12:54 ` Wei Liu
2017-07-03 13:19 ` Jan Beulich
2017-07-04 10:43 ` Wei Liu
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=20170630170126.4148-12-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xenproject.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).