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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 May 2018 16:54:06 +0000 (18:54 +0200)
commit6befd3a735e0228b8128f2916309ed218d9c49dd
tree1b232fa74f75135cf444e86a5f0af47a723c60e3
parent3e6ab4ca1345b8b7ff09ea00e0abffa276c6919c
x86/bugs: Unify x86_spec_ctrl_{set_guest,restore_host}

commit cc69b34989210f067b2c51d5539b5f96ebcc3a01 upstream

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/spec-ctrl.h
arch/x86/kernel/cpu/bugs.c