xen/arm: Advertise workaround 1 if we apply 3
authorBertrand Marquis <bertrand.marquis@arm.com>
Tue, 3 May 2022 09:38:30 +0000 (10:38 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 5 May 2022 10:50:05 +0000 (11:50 +0100)
commitaf570d1c90f1ed6040d724732f6c582383782e90
treec2d8ffa7227551be537e5aa1141cfea3adcd9c0e
parenta5968a553f6a6c170254520038f69cb49ff7d191
xen/arm: Advertise workaround 1 if we apply 3

SMCC_WORKAROUND_3 is handling both Spectre v2 and spectre BHB.
So when a guest is asking if we support workaround 1, tell yes if we
apply workaround 3 on exception entry as it handles it.

This will allow guests not supporting Spectre BHB but impacted by
spectre v2 to still handle it correctly.
The modified behaviour is coherent with what the Linux kernel does in
KVM for guests.

While there use ARM_SMCCC_SUCCESS instead of 0 for the return code value
for workaround detection to be coherent with Workaround 2 handling.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/vsmc.c