[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v4 3/8] xen/arm: introduce kinfo->guest_phandle_gic
Hi,
On 9/10/19 10:14 PM, Julien Grall wrote:
diff --git a/xen/include/asm-arm/kernel.h b/xen/include/asm-arm/kernel.h
index 33f3e72b11..760434369b 100644
--- a/xen/include/asm-arm/kernel.h
+++ b/xen/include/asm-arm/kernel.h
@@ -36,6 +36,9 @@ struct kernel_info {
/* Enable pl011 emulation */
bool vpl011;
+ /* GIC phandle */
+ uint32_t guest_phandle_gic;
Looking at the usage, I think this should be fdt32_t because you are
directly passing the value to the FDT calls.
This makes me realize that we consistently use wrongly GUEST_PHANDLE_GIC
in both Xen and libxl. Indeed, as we pass the value directly the guest
will not see 65000 but 3908894720 as it will do the conversion from
big-endian to little-endian.
I can see two solution to fix this:
1) define GUEST_PHANDLE_GIC as cpu_to_be32(65000)
2) Use cpu_to_be32(GUEST_PHANDLE_GIC)
It would be good to agree how GUEST_PHANDLE_GIC is used so we have the
same behavior when the DT is created by Xen and libxl.
Hmmm, I actually misread the API, the function actually take a
CPU-endian value. So uin32_t is correct here and there are nothing has
to be done.
Sorry for the noise.
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|