* [PATCH for-4.6] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size
@ 2015-09-17 18:00 Julien Grall
2015-09-18 8:53 ` Ian Campbell
0 siblings, 1 reply; 5+ messages in thread
From: Julien Grall @ 2015-09-17 18:00 UTC (permalink / raw)
To: xen-devel; +Cc: Julien Grall, Wei.Liu2, stefano.stabellini, ian.campbell
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>
---
This is a candidate for Xen 4.6 and backport to Xen 4.5. Without this
patch we are mapping 4KB more than we should to any guest. While this
looks scary at first glance, in pratice there is always space after the
GIC I/O region. So we would just expose unused I/O range.
Boot tested on midway (ARM32) and x-gene (ARM64).
---
xen/arch/arm/vgic-v2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 524787b..fa71598 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -576,10 +576,10 @@ static int vgic_v2_domain_init(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(vgic_v2_hw.vbase + PAGE_SIZE));
+ 1, paddr_to_pfn(vgic_v2_hw.vbase + PAGE_SIZE));
else
ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
- 2, paddr_to_pfn(vgic_v2_hw.vbase + SZ_64K));
+ 1, paddr_to_pfn(vgic_v2_hw.vbase + SZ_64K));
if ( ret )
return ret;
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH for-4.6] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size
2015-09-17 18:00 [PATCH for-4.6] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size Julien Grall
@ 2015-09-18 8:53 ` Ian Campbell
2015-09-21 11:54 ` Ian Campbell
0 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2015-09-18 8:53 UTC (permalink / raw)
To: Julien Grall, xen-devel; +Cc: Wei.Liu2, stefano.stabellini
On Thu, 2015-09-17 at 19:00 +0100, Julien Grall wrote:
> 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>
> ---
>
> This is a candidate for Xen 4.6 and backport to Xen 4.5.
I concur and with Wei not being around I shall plan to apply later today
unless there are objections.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH for-4.6] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size
2015-09-18 8:53 ` Ian Campbell
@ 2015-09-21 11:54 ` Ian Campbell
2015-09-21 12:28 ` Julien Grall
0 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2015-09-21 11:54 UTC (permalink / raw)
To: Julien Grall, xen-devel; +Cc: stefano.stabellini, Wei.Liu2
On Fri, 2015-09-18 at 09:53 +0100, Ian Campbell wrote:
> On Thu, 2015-09-17 at 19:00 +0100, Julien Grall wrote:
> > 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>
>
> > ---
> >
> > This is a candidate for Xen 4.6 and backport to Xen 4.5.
>
> I concur and with Wei not being around I shall plan to apply later today
> unless there are objections.
I got distracted. Now applied to staging and staging-4.6 now and noted for
later application to 4.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH for-4.6] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size
2015-09-21 11:54 ` Ian Campbell
@ 2015-09-21 12:28 ` Julien Grall
2015-09-21 12:56 ` Ian Campbell
0 siblings, 1 reply; 5+ messages in thread
From: Julien Grall @ 2015-09-21 12:28 UTC (permalink / raw)
To: Ian Campbell, xen-devel; +Cc: stefano.stabellini, Wei.Liu2
Hi Ian,
On 21/09/15 12:54, Ian Campbell wrote:
> On Fri, 2015-09-18 at 09:53 +0100, Ian Campbell wrote:
>> On Thu, 2015-09-17 at 19:00 +0100, Julien Grall wrote:
>>> 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>
>>
>>> ---
>>>
>>> This is a candidate for Xen 4.6 and backport to Xen 4.5.
>>
>> I concur and with Wei not being around I shall plan to apply later today
>> unless there are objections.
>
> I got distracted. Now applied to staging and staging-4.6 now and noted for
> later application to 4.5
It won't apply cleanly for Xen 4.5, this code was living in the gic
driver. I will send a backport patch for it.
Regards,
--
Julien Grall
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH for-4.6] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size
2015-09-21 12:28 ` Julien Grall
@ 2015-09-21 12:56 ` Ian Campbell
0 siblings, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2015-09-21 12:56 UTC (permalink / raw)
To: Julien Grall, xen-devel; +Cc: stefano.stabellini, Wei.Liu2
On Mon, 2015-09-21 at 13:28 +0100, Julien Grall wrote:
> Hi Ian,
>
> On 21/09/15 12:54, Ian Campbell wrote:
> > On Fri, 2015-09-18 at 09:53 +0100, Ian Campbell wrote:
> > > On Thu, 2015-09-17 at 19:00 +0100, Julien Grall wrote:
> > > > 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>
> > >
> > > > ---
> > > >
> > > > This is a candidate for Xen 4.6 and backport to Xen 4.5.
> > >
> > > I concur and with Wei not being around I shall plan to apply later
> > > today
> > > unless there are objections.
> >
> > I got distracted. Now applied to staging and staging-4.6 now and noted
> > for
> > later application to 4.5
>
> It won't apply cleanly for Xen 4.5, this code was living in the gic
> driver. I will send a backport patch for it.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-09-21 12:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-17 18:00 [PATCH for-4.6] xen/arm: vgic-v2: Map the GIC virtual CPU interface with the correct size Julien Grall
2015-09-18 8:53 ` Ian Campbell
2015-09-21 11:54 ` Ian Campbell
2015-09-21 12:28 ` Julien Grall
2015-09-21 12:56 ` Ian Campbell
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).