[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 r
From: |
Vijay Kilari |
Subject: |
Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate |
Date: |
Mon, 20 Feb 2017 11:51:24 +0530 |
Hi Peter,
On Fri, Feb 17, 2017 at 7:25 PM, Peter Maydell <address@hidden> wrote:
> On 17 February 2017 at 06:31, <address@hidden> wrote:
>> From: Vijaya Kumar K <address@hidden>
>>
>> To Save and Restore ICC_SRE_EL1 register introduce vmstate
>> subsection and load only if non-zero.
>> Also initialize icc_sre_el1 with to 0x7 in pre_load
>> function.
>>
>> Signed-off-by: Vijaya Kumar K <address@hidden>
>> ---
>> hw/intc/arm_gicv3_common.c | 32 ++++++++++++++++++++++++++++++++
>> include/hw/intc/arm_gicv3_common.h | 1 +
>> 2 files changed, 33 insertions(+)
>>
>> diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
>> index 16b9b0f..e62480e 100644
>> --- a/hw/intc/arm_gicv3_common.c
>> +++ b/hw/intc/arm_gicv3_common.c
>> @@ -70,6 +70,34 @@ static const VMStateDescription vmstate_gicv3_cpu_virt = {
>> }
>> };
>>
>> +static int icc_sre_el1_reg_pre_load(void *opaque)
>> +{
>> + GICv3CPUState *cs = opaque;
>> +
>> + /* By default enable SRE and disable IRQ & FIQ bypass. */
>> + cs->icc_sre_el1 = 0x7;
>
> Why do we need the pre_load function? I would have
> expected that reset would have given us these defaults
> already.
>
>> + return 0;
>> +}
>> +
>> +static bool icc_sre_el1_reg_needed(void *opaque)
>> +{
>> + GICv3CPUState *cs = opaque;
>> +
>> + return cs->icc_sre_el1 != 0;
>
> I expected this to say "we need to transfer the value if
> it isn't 0x7" (since the current situation of migration
> is "we assume that the value is 0x7").
>
> Something should probably fail inbound migration for TCG
> if the value isn't 0x7, for that matter.
>
> Is there a situation where KVM might allow a value other
> than 0x7?
In KVM, the SRE_EL1 value is 0x1. During save, value
read from KVM is 0x1 though we reset to 0x7.
>
>> +}
>> +
>> +const VMStateDescription vmstate_gicv3_cpu_sre_el1 = {
>> + .name = "arm_gicv3_cpu/sre_el1",
>> + .version_id = 1,
>> + .minimum_version_id = 1,
>> + .pre_load = icc_sre_el1_reg_pre_load,
>> + .needed = icc_sre_el1_reg_needed,
>> + .fields = (VMStateField[]) {
>> + VMSTATE_UINT64(icc_sre_el1, GICv3CPUState),
>> + VMSTATE_END_OF_LIST()
>> + }
>> +};
>> +
>> static const VMStateDescription vmstate_gicv3_cpu = {
>> .name = "arm_gicv3_cpu",
>> .version_id = 1,
>> @@ -100,6 +128,10 @@ static const VMStateDescription vmstate_gicv3_cpu = {
>> .subsections = (const VMStateDescription * []) {
>> &vmstate_gicv3_cpu_virt,
>> NULL
>> + },
>> + .subsections = (const VMStateDescription * []) {
>> + &vmstate_gicv3_cpu_sre_el1,
>> + NULL
>> }
>> };
>>
>> diff --git a/include/hw/intc/arm_gicv3_common.h
>> b/include/hw/intc/arm_gicv3_common.h
>> index 4156051..bccdfe1 100644
>> --- a/include/hw/intc/arm_gicv3_common.h
>> +++ b/include/hw/intc/arm_gicv3_common.h
>> @@ -172,6 +172,7 @@ struct GICv3CPUState {
>> uint8_t gicr_ipriorityr[GIC_INTERNAL];
>>
>> /* CPU interface */
>> + uint64_t icc_sre_el1;
>> uint64_t icc_ctlr_el1[2];
>> uint64_t icc_pmr_el1;
>> uint64_t icc_bpr[3];
>> --
>> 1.9.1
>
> thanks
> -- PMM
- [Qemu-devel] [PATCH v8 0/5] GICv3 live migration support, vijay . kilari, 2017/02/17
- [Qemu-devel] [PATCH v8 1/5] kernel: Add definitions for GICv3 attributes, vijay . kilari, 2017/02/17
- [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate, vijay . kilari, 2017/02/17
- Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate, Auger Eric, 2017/02/17
- Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate, Peter Maydell, 2017/02/17
- Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate,
Vijay Kilari <=
- Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate, Peter Maydell, 2017/02/20
- Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate, Vijay Kilari, 2017/02/22
- Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate, Peter Maydell, 2017/02/22
- Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate, Marc Zyngier, 2017/02/22
- Re: [Qemu-devel] [PATCH v8 2/5] hw/intc/arm_gicv3_kvm: Add ICC_SRE_EL1 register to vmstate, Peter Maydell, 2017/02/22
[Qemu-devel] [PATCH v8 4/5] target-arm: Add GICv3CPUState in CPUARMState struct, vijay . kilari, 2017/02/17
[Qemu-devel] [PATCH v8 3/5] hw/intc/arm_gicv3_kvm: Implement get/put functions, vijay . kilari, 2017/02/17
[Qemu-devel] [PATCH v8 5/5] hw/intc/arm_gicv3_kvm: Reset GICv3 cpu interface registers, vijay . kilari, 2017/02/17