arm64: KVM: Handle guest's ARCH_WORKAROUND_2 requests
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 20 Jul 2018 09:53:11 +0000 (10:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Jul 2018 12:28:51 +0000 (14:28 +0200)
commit1b749f8a241639951a9c65e64f51e7a6ac5b6ae9
treefce9efa0ccf5529a21621013d33b096700b7c18b
parent805357aa65bbc419451fb9556968687c7fd1d2e1
arm64: KVM: Handle guest's ARCH_WORKAROUND_2 requests

commit b4f18c063a13dfb33e3a63fe1844823e19c2265e upstream.

In order to forward the guest's ARCH_WORKAROUND_2 calls to EL3,
add a small(-ish) sequence to handle it at EL2. Special care must
be taken to track the state of the guest itself by updating the
workaround flags. We also rely on patching to enable calls into
the firmware.

Note that since we need to execute branches, this always executes
after the Spectre-v2 mitigation has been applied.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/asm-offsets.c
arch/arm64/kvm/hyp/hyp-entry.S