From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@linaro.org, qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] target-arm: Implement FPEXC32_EL2 system register
Date: Wed, 20 Jan 2016 13:14:44 +0100 [thread overview]
Message-ID: <20160120121444.GT29396@toto> (raw)
In-Reply-To: <1453132414-8127-1-git-send-email-peter.maydell@linaro.org>
On Mon, Jan 18, 2016 at 03:53:34PM +0000, Peter Maydell wrote:
> The AArch64 FPEXC32_EL2 system register is visible at EL2 and EL3,
> and allows those exception levels to read and write the FPEXC
> register for a lower exception level that is using AArch32.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> ---
> ARM Trusted Firmware expects this to exist (as does your average
> hypervisor, I expect).
>
> target-arm/helper.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index 196c111..e8ede3f 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -2890,6 +2890,17 @@ static void sctlr_write(CPUARMState *env, const ARMCPRegInfo *ri,
> tlb_flush(CPU(cpu), 1);
> }
>
> +static CPAccessResult fpexc32_access(CPUARMState *env, const ARMCPRegInfo *ri)
> +{
> + if ((env->cp15.cptr_el[2] & CPTR_TFP) && arm_current_el(env) == 2) {
> + return CP_ACCESS_TRAP_EL2;
> + }
> + if (env->cp15.cptr_el[3] & CPTR_TFP) {
> + return CP_ACCESS_TRAP_EL3;
> + }
> + return CP_ACCESS_OK;
> +}
> +
> static const ARMCPRegInfo v8_cp_reginfo[] = {
> /* Minimal set of EL0-visible registers. This will need to be expanded
> * significantly for system emulation of AArch64 CPUs.
> @@ -3150,6 +3161,11 @@ static const ARMCPRegInfo v8_cp_reginfo[] = {
> .opc0 = 3, .opc1 = 0, .crn = 4, .crm = 2, .opc2 = 0,
> .type = ARM_CP_NO_RAW,
> .access = PL1_RW, .readfn = spsel_read, .writefn = spsel_write },
> + { .name = "FPEXC32_EL2", .state = ARM_CP_STATE_AA64,
> + .opc0 = 3, .opc1 = 4, .crn = 5, .crm = 3, .opc2 = 0,
> + .type = ARM_CP_ALIAS,
> + .fieldoffset = offsetof(CPUARMState, vfp.xregs[ARM_VFP_FPEXC]),
> + .access = PL2_RW, .accessfn = fpexc32_access },
> REGINFO_SENTINEL
> };
>
> --
> 1.9.1
>
prev parent reply other threads:[~2016-01-20 12:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 15:53 [Qemu-devel] [PATCH] target-arm: Implement FPEXC32_EL2 system register Peter Maydell
2016-01-18 16:05 ` Peter Maydell
2016-01-20 12:15 ` Edgar E. Iglesias
2016-01-20 17:53 ` [Qemu-arm] " Sergey Fedorov
2016-01-20 17:53 ` Sergey Fedorov
2016-01-20 12:14 ` Edgar E. Iglesias [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160120121444.GT29396@toto \
--to=edgar.iglesias@gmail.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.