linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Oleksandr Tyshchenko <olekstysh@gmail.com>,
	linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: horms@verge.net.au, magnus.damm@gmail.com, linux@armlinux.org.uk,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Subject: Re: [RFC PATCH] ARM: mach-shmobile: Parse DT to get ARCH timer memory region
Date: Mon, 13 May 2019 10:19:52 +0100	[thread overview]
Message-ID: <e64d7f2f-209e-cf7d-6ddc-88d338b1c010@arm.com> (raw)
In-Reply-To: <1557505377-28577-1-git-send-email-olekstysh@gmail.com>

Hi,

On 5/10/19 5:22 PM, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> Don't use hardcoded address, retrieve it from device-tree instead.
> 
> And besides, this patch fixes the memory error when running
> on top of Xen hypervisor:
> 
> (XEN) traps.c:1999:d0v0 HSR=0x93830007 pc=0xc0b097f8 gva=0xf0805000
>        gpa=0x000000e6080000
> 
> Which shows that VCPU0 in Dom0 is trying to access an address in memory
> it is not allowed to access (0x000000e6080000).
> Put simply, Xen doesn't know that it is a device's register memory
> since it wasn't described in a host device tree (which Xen parses)
> and as the result this memory region wasn't assigned to Dom0 at
> domain creation time.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> ---
> 
> This patch is meant to get feedback from the community before
> proceeding further. If we decide to go this direction, all Gen2
> device-trees should be updated (add memory region) before
> this patch going in.
> 
> e.g. r8a7790.dtsi:
> 
> ...
> timer {
> 	compatible = "arm,armv7-timer";
> 	interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
> 			      <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
> 			      <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
> 			      <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
> +	 reg = <0 0xe6080000 0 0x1000>;

This looks incorrect, the "arm,armv7-timer" bindings doesn't offer you 
the possibility to specify an MMIO region. This makes sense because it 
is meant to describe the Arch timer that is only access via co-processor 
registers.

Looking at the code, I think the MMIO region corresponds to the 
coresight (based on the register name). So you may want to describe the 
coresight in the Device-Tree.

Also, AFAICT, the code is configuring and turning on the timer if it has 
not been done yet. If you are here running on Xen, then you have 
probably done something wrong. Indeed, it means Xen would not be able to 
use the timer until Dom0 has booted. But, shouldn't newer U-boot do it 
for you?

Cheers,

-- 
Julien Grall

  reply	other threads:[~2019-05-13  9:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 16:22 [RFC PATCH] ARM: mach-shmobile: Parse DT to get ARCH timer memory region Oleksandr Tyshchenko
2019-05-13  9:19 ` Julien Grall [this message]
2019-05-13  9:56   ` Geert Uytterhoeven
2019-05-13 14:06   ` Oleksandr
2019-05-13 15:13     ` Geert Uytterhoeven
2019-05-13 16:00       ` Oleksandr
2019-05-14  7:16         ` Geert Uytterhoeven
2019-05-14 13:58           ` Oleksandr

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=e64d7f2f-209e-cf7d-6ddc-88d338b1c010@arm.com \
    --to=julien.grall@arm.com \
    --cc=horms@verge.net.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=magnus.damm@gmail.com \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=olekstysh@gmail.com \
    /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 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).