Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
xen.11319
5b6d8ce2-x86-XPTI-parsing.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5b6d8ce2-x86-XPTI-parsing.patch of Package xen.11319
# Commit 2a3b34ec47817048ab59586855cf0709fc77487e # Date 2018-08-10 14:02:26 +0100 # Author Andrew Cooper <andrew.cooper3@citrix.com> # Committer Andrew Cooper <andrew.cooper3@citrix.com> x86/spec-ctrl: Yet more fixes for xpti= parsing As it currently stands, 'xpti=dom0' is indistinguishable from the default value, which means it will be overridden by ARCH_CAPABILITIES_RDCL_NO on fixed hardware. Switch opt_xpti to use -1 as a default like all our other related options, and clobber it as soon as we have a string to parse. In addition, 'xpti' alone should be interpreted in its positive boolean form, rather than resulting in a parse error. (XEN) parameter "xpti" has invalid value "", rc=-22! Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> --- a/xen/arch/x86/spec_ctrl.c +++ b/xen/arch/x86/spec_ctrl.c @@ -208,8 +208,7 @@ static void __init print_details(enum in opt_xpti & OPT_XPTI_DOMU ? "enabled" : "disabled"); } -#define OPT_XPTI_DEFAULT 0xff -uint8_t __read_mostly opt_xpti = OPT_XPTI_DEFAULT; +int8_t __read_mostly opt_xpti = -1; static __init void xpti_init_default(uint64_t caps) { @@ -227,6 +226,14 @@ static __init int parse_xpti(char *s) char *ss; int val, rc = 0; + /* Inhibit the defaults as an explicit choice has been given. */ + if ( opt_xpti == -1 ) + opt_xpti = 0; + + /* Interpret 'xpti' alone in its positive boolean form. */ + if ( *s == '\0' ) + opt_xpti = OPT_XPTI_DOM0 | OPT_XPTI_DOMU; + do { ss = strchr(s, ','); if ( ss ) @@ -244,7 +251,7 @@ static __init int parse_xpti(char *s) default: if ( !strcmp(s, "default") ) - opt_xpti = OPT_XPTI_DEFAULT; + opt_xpti = -1; else if ( (val = parse_boolean("dom0", s, ss)) >= 0 ) opt_xpti = (opt_xpti & ~OPT_XPTI_DOM0) | (val ? OPT_XPTI_DOM0 : 0); @@ -412,7 +419,7 @@ void __init init_speculation_mitigations /* (Re)init BSP state now that default_xen_* have been calculated. */ init_shadow_spec_ctrl_state(); - if ( opt_xpti == OPT_XPTI_DEFAULT ) + if ( opt_xpti == -1 ) xpti_init_default(caps); print_details(thunk, caps); --- a/xen/include/asm-x86/spec_ctrl.h +++ b/xen/include/asm-x86/spec_ctrl.h @@ -34,7 +34,7 @@ extern bool_t bsp_delay_spec_ctrl; extern int8_t default_xen_spec_ctrl; extern uint8_t default_xen_rsb; -extern uint8_t opt_xpti; +extern int8_t opt_xpti; #define OPT_XPTI_DOM0 0x01 #define OPT_XPTI_DOMU 0x02
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor