Re: [PATCH 3/3] target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

2019-11-29 Thread Peter Maydell
On Fri, 29 Nov 2019 at 09:45, Edgar E. Iglesias wrote: > IIRC, the current EL was always known at translation time but I've > not been tracking recent changes. Yes, it's known at translate time, in dc->current_el. (The code is structured to make it difficult to accidentally use info that's not kn

Re: [PATCH 3/3] target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

2019-11-29 Thread Edgar E. Iglesias
On Fri, Nov 29, 2019 at 09:24:37AM +, Marc Zyngier wrote: > On 2019-11-29 08:28, Edgar E. Iglesias wrote: > > On Thu, Nov 28, 2019 at 04:17:18PM +, Marc Zyngier wrote: > > > HCR_EL2.TID3 requires that AArch32 reads of MVFR[012] are trapped to > > > EL2, and that HCR_EL2.TID0 does the same f

Re: [PATCH 3/3] target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

2019-11-29 Thread Marc Zyngier
On 2019-11-29 08:28, Edgar E. Iglesias wrote: On Thu, Nov 28, 2019 at 04:17:18PM +, Marc Zyngier wrote: HCR_EL2.TID3 requires that AArch32 reads of MVFR[012] are trapped to EL2, and that HCR_EL2.TID0 does the same for reads of FPSID. In order to handle this, introduce a new TCG helper functi

Re: [PATCH 3/3] target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

2019-11-29 Thread Edgar E. Iglesias
On Thu, Nov 28, 2019 at 04:17:18PM +, Marc Zyngier wrote: > HCR_EL2.TID3 requires that AArch32 reads of MVFR[012] are trapped to > EL2, and that HCR_EL2.TID0 does the same for reads of FPSID. > In order to handle this, introduce a new TCG helper function that > checks for these control bits bef

Re: [PATCH 3/3] target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

2019-11-28 Thread Peter Maydell
On Thu, 28 Nov 2019 at 16:17, Marc Zyngier wrote: > > HCR_EL2.TID3 requires that AArch32 reads of MVFR[012] are trapped to > EL2, and that HCR_EL2.TID0 does the same for reads of FPSID. > In order to handle this, introduce a new TCG helper function that > checks for these control bits before execu

Re: [PATCH 3/3] target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

2019-11-28 Thread Peter Maydell
On Thu, 28 Nov 2019 at 17:49, Marc Zyngier wrote: > > Hi Peter, > > Thanks for having a look at this. > > On 2019-11-28 16:43, Peter Maydell wrote: > > On Thu, 28 Nov 2019 at 16:17, Marc Zyngier wrote: > >> > >> HCR_EL2.TID3 requires that AArch32 reads of MVFR[012] are trapped to > >> EL2, and th

Re: [PATCH 3/3] target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

2019-11-28 Thread Marc Zyngier
Hi Peter, Thanks for having a look at this. On 2019-11-28 16:43, Peter Maydell wrote: On Thu, 28 Nov 2019 at 16:17, Marc Zyngier wrote: HCR_EL2.TID3 requires that AArch32 reads of MVFR[012] are trapped to EL2, and that HCR_EL2.TID0 does the same for reads of FPSID. In order to handle this, i

[PATCH 3/3] target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

2019-11-28 Thread Marc Zyngier
HCR_EL2.TID3 requires that AArch32 reads of MVFR[012] are trapped to EL2, and that HCR_EL2.TID0 does the same for reads of FPSID. In order to handle this, introduce a new TCG helper function that checks for these control bits before executing the VMRC instruction. Tested with a hacked-up version o