use consistent values when consuming runtime-changeable parameters
authorJan Beulich <jbeulich@suse.com>
Wed, 31 Oct 2018 16:57:19 +0000 (17:57 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 31 Oct 2018 16:57:19 +0000 (17:57 +0100)
commitee91031be2852b9e132fddbc00a6eee38e6e23fc
tree42637ddc41491388fed74dc8072b43c37f0db1d7
parent8e751ac59cfd1143d095c45927ba1bec0d441ee4
use consistent values when consuming runtime-changeable parameters

There's no guarantee that e.g. a switch() control expression's memory
operand(s) get(s) read just once. Guard against the compiler producing
"unexpected" code by sprinkling around some ACCESS_ONCE().

I'm leaving alone opt_conswitch[]: It gets accessed in quite a few
places anyway, and an intermediate change won't have any severe effect
afaict.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/pv/domain.c
xen/drivers/char/console.c