mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
hw/intc/gicv3: Add data fields for virtualization support
As the first step in adding support for the virtualization extensions to the GICv3 emulation: * add the necessary data fields to the state structures * add the fields to the migration state, as a subsection which is only present if virtualization is enabled The use of a subsection means we retain migration compatibility as EL2 is not enabled on any CPUs currently. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Alistair Francis <alistair.francis@xilinx.com> Message-id: 1483977924-14522-8-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
e69d2fa065
commit
4eb833b5df
3 changed files with 56 additions and 0 deletions
|
@ -49,6 +49,27 @@ static int gicv3_post_load(void *opaque, int version_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool virt_state_needed(void *opaque)
|
||||
{
|
||||
GICv3CPUState *cs = opaque;
|
||||
|
||||
return cs->num_list_regs != 0;
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_gicv3_cpu_virt = {
|
||||
.name = "arm_gicv3_cpu/virt",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = virt_state_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT64_2DARRAY(ich_apr, GICv3CPUState, 3, 4),
|
||||
VMSTATE_UINT64(ich_hcr_el2, GICv3CPUState),
|
||||
VMSTATE_UINT64_ARRAY(ich_lr_el2, GICv3CPUState, GICV3_LR_MAX),
|
||||
VMSTATE_UINT64(ich_vmcr_el2, GICv3CPUState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
||||
static const VMStateDescription vmstate_gicv3_cpu = {
|
||||
.name = "arm_gicv3_cpu",
|
||||
.version_id = 1,
|
||||
|
@ -75,6 +96,10 @@ static const VMStateDescription vmstate_gicv3_cpu = {
|
|||
VMSTATE_UINT64_ARRAY(icc_igrpen, GICv3CPUState, 3),
|
||||
VMSTATE_UINT64(icc_ctlr_el3, GICv3CPUState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
},
|
||||
.subsections = (const VMStateDescription * []) {
|
||||
&vmstate_gicv3_cpu_virt,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue