Re: [Qemu-devel] [PATCH v8 18/27] target-arm: make c2_mask and c2_base_mask banked

2014-11-05 Thread Greg Bellows
Maybe, but it is cleaner and works later on down the road when we add EL2 registers that use the same write functions. I'm fine either way if you feel strongly about it. On 5 November 2014 09:15, Peter Maydell wrote: > On 5 November 2014 15:09, Greg Bellows wrote: > > Ah... I was confused and

Re: [Qemu-devel] [PATCH v8 18/27] target-arm: make c2_mask and c2_base_mask banked

2014-11-05 Thread Peter Maydell
On 5 November 2014 15:09, Greg Bellows wrote: > Ah... I was confused and thinking of ttbcr_raw_write. Yes, raw_write does > not actually touch the masks. > > The reason we used raw_write is that it updates the correct ri offset. We > could be calling with the secure or non-secure ri so it was ne

Re: [Qemu-devel] [PATCH v8 18/27] target-arm: make c2_mask and c2_base_mask banked

2014-11-05 Thread Greg Bellows
Ah... I was confused and thinking of ttbcr_raw_write. Yes, raw_write does not actually touch the masks. The reason we used raw_write is that it updates the correct ri offset. We could be calling with the secure or non-secure ri so it was necessary to make sure the correct offset gets updated. S

Re: [Qemu-devel] [PATCH v8 18/27] target-arm: make c2_mask and c2_base_mask banked

2014-11-04 Thread Peter Maydell
On 4 November 2014 22:46, Greg Bellows wrote: > > > On 31 October 2014 10:26, Peter Maydell wrote: >> >> On 30 October 2014 21:28, Greg Bellows wrote: >> > static void vmsa_ttbcr_reset(CPUARMState *env, const ARMCPRegInfo *ri) >> > { >> > -env->cp15.c2_base_mask = 0xc000u; >> > +/*

Re: [Qemu-devel] [PATCH v8 18/27] target-arm: make c2_mask and c2_base_mask banked

2014-11-04 Thread Greg Bellows
On 31 October 2014 10:26, Peter Maydell wrote: > On 30 October 2014 21:28, Greg Bellows wrote: > > From: Fabian Aggeler > > > > Since TTBCR is banked we will bank c2_mask and c2_base_mask too. This > > avoids recalculating them on switches from secure to non-secure world. > > These fields are p

[Qemu-devel] [PATCH v8 18/27] target-arm: make c2_mask and c2_base_mask banked

2014-10-31 Thread Greg Bellows
From: Fabian Aggeler Since TTBCR is banked we will bank c2_mask and c2_base_mask too. This avoids recalculating them on switches from secure to non-secure world. Signed-off-by: Fabian Aggeler Signed-off-by: Greg Bellows --- v5 -> v6 - Switch to use distinct CPREG secure flags v4 -> v5 - Cha

Re: [Qemu-devel] [PATCH v8 18/27] target-arm: make c2_mask and c2_base_mask banked

2014-10-31 Thread Peter Maydell
On 30 October 2014 21:28, Greg Bellows wrote: > From: Fabian Aggeler > > Since TTBCR is banked we will bank c2_mask and c2_base_mask too. This > avoids recalculating them on switches from secure to non-secure world. These fields are part of our TTBCR internal representation; we should bank the w