x86/spec_ctrl: Elide MSR_SPEC_CTRL handling in idle context when possible
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 7 May 2018 13:06:16 +0000 (14:06 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 16 May 2018 11:19:10 +0000 (12:19 +0100)
commit94df6e8588e35cc2028ccb3fd2921c6e6360605e
tree350a94f14c8897812a7ee5019a674569a8fadcb6
parentd9822b8a38114e96e4516dc998f4055249364d5d
x86/spec_ctrl: Elide MSR_SPEC_CTRL handling in idle context when possible

If Xen is virtualising MSR_SPEC_CTRL handling for guests, but using 0 as its
own MSR_SPEC_CTRL value, spec_ctrl_{enter,exit}_idle() need not write to the
MSR.

Requested-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/spec_ctrl.c
xen/include/asm-x86/cpufeatures.h
xen/include/asm-x86/spec_ctrl.h