mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
hvf: arm: Add support for GICv3
We currently only support GICv2 emulation. To also support GICv3, we will need to pass a few system registers into their respective handler functions. This patch adds support for HVF to call into the TCG callbacks for GICv3 system register handlers. This is safe because the GICv3 TCG code is generic as long as we limit ourselves to EL0 and EL1 - which are the only modes supported by HVF. To make sure nobody trips over that, we also annotate callbacks that don't work in HVF mode, such as EL state change hooks. With GICv3 support in place, we can run with more than 8 vCPUs. Signed-off-by: Alexander Graf <agraf@csgraf.de> Message-id: 20230128224459.70676-1-agraf@csgraf.de Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
23dcbfc080
commit
a2260983c6
3 changed files with 168 additions and 1 deletions
|
@ -21,6 +21,8 @@
|
|||
#include "hw/irq.h"
|
||||
#include "cpu.h"
|
||||
#include "target/arm/cpregs.h"
|
||||
#include "sysemu/tcg.h"
|
||||
#include "sysemu/qtest.h"
|
||||
|
||||
/*
|
||||
* Special case return value from hppvi_index(); must be larger than
|
||||
|
@ -2810,6 +2812,8 @@ void gicv3_init_cpuif(GICv3State *s)
|
|||
* which case we'd get the wrong value.
|
||||
* So instead we define the regs with no ri->opaque info, and
|
||||
* get back to the GICv3CPUState from the CPUARMState.
|
||||
*
|
||||
* These CP regs callbacks can be called from either TCG or HVF code.
|
||||
*/
|
||||
define_arm_cp_regs(cpu, gicv3_cpuif_reginfo);
|
||||
|
||||
|
@ -2905,6 +2909,16 @@ void gicv3_init_cpuif(GICv3State *s)
|
|||
define_arm_cp_regs(cpu, gicv3_cpuif_ich_apxr23_reginfo);
|
||||
}
|
||||
}
|
||||
arm_register_el_change_hook(cpu, gicv3_cpuif_el_change_hook, cs);
|
||||
if (tcg_enabled() || qtest_enabled()) {
|
||||
/*
|
||||
* We can only trap EL changes with TCG. However the GIC interrupt
|
||||
* state only changes on EL changes involving EL2 or EL3, so for
|
||||
* the non-TCG case this is OK, as EL2 and EL3 can't exist.
|
||||
*/
|
||||
arm_register_el_change_hook(cpu, gicv3_cpuif_el_change_hook, cs);
|
||||
} else {
|
||||
assert(!arm_feature(&cpu->env, ARM_FEATURE_EL2));
|
||||
assert(!arm_feature(&cpu->env, ARM_FEATURE_EL3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue