x86/bugs: Unify x86_spec_ctrl_{set_guest,restore_host}
authorBorislav Petkov <bp@suse.de>
Fri, 11 May 2018 22:14:51 +0000 (00:14 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 17 May 2018 15:09:19 +0000 (17:09 +0200)
commitcc69b34989210f067b2c51d5539b5f96ebcc3a01
tree76b885e4b52b2901d9f0d6f3801669b203377429
parent0270be3e34efb05a88bc4c422572ece038ef3608
x86/bugs: Unify x86_spec_ctrl_{set_guest,restore_host}

Function bodies are very similar and are going to grow more almost
identical code. Add a bool arg to determine whether SPEC_CTRL is being set
for the guest or restored to the host.

No functional changes.

Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/include/asm/spec-ctrl.h
arch/x86/kernel/cpu/bugs.c