All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Cc: tim@xen.org, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH 07/12] xen: arm: Handle CP15 register traps from userspace
Date: Wed, 25 Mar 2015 18:59:45 +0000	[thread overview]
Message-ID: <551305A1.40509@linaro.org> (raw)
In-Reply-To: <1427293356-5714-7-git-send-email-ian.campbell@citrix.com>

Hi Ian,

On 25/03/15 14:22, Ian Campbell wrote:
> Previously userspace access to PM* would have been incorrectly (but
> benignly) implemented as RAZ/WI when running on a 32-bit kernel and
> would cause a hypervisor exception (host crash) when running a 64-bit
> kernel (this was already solved via the fix to XSA-102).
> 
> CLIDR, CCSIDR, DCCISW, ACTLR, PMINTENSET, PMINTENCLR are EL1 only,
> attempts to access from EL0 will trap to EL1 not to us, hence BUG_ON
> is appropriate now.

For PMINTENSET and PMINTENCLR the spec (ARMv8 DDI0487A rev d) says:

"If MDCR_EL2.TPM==1, Non-secure accesses to this register will trap from
EL1 and EL0 to EL2."

As we set to 1 MDCR_EL1.TPM, EL0 access will trap to Xen. So I think we
should replace the BUG_ON to injected a exception.

Reading more the spec only ACTLR access from EL0 will trap to EL1. All
access from EL0 to the others registers in the list above will trap to EL2.

Although, the ARMv7 spec seems to say to only valid access will be trapped.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-03-25 18:59 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 14:22 [PATCH v3 0/12] xen: arm: reenable support for 32-bit userspace running in 64-bit guest Ian Campbell
2015-03-25 14:22 ` [PATCH 01/12] xen: arm: Correct PMXEV cp register definitions Ian Campbell
2015-03-25 14:22 ` [PATCH 02/12] xen: arm: handle accesses to CNTP_CVAL_EL0 Ian Campbell
2015-03-25 18:23   ` Julien Grall
2015-03-25 18:32   ` Julien Grall
2015-03-26 10:59     ` Ian Campbell
2015-03-26 16:07       ` Ian Campbell
2015-03-25 14:22 ` [PATCH 03/12] xen: arm: Use ARMv8 names for CNTHCTL_EL2 bits Ian Campbell
2015-03-25 18:25   ` Julien Grall
2015-03-25 14:22 ` [PATCH 04/12] xen: arm: Factor out psr_mode_is_user Ian Campbell
2015-03-25 14:22 ` [PATCH 05/12] xen: arm: Handle 32-bit EL0 on 64-bit EL1 when advancing PC after trap Ian Campbell
2015-03-25 14:22 ` [PATCH 06/12] xen: arm: correctly handle vtimer traps from userspace Ian Campbell
2015-03-25 18:41   ` Julien Grall
2015-03-26 11:09     ` Ian Campbell
2015-03-25 14:22 ` [PATCH 07/12] xen: arm: Handle CP15 register " Ian Campbell
2015-03-25 18:59   ` Julien Grall [this message]
2015-03-26 11:19     ` Ian Campbell
2015-03-25 14:22 ` [PATCH 08/12] xen: arm: Handle CP14 32-bit register accesses " Ian Campbell
2015-03-25 19:05   ` Julien Grall
2015-03-25 14:22 ` [PATCH 09/12] xen: arm: correctly handle sysreg " Ian Campbell
2015-03-25 19:22   ` Julien Grall
2015-03-26 11:32     ` Ian Campbell
2015-03-25 14:22 ` [PATCH 10/12] xen: arm: handle remaining traps " Ian Campbell
2015-03-25 19:29   ` Julien Grall
2015-03-25 14:22 ` [PATCH 11/12] xen: arm: Allow traps from 32 bit userspace on 64 bit hypervisors again Ian Campbell
2015-03-25 14:22 ` [PATCH 12/12] xen: arm: Dump guest state when invalid trap state is detected Ian Campbell
2015-03-25 19:35   ` Julien Grall

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=551305A1.40509@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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.