x86/bugs: Unify x86_spec_ctrl_{set_guest,restore_host}

commit cc69b34989 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>
This commit is contained in:
Borislav Petkov 2018-05-12 00:14:51 +02:00 • committed by Greg Kroah-Hartman
commit 6befd3a735
2 changed files with 44 additions and 49 deletions