All of lore.kernel.org
 help / color / mirror / Atom feed
* [[BACKPORT 4.5]] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size
@ 2015-09-25 13:10 Julien Grall
  2015-09-25 13:39 ` Ian Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Grall @ 2015-09-25 13:10 UTC (permalink / raw)
  To: xen-devel; +Cc: Julien Grall, ian.campbell, jbeulich

On GICv2, the GIC virtual CPU interface is at minimum 8KB. Due some to
some necessary quirk for GIC using 64KB stride, we are mapping the
region in 2 time.
The first mapping is 4KB and the second one is 8KB, i.e 12KB in total.
Although the minimum supported size (and widely used) is 8KB. This means
that we are mapping 4KB more to any guest using GICv2.

While this looks scary at first glance, the GIC virtual CPU interface is
most frequently at the end the GIC I/O region. So we will most likely
map an an unused I/O region or a mirrored version of GICV for platform
using 64KB stride.

Nonetheless, fix the second mapping to only map 4KB.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
(Backported from 493a67ee4a3fd9420e94fa2cf108e2a27961202b)

---

The original patch doesn't apply cleanly in Xen 4.5 because the code has
been moved from gic-v2.c to vgic-v2.c in Xen 4.6.

Ian, I'm not sure if I should have kept your Acked-by here.

Conflicts:
	xen/arch/arm/vgic-v2.c
---
 xen/arch/arm/gic-v2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 31fb81a..ac64f7f 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -446,10 +446,10 @@ static int gicv2v_setup(struct domain *d)
 
     if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
         ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
-                               2, paddr_to_pfn(gicv2.vbase + PAGE_SIZE));
+                               1, paddr_to_pfn(gicv2.vbase + PAGE_SIZE));
     else
         ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
-                               2, paddr_to_pfn(gicv2.vbase + 16*PAGE_SIZE));
+                               1, paddr_to_pfn(gicv2.vbase + 16*PAGE_SIZE));
 
     return ret;
 }
-- 
2.1.4

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

* Re: [[BACKPORT 4.5]] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size
  2015-09-25 13:10 [[BACKPORT 4.5]] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size Julien Grall
@ 2015-09-25 13:39 ` Ian Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-09-25 13:39 UTC (permalink / raw)
  To: Julien Grall, xen-devel; +Cc: jbeulich

On Fri, 2015-09-25 at 14:10 +0100, Julien Grall wrote:

FYI your Subject resulted in git am making a commit titled:
] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size

You probably just forgot that --subject-prefix has the []'s added
automatically, but if it was deliberate please don't ;-)

I've fixed this.

> The original patch doesn't apply cleanly in Xen 4.5 because the code has
> been moved from gic-v2.c to vgic-v2.c in Xen 4.6.

Thanks, applied.

> Ian, I'm not sure if I should have kept your Acked-by here.

They are normally retained in the backports, whether they are done by
cherry-pick or not. I think it was fine for you to do so.

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

end of thread, other threads:[~2015-09-25 13:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-25 13:10 [[BACKPORT 4.5]] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size Julien Grall
2015-09-25 13:39 ` 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.