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 v2 6/9] xen: arm: Handle CP14 32-bit register accesses from userspace
Date: Tue, 17 Feb 2015 15:20:57 +0000 [thread overview]
Message-ID: <54E35C59.6060104@linaro.org> (raw)
In-Reply-To: <1423543523-8010-6-git-send-email-ian.campbell@citrix.com>
Hi Ian,
On 10/02/15 04:45, Ian Campbell wrote:
> Accesses to these from 32-bit userspace would cause a hypervisor exception
> (host crash) when running a 64-bit kernel, which is worked around by the fix to
> XSA-102. On 32-bit kernels they would be implemented as RAZ/WI which is
> incorrect but harmless.
>
> Update as follows:
> - DBGDSCRINT should be R/O.
> - DBGDSCREXT should be EL1 only.
> - DBGOSLAR is RO and EL1 only.
> - DBGVCR, DBGB[VC]R*, DBGW[VC]R*, and DBGOSDLR are EL1 only.
>
> DBGDIDR and DBGDSCRINT are accessible from EL0 if DBGDSCRext.UDCCdis. Since we
> emulate that as RAZ/WI we allow access.
>
> When we do not allow an access we now silently inject an undef even in debug
> mode since the debugging messages are not helpful (we have handled the access,
> by explicitly choosing not to).
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> xen/arch/arm/traps.c | 34 +++++++++++++++++++++++++++-------
> 1 file changed, 27 insertions(+), 7 deletions(-)
>
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 6045396..18f8332 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -1721,10 +1721,12 @@ static void do_cp14_32(struct cpu_user_regs *regs, union hsr hsr)
> switch ( hsr.bits & HSR_CP32_REGS_MASK )
> {
> case HSR_CPREG32(DBGDIDR):
> -
> - /* Read-only register */
> + /*
> + * Read-only register. Accessible by EL0 if DBGDSCRext.UDCCdis
> + * is set to 0, which we emulated below.
> + */
> if ( !cp32.read )
> - goto bad_cp;
> + goto undef_cp14_32;
>
> /* Implement the minimum requirements:
> * - Number of watchpoints: 1
> @@ -1737,15 +1739,24 @@ static void do_cp14_32(struct cpu_user_regs *regs, union hsr hsr)
> break;
>
> case HSR_CPREG32(DBGDSCRINT):
> + if ( !cp32.read )
> + goto undef_cp14_32;
> +
> + *r = 0;
> + break;
> +
The comment explaining why this field is RAZ/WI is useful. I would add
it again here.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-02-17 15:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 4:35 [PATCH v2 0/9] xen: arm: reenable support for 32-bit userspace running in 64-bit guest Ian Campbell
2015-02-10 4:45 ` [PATCH v2 1/9] xen: arm: Correct PMXEV cp register definitions Ian Campbell
2015-02-10 4:45 ` [PATCH v2 2/9] xen: arm: Factor out psr_mode_is_user Ian Campbell
2015-02-10 4:45 ` [PATCH v2 3/9] xen: arm: Handle 32-bit EL0 on 64-bit EL1 when advancing PC after trap Ian Campbell
2015-02-10 5:44 ` Julien Grall
2015-02-10 6:20 ` Ian Campbell
2015-02-10 4:45 ` [PATCH v2 4/9] xen: arm: correctly handle vtimer traps from userspace Ian Campbell
2015-02-10 6:41 ` Julien Grall
2015-02-19 12:10 ` Ian Campbell
2015-02-19 14:42 ` Julien Grall
2015-02-19 15:13 ` Ian Campbell
2015-02-25 14:32 ` Ian Campbell
2015-02-25 14:37 ` Julien Grall
2015-02-10 4:45 ` [PATCH v2 5/9] xen: arm: Handle CP15 register " Ian Campbell
2015-02-17 15:07 ` Julien Grall
2015-02-19 12:15 ` Ian Campbell
2015-02-19 14:53 ` Julien Grall
2015-02-19 15:07 ` Ian Campbell
2015-02-10 4:45 ` [PATCH v2 6/9] xen: arm: Handle CP14 32-bit register accesses " Ian Campbell
2015-02-17 15:20 ` Julien Grall [this message]
2015-02-10 4:45 ` [PATCH v2 7/9] xen: arm: correctly handle sysreg " Ian Campbell
2015-02-17 15:25 ` Julien Grall
2015-02-19 12:23 ` Ian Campbell
2015-02-19 14:55 ` Julien Grall
2015-02-10 4:45 ` [PATCH v2 8/9] xen: arm: handle remaining traps " Ian Campbell
2015-02-17 15:28 ` Julien Grall
2015-02-19 12:25 ` Ian Campbell
2015-02-10 4:45 ` [PATCH v2 9/9] xen: arm: Allow traps from 32 bit userspace on 64 bit hypervisors again Ian Campbell
2015-02-17 15:29 ` 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=54E35C59.6060104@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.