Re: [PATCH 5.10 38/58] KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A

Pavel Machek
2022-03-10T23:49:06Z

[-- Attachment #1: Type: text/plain, Size: 1510 bytes --]

Hi!

What is going on here?

> commit 5bdf3437603d4af87f9c7f424b0c8aeed2420745 upstream.

Upstream commit 5bdf is very different from this. In particular,

> arch/arm64/kvm/hyp/smccc_wa.S | 66 +++++++++++++++++++++++++++++++++++++++

I can't find smccc_wa.S, neither in mainline, nor in -next. And it
looks buggy. I suspect loop_k24 should loop 24 times, but it does 8
loops AFAICT. Same problem with loop_k32.

Best regards,
Pavel
> --- a/arch/arm64/kvm/hyp/smccc_wa.S
> +++ b/arch/arm64/kvm/hyp/smccc_wa.S
> +
> + .global __spectre_bhb_loop_k24
> +SYM_DATA_START(__spectre_bhb_loop_k24)
> + esb
> + sub sp, sp, #(8 * 2)
> + stp x0, x1, [sp, #(8 * 0)]
> + mov x0, #8
> +2: b . + 4
> + subs x0, x0, #1
> + b.ne 2b
> + dsb nsh
> + isb
> + ldp x0, x1, [sp, #(8 * 0)]
> + add sp, sp, #(8 * 2)
> +1: .org __spectre_bhb_loop_k24 + __SPECTRE_BHB_LOOP_SZ
> + .org 1b
> +SYM_DATA_END(__spectre_bhb_loop_k24)
> +
> + .global __spectre_bhb_loop_k32
> +SYM_DATA_START(__spectre_bhb_loop_k32)
> + esb
> + sub sp, sp, #(8 * 2)
> + stp x0, x1, [sp, #(8 * 0)]
> + mov x0, #8
> +2: b . + 4
> + subs x0, x0, #1
> + b.ne 2b
> + dsb nsh
> + isb
> + ldp x0, x1, [sp, #(8 * 0)]
> + add sp, sp, #(8 * 2)
> +1: .org __spectre_bhb_loop_k32 + __SPECTRE_BHB_LOOP_SZ
> + .org 1b
> +SYM_DATA_END(__spectre_bhb_loop_k32)
>

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]