qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] AArch64: ZCR and ARM_CP_SVE/ARM_CP_FPU flags
@ 2018-05-23  6:49 Laurent Desnogues
  2018-05-25 14:07 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Desnogues @ 2018-05-23  6:49 UTC (permalink / raw)
  To: Richard Henderson, Peter Maydell, qemu-devel@nongnu.org

Hi,

ZCR system registers are both flagged as ARM_CP_SVE and ARM_CP_FPU,
which results in an assertion failure in fp_access_check due to the
check of these flags in handle_sys:

    if ((ri->type & ARM_CP_SVE) && !sve_access_check(s)) {
        return;
    }
    if ((ri->type & ARM_CP_FPU) && !fp_access_check(s)) {
        return;
    }

sve_access_check calls fp_access_check so the assert
!s->fp_access_checked in the second call to fp_access_check will fail.

I took a quick look at sve_exception_el and given that it checks that
FPU is enabled, can't we just remove the ARM_CP_FPU flag from ZCR?

Alternatively the second call to fp_access_check when ARM_CP_FPU is
defined could be skipped if ARM_CP_SVE is set.

Thanks,

Laurent

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] AArch64: ZCR and ARM_CP_SVE/ARM_CP_FPU flags
  2018-05-23  6:49 [Qemu-devel] AArch64: ZCR and ARM_CP_SVE/ARM_CP_FPU flags Laurent Desnogues
@ 2018-05-25 14:07 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2018-05-25 14:07 UTC (permalink / raw)
  To: Laurent Desnogues, Peter Maydell, qemu-devel@nongnu.org

On 05/22/2018 11:49 PM, Laurent Desnogues wrote:
> ZCR system registers are both flagged as ARM_CP_SVE and ARM_CP_FPU,
> which results in an assertion failure in fp_access_check due to the
> check of these flags in handle_sys:
> 
>     if ((ri->type & ARM_CP_SVE) && !sve_access_check(s)) {
>         return;
>     }
>     if ((ri->type & ARM_CP_FPU) && !fp_access_check(s)) {
>         return;
>     }
> 
> sve_access_check calls fp_access_check so the assert
> !s->fp_access_checked in the second call to fp_access_check will fail.

Hah.  Yes, these checks have migrated a bit since I first wrote them, and I
have (perhaps obviously) done zero system-level testing so far.

> I took a quick look at sve_exception_el and given that it checks that
> FPU is enabled, can't we just remove the ARM_CP_FPU flag from ZCR?
> 
> Alternatively the second call to fp_access_check when ARM_CP_FPU is
> defined could be skipped if ARM_CP_SVE is set.

I would say the first -- removing FPU -- but will defer to Peter.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-25 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-23  6:49 [Qemu-devel] AArch64: ZCR and ARM_CP_SVE/ARM_CP_FPU flags Laurent Desnogues
2018-05-25 14:07 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).