x86/xstate: make use_xsave non-init
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 6 Sep 2019 15:04:39 +0000 (17:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Sep 2019 15:04:39 +0000 (17:04 +0200)
commit021eb25a294c388c9b0124200bf2080c1e88eb83
tree4828c0f36ad2e554a02e93f65cff635656ab973c
parentaae639bc538778f4bf44f3f50d03e376f82108bb
x86/xstate: make use_xsave non-init

LLVM code generation can attempt to load from a variable in the next
condition of an expression under certain circumstances, thus
attempting to load use_xsave regardless of the value of the bsp
variable, which leads to a page fault when the init section has
already been unmapped.

Fix this by making use_xsave non-init, thus preventing the page fault;
use __read_mostly instead. The LLVM bug with the discussion about this
issue can be found at:

https://bugs.llvm.org/show_bug.cgi?id=39707

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/xstate.c