* [RFC PATCH] xen/arm: GICv3 support for domU
@ 2014-08-20 10:09 vijay.kilari
2014-09-12 22:09 ` Julien Grall
0 siblings, 1 reply; 7+ messages in thread
From: vijay.kilari @ 2014-08-20 10:09 UTC (permalink / raw)
To: Ian.Campbell, julien.grall, stefano.stabellini,
stefano.stabellini, tim, jbeulich, xen-devel
Cc: Prasun.Kapoor, Vijaya Kumar K, manish.jaggi, vijay.kilari
From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
Update libxl tool for arm64 to generate GICv3 device
tree node for domU.
This patch is only for verifying DomU boot on hardware
with GICv3 support and hardcodes GICv3 node information
for DomU. Clean implementation is required using
domctl
Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
---
tools/libxl/libxl_arm.c | 15 ++++++++++-----
xen/arch/arm/gic-v3.c | 11 ++++++++++-
xen/include/public/arch-arm.h | 8 ++++++++
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index e19e2f4..c801c56 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -317,9 +317,8 @@ static int make_intc_node(libxl__gc *gc, void *fdt,
res = fdt_begin_node(fdt, name);
if (res) return res;
- res = fdt_property_compat(gc, fdt, 2,
- "arm,cortex-a15-gic",
- "arm,cortex-a9-gic");
+ res = fdt_property_compat(gc, fdt, 1,
+ "arm,gic-v3");
if (res) return res;
@@ -332,6 +331,12 @@ static int make_intc_node(libxl__gc *gc, void *fdt,
res = fdt_property(fdt, "interrupt-controller", NULL, 0);
if (res) return res;
+ res = fdt_property_cell(fdt, "redistributor-stride", GUEST_GICV3_RDIST_STRIDE);
+ if (res) return res;
+
+ res = fdt_property_cell(fdt, "#redistributor-regions", GUEST_GICV3_RDIST_REGIONS);
+ if (res) return res;
+
res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
2,
gicd_base, gicd_size,
@@ -521,8 +526,8 @@ next_resize:
FDT( make_memory_nodes(gc, fdt, dom) );
FDT( make_intc_node(gc, fdt,
- GUEST_GICD_BASE, GUEST_GICD_SIZE,
- GUEST_GICC_BASE, GUEST_GICD_SIZE) );
+ GUEST_GICV3_GICD_BASE, GUEST_GICV3_GICD_SIZE,
+ GUEST_GICV3_GICR_BASE, GUEST_GICV3_GICR_SIZE) );
FDT( make_timer_node(gc, fdt, ainfo) );
FDT( make_hypervisor_node(gc, fdt, vers) );
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 9291a7a..d00561b 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -906,7 +906,16 @@ static int gicv_v3_init(struct domain *d)
d->arch.vgic.rdist_count = gicv3.rdist_count;
}
else
- d->arch.vgic.dbase = GUEST_GICD_BASE;
+ {
+ d->arch.vgic.dbase = GUEST_GICV3_GICD_BASE;
+ d->arch.vgic.dbase_size = GUEST_GICV3_GICD_SIZE;
+
+ d->arch.vgic.rbase[0] = GUEST_GICV3_GICR_BASE;
+ d->arch.vgic.rbase_size[0] = GUEST_GICV3_GICR_SIZE;
+ d->arch.vgic.rdist_stride = GUEST_GICV3_RDIST_STRIDE;
+ /* XXX: Only one Re-distributor region mapped for guest */
+ d->arch.vgic.rdist_count = GUEST_GICV3_RDIST_REGIONS;
+ }
d->arch.vgic.nr_lines = 0;
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index ac54cd6..c7c12e0 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -369,6 +369,14 @@ typedef uint64_t xen_callback_t;
#define GUEST_GICC_BASE 0x03002000ULL
#define GUEST_GICC_SIZE 0x00000100ULL
+/* GICv3 address space */
+#define GUEST_GICV3_GICD_BASE 0x03001000ULL
+#define GUEST_GICV3_GICD_SIZE 0x10000ULL
+#define GUEST_GICV3_GICR_BASE 0x03020000ULL
+#define GUEST_GICV3_GICR_SIZE 0x200000ULL
+#define GUEST_GICV3_RDIST_STRIDE 0x20000ULL
+#define GUEST_GICV3_RDIST_REGIONS 0x1ULL
+
/* 16MB == 4096 pages reserved for guest to use as a region to map its
* grant table in.
*/
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] xen/arm: GICv3 support for domU
2014-08-20 10:09 [RFC PATCH] xen/arm: GICv3 support for domU vijay.kilari
@ 2014-09-12 22:09 ` Julien Grall
2014-09-15 15:13 ` Vijay Kilari
0 siblings, 1 reply; 7+ messages in thread
From: Julien Grall @ 2014-09-12 22:09 UTC (permalink / raw)
To: vijay.kilari, Ian.Campbell, stefano.stabellini,
stefano.stabellini, tim, jbeulich, xen-devel
Cc: Prasun.Kapoor, vijaya.kumar, manish.jaggi
Hi Vijay,
On 20/08/14 03:09, vijay.kilari@gmail.com wrote:
> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
>
> Update libxl tool for arm64 to generate GICv3 device
> tree node for domU.
>
> This patch is only for verifying DomU boot on hardware
> with GICv3 support and hardcodes GICv3 node information
> for DomU. Clean implementation is required using
> domctl
Thank you for this patch. Do you plan to send a clean implementation soon?
Regards,
--
Julien Grall
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] xen/arm: GICv3 support for domU
2014-09-12 22:09 ` Julien Grall
@ 2014-09-15 15:13 ` Vijay Kilari
2014-09-22 11:53 ` Vijay Kilari
0 siblings, 1 reply; 7+ messages in thread
From: Vijay Kilari @ 2014-09-15 15:13 UTC (permalink / raw)
To: Julien Grall
Cc: Ian Campbell, Stefano Stabellini, Prasun Kapoor, Vijaya Kumar K,
Tim Deegan, xen-devel@lists.xen.org, Stefano Stabellini,
Jan Beulich, manish.jaggi
Hi Julien,
On Sat, Sep 13, 2014 at 3:39 AM, Julien Grall <julien.grall@linaro.org> wrote:
> Hi Vijay,
>
> On 20/08/14 03:09, vijay.kilari@gmail.com wrote:
>>
>> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
>>
>> Update libxl tool for arm64 to generate GICv3 device
>> tree node for domU.
>>
>> This patch is only for verifying DomU boot on hardware
>> with GICv3 support and hardcodes GICv3 node information
>> for DomU. Clean implementation is required using
>> domctl
>
>
> Thank you for this patch. Do you plan to send a clean implementation soon?
I plan to implemented generic gicv2/gicv3 dt node
based on your patch "xen/dts: Add hypercalls to retrieve device node
information"
to read gic device compatibility.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] xen/arm: GICv3 support for domU
2014-09-15 15:13 ` Vijay Kilari
@ 2014-09-22 11:53 ` Vijay Kilari
2014-09-22 12:44 ` Julien Grall
0 siblings, 1 reply; 7+ messages in thread
From: Vijay Kilari @ 2014-09-22 11:53 UTC (permalink / raw)
To: Julien Grall
Cc: Ian Campbell, Stefano Stabellini, Prasun Kapoor, Vijaya Kumar K,
Tim Deegan, xen-devel@lists.xen.org, Stefano Stabellini,
Jan Beulich, manish.jaggi
Hi Julien,
On Mon, Sep 15, 2014 at 8:43 PM, Vijay Kilari <vijay.kilari@gmail.com> wrote:
> Hi Julien,
>
> On Sat, Sep 13, 2014 at 3:39 AM, Julien Grall <julien.grall@linaro.org> wrote:
>> Hi Vijay,
>>
>> On 20/08/14 03:09, vijay.kilari@gmail.com wrote:
>>>
>>> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
>>>
>>> Update libxl tool for arm64 to generate GICv3 device
>>> tree node for domU.
>>>
>>> This patch is only for verifying DomU boot on hardware
>>> with GICv3 support and hardcodes GICv3 node information
>>> for DomU. Clean implementation is required using
>>> domctl
>>
>>
>> Thank you for this patch. Do you plan to send a clean implementation soon?
>
> I plan to implemented generic gicv2/gicv3 dt node
> based on your patch "xen/dts: Add hypercalls to retrieve device node
> information"
> to read gic device compatibility.
Your patch "xen/dts: Add hypercalls to retrieve device node information"
always relies on full node patch to read device node information.
But in some cases, like GIC we don't have full patch. Here we need
to fetch node information like compatibility and other properties like number of
re-distributor regions, re-distributor offset etc., from node name.
So new set of hypercalls which take node name instead of path is required.
Regards
Vijay
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] xen/arm: GICv3 support for domU
2014-09-22 11:53 ` Vijay Kilari
@ 2014-09-22 12:44 ` Julien Grall
2014-09-22 13:15 ` Vijay Kilari
0 siblings, 1 reply; 7+ messages in thread
From: Julien Grall @ 2014-09-22 12:44 UTC (permalink / raw)
To: Vijay Kilari
Cc: Ian Campbell, Stefano Stabellini, Prasun Kapoor, Vijaya Kumar K,
Tim Deegan, xen-devel@lists.xen.org, Stefano Stabellini,
Jan Beulich, manish.jaggi
Hello Vijay,
On 09/22/2014 12:53 PM, Vijay Kilari wrote:
> On Mon, Sep 15, 2014 at 8:43 PM, Vijay Kilari <vijay.kilari@gmail.com> wrote:
>> Hi Julien,
>>
>> On Sat, Sep 13, 2014 at 3:39 AM, Julien Grall <julien.grall@linaro.org> wrote:
>>> Hi Vijay,
>>>
>>> On 20/08/14 03:09, vijay.kilari@gmail.com wrote:
>>>>
>>>> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
>>>>
>>>> Update libxl tool for arm64 to generate GICv3 device
>>>> tree node for domU.
>>>>
>>>> This patch is only for verifying DomU boot on hardware
>>>> with GICv3 support and hardcodes GICv3 node information
>>>> for DomU. Clean implementation is required using
>>>> domctl
>>>
>>>
>>> Thank you for this patch. Do you plan to send a clean implementation soon?
>>
>> I plan to implemented generic gicv2/gicv3 dt node
>> based on your patch "xen/dts: Add hypercalls to retrieve device node
>> information"
>> to read gic device compatibility.
>
> Your patch "xen/dts: Add hypercalls to retrieve device node information"
> always relies on full node patch to read device node information.
>
> But in some cases, like GIC we don't have full patch. Here we need
> to fetch node information like compatibility and other properties like number of
> re-distributor regions, re-distributor offset etc., from node name.
>
> So new set of hypercalls which take node name instead of path is required.
I guess when you said "patch", you meant "path", right?
Why do you need to get those information? You should define yourself the
regions of the GICv3 in the guest layout and not relying on the host DT.
In anycase, using the name of the node would be be broken as it could be
duplicated and it's not standardize.
Lastly, I don't plan to keep the patch "xen/dts: Add hypercalls to
retrieve device node information" in my series. See the discussion on
the cover letter.
Regards,
--
Julien Grall
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] xen/arm: GICv3 support for domU
2014-09-22 12:44 ` Julien Grall
@ 2014-09-22 13:15 ` Vijay Kilari
2014-09-22 14:02 ` Ian Campbell
0 siblings, 1 reply; 7+ messages in thread
From: Vijay Kilari @ 2014-09-22 13:15 UTC (permalink / raw)
To: Julien Grall
Cc: Ian Campbell, Stefano Stabellini, Prasun Kapoor, Vijaya Kumar K,
Tim Deegan, xen-devel@lists.xen.org, Stefano Stabellini,
Jan Beulich, manish.jaggi
On Mon, Sep 22, 2014 at 6:14 PM, Julien Grall <julien.grall@linaro.org> wrote:
> Hello Vijay,
>
> On 09/22/2014 12:53 PM, Vijay Kilari wrote:
>> On Mon, Sep 15, 2014 at 8:43 PM, Vijay Kilari <vijay.kilari@gmail.com> wrote:
>>> Hi Julien,
>>>
>>> On Sat, Sep 13, 2014 at 3:39 AM, Julien Grall <julien.grall@linaro.org> wrote:
>>>> Hi Vijay,
>>>>
>>>> On 20/08/14 03:09, vijay.kilari@gmail.com wrote:
>>>>>
>>>>> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
>>>>>
>>>>> Update libxl tool for arm64 to generate GICv3 device
>>>>> tree node for domU.
>>>>>
>>>>> This patch is only for verifying DomU boot on hardware
>>>>> with GICv3 support and hardcodes GICv3 node information
>>>>> for DomU. Clean implementation is required using
>>>>> domctl
>>>>
>>>>
>>>> Thank you for this patch. Do you plan to send a clean implementation soon?
>>>
>>> I plan to implemented generic gicv2/gicv3 dt node
>>> based on your patch "xen/dts: Add hypercalls to retrieve device node
>>> information"
>>> to read gic device compatibility.
>>
>> Your patch "xen/dts: Add hypercalls to retrieve device node information"
>> always relies on full node patch to read device node information.
>>
>> But in some cases, like GIC we don't have full patch. Here we need
>> to fetch node information like compatibility and other properties like number of
>> re-distributor regions, re-distributor offset etc., from node name.
>>
>> So new set of hypercalls which take node name instead of path is required.
>
> I guess when you said "patch", you meant "path", right?
Yes path
>
> Why do you need to get those information? You should define yourself the
> regions of the GICv3 in the guest layout and not relying on the host DT.
In make_intc_node() in llibxl_arm.c the compatibility and mmio regions are
hardcoded to GICv2. So to make it GICv3 I think of two options
1) Generate GIC node for domU that host DT supports.
With this approach I thought of using the hypercalls that you have created.
2) Parse domU config file and generate GIC accordingly?
Regards
Vijay
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] xen/arm: GICv3 support for domU
2014-09-22 13:15 ` Vijay Kilari
@ 2014-09-22 14:02 ` Ian Campbell
0 siblings, 0 replies; 7+ messages in thread
From: Ian Campbell @ 2014-09-22 14:02 UTC (permalink / raw)
To: Vijay Kilari
Cc: Stefano Stabellini, Prasun Kapoor, Vijaya Kumar K, Julien Grall,
Tim Deegan, xen-devel@lists.xen.org, Stefano Stabellini,
Jan Beulich, manish.jaggi
On Mon, 2014-09-22 at 18:45 +0530, Vijay Kilari wrote:
> > Why do you need to get those information? You should define yourself the
> > regions of the GICv3 in the guest layout and not relying on the host DT.
>
> In make_intc_node() in llibxl_arm.c the compatibility and mmio regions are
> hardcoded to GICv2. So to make it GICv3 I think of two options
>
> 1) Generate GIC node for domU that host DT supports.
> With this approach I thought of using the hypercalls that you have created.
> 2) Parse domU config file and generate GIC accordingly?
You should do 2, but with the default (v2 vs v3) set based on what the
host supports (i.e. it's two or three-ness, not the actual
properties/addresses which should be made up for the virtual platform
not the host).
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-09-22 14:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-20 10:09 [RFC PATCH] xen/arm: GICv3 support for domU vijay.kilari
2014-09-12 22:09 ` Julien Grall
2014-09-15 15:13 ` Vijay Kilari
2014-09-22 11:53 ` Vijay Kilari
2014-09-22 12:44 ` Julien Grall
2014-09-22 13:15 ` Vijay Kilari
2014-09-22 14:02 ` 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).