Message ID | 20250620172751.94231-37-philmd@linaro.org |
---|---|
State | New |
Headers | show |
Series | accel/split/arm: Run EL2 using TCG and EL1/EL0 in hardware with HVF | expand |
On 6/20/25 10:27, Philippe Mathieu-Daudé wrote: > When hardware accelerator available, use it to > directly run EL0 and EL1. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > target/arm/tcg/helper-a64.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c > index 4f618ae390e..5962cff4e7a 100644 > --- a/target/arm/tcg/helper-a64.c > +++ b/target/arm/tcg/helper-a64.c > @@ -29,6 +29,7 @@ > #include "internals.h" > #include "qemu/crc32c.h" > #include "exec/cpu-common.h" > +#include "system/hw_accel.h" > #include "accel/tcg/cpu-ldst.h" > #include "accel/tcg/helper-retaddr.h" > #include "accel/tcg/probe.h" > @@ -761,6 +762,14 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc) > arm_call_el_change_hook(cpu); > bql_unlock(); > > + if (new_el < 2 && hwaccel_enabled()) { Because you're raising EXCP_HWACCEL, I really think this should be if (split_enabled() && arm_cpu_can_accelerate(cs)) r~ > + CPUState *cs = env_cpu(env); > + > + cs->exception_index = EXCP_HWACCEL; > + cs->exit_request = 1; > + cpu_loop_exit(cs); > + /* never returns */ > + } > return; > > illegal_return:
diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 4f618ae390e..5962cff4e7a 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -29,6 +29,7 @@ #include "internals.h" #include "qemu/crc32c.h" #include "exec/cpu-common.h" +#include "system/hw_accel.h" #include "accel/tcg/cpu-ldst.h" #include "accel/tcg/helper-retaddr.h" #include "accel/tcg/probe.h" @@ -761,6 +762,14 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc) arm_call_el_change_hook(cpu); bql_unlock(); + if (new_el < 2 && hwaccel_enabled()) { + CPUState *cs = env_cpu(env); + + cs->exception_index = EXCP_HWACCEL; + cs->exit_request = 1; + cpu_loop_exit(cs); + /* never returns */ + } return; illegal_return:
When hardware accelerator available, use it to directly run EL0 and EL1. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- target/arm/tcg/helper-a64.c | 9 +++++++++ 1 file changed, 9 insertions(+)