[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v9 04/23] target/arm: Implement ALLINT MSR (immediate)
From: |
Peter Maydell |
Subject: |
Re: [RFC PATCH v9 04/23] target/arm: Implement ALLINT MSR (immediate) |
Date: |
Thu, 21 Mar 2024 17:37:09 +0000 |
On Thu, 21 Mar 2024 at 13:10, Jinjie Ruan <ruanjinjie@huawei.com> wrote:
>
> Add ALLINT MSR (immediate) to decodetree, in which the CRm is 0b000x. The
> EL0 check is necessary to ALLINT, and the EL1 check is necessary when
> imm == 1. So implement it inline for EL2/3, or EL1 with imm==0. Avoid the
> unconditional write to pc and use raise_exception_ra to unwind.
> +void HELPER(msr_set_allint_el1)(CPUARMState *env)
> +{
> + /* ALLINT update to PSTATE. */
> + if (arm_hcrx_el2_eff(env) & HCRX_TALLINT) {
> + raise_exception_ra(env, EXCP_UDEF,
> + syn_aa64_sysregtrap(0, 1, 0, 4, 1, 0x1f, 0),
> + exception_target_el(env), GETPC());
> + }
> +
> + env->pstate |= PSTATE_ALLINT;
> +}
This is a hypervisor trap from EL1 to EL2, so the target_el
argument to raise_exception_ra() should be "2", not
"exception_target_el(env)". Otherwise we will trap to EL1.
thanks
-- PMM
- [RFC PATCH v9 00/23] target/arm: Implement FEAT_NMI and FEAT_GICv3_NMI, Jinjie Ruan, 2024/03/21
- [RFC PATCH v9 02/23] target/arm: Add PSTATE.ALLINT, Jinjie Ruan, 2024/03/21
- [RFC PATCH v9 01/23] target/arm: Handle HCR_EL2 accesses for bits introduced with FEAT_NMI, Jinjie Ruan, 2024/03/21
- [RFC PATCH v9 03/23] target/arm: Add support for FEAT_NMI, Non-maskable Interrupt, Jinjie Ruan, 2024/03/21
- [RFC PATCH v9 04/23] target/arm: Implement ALLINT MSR (immediate), Jinjie Ruan, 2024/03/21
- Re: [RFC PATCH v9 04/23] target/arm: Implement ALLINT MSR (immediate),
Peter Maydell <=
- [RFC PATCH v9 08/23] target/arm: Handle IS/FS in ISR_EL1 for NMI, VINMI and VFNMI, Jinjie Ruan, 2024/03/21
- [RFC PATCH v9 07/23] target/arm: Add support for NMI in arm_phys_excp_target_el(), Jinjie Ruan, 2024/03/21
- [RFC PATCH v9 06/23] target/arm: Add support for Non-maskable Interrupt, Jinjie Ruan, 2024/03/21
- Re: [RFC PATCH v9 06/23] target/arm: Add support for Non-maskable Interrupt, Jinjie Ruan, 2024/03/21
- Re: [RFC PATCH v9 06/23] target/arm: Add support for Non-maskable Interrupt, Peter Maydell, 2024/03/22
[RFC PATCH v9 10/23] hw/arm/virt: Wire NMI and VINMI irq lines from GIC to CPU, Jinjie Ruan, 2024/03/21