All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/arm: Blacklist the memory mapped timer (armv7-timer-mem)
@ 2015-01-13 20:07 Julien Grall
  2015-01-14 11:02 ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Grall @ 2015-01-13 20:07 UTC (permalink / raw)
  To: xen-devel; +Cc: stefano.stabellini, Julien Grall, tim, ian.campbell

Some platform (such as the VFP Base AEMv8 model) has a memory mapped
timer. We don't want DOM0 use this timer rather than the generic ARM
timer. So blacklist it for all platforms.

Signed-off-by: Julien Grall <julien.grall@linaro.org>

---
    This patch is candidate to backport for Xen 4.5 and Xen 4.4.

    It may not apply correctly for Xen 4.4.
---
 xen/arch/arm/domain_build.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index bf8dc78..16ce248 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1047,6 +1047,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         DT_MATCH_COMPATIBLE("arm,psci"),
         DT_MATCH_PATH("/cpus"),
         DT_MATCH_TYPE("memory"),
+        DT_MATCH_COMPATIBLE("arm,armv7-timer-mem"),
         { /* sentinel */ },
     };
     static const struct dt_device_match gic_matches[] __initconst =
-- 
2.1.4

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

* Re: [PATCH] xen/arm: Blacklist the memory mapped timer (armv7-timer-mem)
  2015-01-13 20:07 [PATCH] xen/arm: Blacklist the memory mapped timer (armv7-timer-mem) Julien Grall
@ 2015-01-14 11:02 ` Ian Campbell
  2015-01-14 16:03   ` Julien Grall
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2015-01-14 11:02 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, tim, stefano.stabellini

On Tue, 2015-01-13 at 20:07 +0000, Julien Grall wrote:
> Some platform (such as the VFP Base AEMv8 model) has a memory mapped
> timer. We don't want DOM0 use this timer rather than the generic ARM
> timer. So blacklist it for all platforms.

It seems that these registers contain things like the ability to stop
the counter or change its frequency. So we certainly don't want dom0
getting at those!

It's not clear to me if accesses to these registers are trapped
according to the controls available for the CP registers, or if we would
have to resort to trapping the entire MMIO page if we wanted to support
access to these registers (I don't think we would want to anyway).

> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> 
> ---
>     This patch is candidate to backport for Xen 4.5 and Xen 4.4.
> 
>     It may not apply correctly for Xen 4.4.
> ---
>  xen/arch/arm/domain_build.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index bf8dc78..16ce248 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1047,6 +1047,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
>          DT_MATCH_COMPATIBLE("arm,psci"),
>          DT_MATCH_PATH("/cpus"),
>          DT_MATCH_TYPE("memory"),
> +        DT_MATCH_COMPATIBLE("arm,armv7-timer-mem"),

This is a bit less obvious that the other things in this list. Could you
perhaps add a comment?

>          { /* sentinel */ },
>      };
>      static const struct dt_device_match gic_matches[] __initconst =

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

* Re: [PATCH] xen/arm: Blacklist the memory mapped timer (armv7-timer-mem)
  2015-01-14 11:02 ` Ian Campbell
@ 2015-01-14 16:03   ` Julien Grall
  2015-01-14 16:06     ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Grall @ 2015-01-14 16:03 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, tim, stefano.stabellini

Hi Ian,

On 14/01/15 11:02, Ian Campbell wrote:
> On Tue, 2015-01-13 at 20:07 +0000, Julien Grall wrote:
>> Some platform (such as the VFP Base AEMv8 model) has a memory mapped
>> timer. We don't want DOM0 use this timer rather than the generic ARM
>> timer. So blacklist it for all platforms.
> 
> It seems that these registers contain things like the ability to stop
> the counter or change its frequency. So we certainly don't want dom0
> getting at those!
> 
> It's not clear to me if accesses to these registers are trapped
> according to the controls available for the CP registers, or if we would
> have to resort to trapping the entire MMIO page if we wanted to support
> access to these registers (I don't think we would want to anyway).

I didn't find any spec for the memory mapped timer. But looking to the
driver, it looks like they also have the concept of physical/virtual. So
we may not need to trap.

Anyway, before implementing anything I'd like to find the corresponding
spec.

>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>>
>> ---
>>     This patch is candidate to backport for Xen 4.5 and Xen 4.4.
>>
>>     It may not apply correctly for Xen 4.4.
>> ---
>>  xen/arch/arm/domain_build.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index bf8dc78..16ce248 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -1047,6 +1047,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
>>          DT_MATCH_COMPATIBLE("arm,psci"),
>>          DT_MATCH_PATH("/cpus"),
>>          DT_MATCH_TYPE("memory"),
>> +        DT_MATCH_COMPATIBLE("arm,armv7-timer-mem"),
> 
> This is a bit less obvious that the other things in this list. Could you
> perhaps add a comment?

Sure. I will send a new version.

Regards,

-- 
Julien Grall

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

* Re: [PATCH] xen/arm: Blacklist the memory mapped timer (armv7-timer-mem)
  2015-01-14 16:03   ` Julien Grall
@ 2015-01-14 16:06     ` Ian Campbell
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2015-01-14 16:06 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, tim, stefano.stabellini

On Wed, 2015-01-14 at 16:03 +0000, Julien Grall wrote:
> Hi Ian,
> 
> On 14/01/15 11:02, Ian Campbell wrote:
> > On Tue, 2015-01-13 at 20:07 +0000, Julien Grall wrote:
> >> Some platform (such as the VFP Base AEMv8 model) has a memory mapped
> >> timer. We don't want DOM0 use this timer rather than the generic ARM
> >> timer. So blacklist it for all platforms.
> > 
> > It seems that these registers contain things like the ability to stop
> > the counter or change its frequency. So we certainly don't want dom0
> > getting at those!
> > 
> > It's not clear to me if accesses to these registers are trapped
> > according to the controls available for the CP registers, or if we would
> > have to resort to trapping the entire MMIO page if we wanted to support
> > access to these registers (I don't think we would want to anyway).
> 
> I didn't find any spec for the memory mapped timer. But looking to the
> driver, it looks like they also have the concept of physical/virtual. So
> we may not need to trap.
> 
> Anyway, before implementing anything I'd like to find the corresponding
> spec.

It's in the ARM ARM, Appendix E of v7, plus references from Chapter B8.

I'd imagine it was in the v8 ARM ARM too, but I've not looked.

Ian.

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

end of thread, other threads:[~2015-01-14 16:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-13 20:07 [PATCH] xen/arm: Blacklist the memory mapped timer (armv7-timer-mem) Julien Grall
2015-01-14 11:02 ` Ian Campbell
2015-01-14 16:03   ` Julien Grall
2015-01-14 16:06     ` Ian Campbell

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.