Re: [PATCH v4] hw/arm/smmuv3: Add GBPA register

2023-02-13 Thread Richard Henderson
On 2/13/23 00:57, Peter Maydell wrote: On Sat, 11 Feb 2023 at 23:49, Richard Henderson wrote: On 2/10/23 12:19, Mostafa Saleh wrote: @@ -1512,6 +1553,10 @@ static const VMStateDescription vmstate_smmuv3 = { VMSTATE_END_OF_LIST(), }, +.subsections = (const VMStateDescrip

Re: [PATCH v4] hw/arm/smmuv3: Add GBPA register

2023-02-13 Thread Eric Auger
Hi Mostafa, On 2/12/23 00:34, Richard Henderson wrote: > On 2/10/23 12:19, Mostafa Saleh wrote: >> +static bool smmuv3_gbpa_needed(void *opaque) >> +{ >> +    SMMUv3State *s = opaque; >> + >> +    /* Only migrate GBPA if it has different reset value. */ >> +    if (s->gbpa != SMMU_GBPA_RESET_VAL)

Re: [PATCH v4] hw/arm/smmuv3: Add GBPA register

2023-02-13 Thread Peter Maydell
On Sat, 11 Feb 2023 at 23:49, Richard Henderson wrote: > > On 2/10/23 12:19, Mostafa Saleh wrote: > > @@ -1512,6 +1553,10 @@ static const VMStateDescription vmstate_smmuv3 = { > > > > VMSTATE_END_OF_LIST(), > > }, > > +.subsections = (const VMStateDescription * []) { > > +

Re: [PATCH v4] hw/arm/smmuv3: Add GBPA register

2023-02-12 Thread Mostafa Saleh
On Sun, Feb 12, 2023 at 05:18:33AM -1000, Richard Henderson wrote: > > Please correct me if I am wrong. From what I see, the initial for value > > GBPA will be set from smmu_reset_hold which is called from context of > > qemu_system_reset from qemu_init context. > > And migration will start after t

Re: [PATCH v4] hw/arm/smmuv3: Add GBPA register

2023-02-12 Thread Richard Henderson
On 2/12/23 03:23, Mostafa Saleh wrote: On Sat, Feb 11, 2023 at 01:48:57PM -1000, Richard Henderson wrote: Just "return s->gbpa != SMMU_GBPA_RESET_VAL;". I will update it. @@ -1512,6 +1553,10 @@ static const VMStateDescription vmstate_smmuv3 = { VMSTATE_END_OF_LIST(), }, +

Re: [PATCH v4] hw/arm/smmuv3: Add GBPA register

2023-02-12 Thread Mostafa Saleh
On Sat, Feb 11, 2023 at 01:48:57PM -1000, Richard Henderson wrote: > Just "return s->gbpa != SMMU_GBPA_RESET_VAL;". I will update it. > > @@ -1512,6 +1553,10 @@ static const VMStateDescription vmstate_smmuv3 = { > > VMSTATE_END_OF_LIST(), > > }, > > +.subsections = (const VMS

Re: [PATCH v4] hw/arm/smmuv3: Add GBPA register

2023-02-11 Thread Richard Henderson
On 2/10/23 12:19, Mostafa Saleh wrote: @@ -1512,6 +1553,10 @@ static const VMStateDescription vmstate_smmuv3 = { VMSTATE_END_OF_LIST(), }, +.subsections = (const VMStateDescription * []) { +&vmstate_gbpa, +NULL +} Actually, I suspect that you need a p

Re: [PATCH v4] hw/arm/smmuv3: Add GBPA register

2023-02-11 Thread Richard Henderson
On 2/10/23 12:19, Mostafa Saleh wrote: +static bool smmuv3_gbpa_needed(void *opaque) +{ +SMMUv3State *s = opaque; + +/* Only migrate GBPA if it has different reset value. */ +if (s->gbpa != SMMU_GBPA_RESET_VAL) { +return true; +} + +return false; Just "return s->gbpa

[PATCH v4] hw/arm/smmuv3: Add GBPA register

2023-02-10 Thread Mostafa Saleh
GBPA register can be used to globally abort all transactions. It is described in the SMMU manual in "6.3.14 SMMU_GBPA". ABORT reset value is IMPLEMENTATION DEFINED, it is chosen to be zero(Do not abort incoming transactions). Other fields have default values of Use Incoming. If UPDATE is not set