* ARM cross-compile build fix
@ 2016-09-07 8:24 Razvan Cojocaru
2016-09-07 8:46 ` Julien Grall
0 siblings, 1 reply; 2+ messages in thread
From: Razvan Cojocaru @ 2016-09-07 8:24 UTC (permalink / raw)
To: xen-devel; +Cc: Julien Grall, Stefano Stabellini, Jan Beulich
Hello,
The fastest way to compile-check the patches that touch ARM bits is to
simply cross-compile, and I've followed the instructions here:
https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/CrossCompiling#64-bit_crossbuild
However, there was an error trying to build master, several macros were
redefined in arch-arm.h (originally defined in ptrace.h). The following
patch has fixed the problem for me, but it's rather crude:
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 870bc3b..e4560a5 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -362,13 +362,27 @@ typedef uint64_t xen_callback_t;
/* 64 bit modes */
#define PSR_MODE_BIT 0x10 /* Set iff AArch32 */
+#ifndef PSR_MODE_EL3h
#define PSR_MODE_EL3h 0x0d
+#endif
+#ifndef PSR_MODE_EL3t
#define PSR_MODE_EL3t 0x0c
+#endif
+#ifndef PSR_MODE_EL2h
#define PSR_MODE_EL2h 0x09
+#endif
+#ifndef PSR_MODE_EL2t
#define PSR_MODE_EL2t 0x08
+#endif
+#ifndef PSR_MODE_EL1h
#define PSR_MODE_EL1h 0x05
+#endif
+#ifndef PSR_MODE_EL1t
#define PSR_MODE_EL1t 0x04
+#endif
+#ifndef PSR_MODE_EL0t
#define PSR_MODE_EL0t 0x00
+#endif
#define PSR_GUEST32_INIT
(PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC)
#define PSR_GUEST64_INIT
(PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_EL1h)
I'm not sure this is the right fix, which is why I didn't send the patch
for review the usual way, but I hope it's helpful. Please let me know if
you'd like me to send a proper patch.
Thanks,
Razvan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: ARM cross-compile build fix
2016-09-07 8:24 ARM cross-compile build fix Razvan Cojocaru
@ 2016-09-07 8:46 ` Julien Grall
0 siblings, 0 replies; 2+ messages in thread
From: Julien Grall @ 2016-09-07 8:46 UTC (permalink / raw)
To: Razvan Cojocaru, xen-devel; +Cc: Stefano Stabellini, Jan Beulich
On 07/09/2016 09:24, Razvan Cojocaru wrote:
> Hello,
Hello Razvan,
>
> The fastest way to compile-check the patches that touch ARM bits is to
> simply cross-compile, and I've followed the instructions here:
>
> https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/CrossCompiling#64-bit_crossbuild
>
> However, there was an error trying to build master, several macros were
> redefined in arch-arm.h (originally defined in ptrace.h). The following
> patch has fixed the problem for me, but it's rather crude:
>
> diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
> index 870bc3b..e4560a5 100644
> --- a/xen/include/public/arch-arm.h
> +++ b/xen/include/public/arch-arm.h
> @@ -362,13 +362,27 @@ typedef uint64_t xen_callback_t;
>
> /* 64 bit modes */
> #define PSR_MODE_BIT 0x10 /* Set iff AArch32 */
> +#ifndef PSR_MODE_EL3h
> #define PSR_MODE_EL3h 0x0d
> +#endif
> +#ifndef PSR_MODE_EL3t
> #define PSR_MODE_EL3t 0x0c
> +#endif
> +#ifndef PSR_MODE_EL2h
> #define PSR_MODE_EL2h 0x09
> +#endif
> +#ifndef PSR_MODE_EL2t
> #define PSR_MODE_EL2t 0x08
> +#endif
> +#ifndef PSR_MODE_EL1h
> #define PSR_MODE_EL1h 0x05
> +#endif
> +#ifndef PSR_MODE_EL1t
> #define PSR_MODE_EL1t 0x04
> +#endif
> +#ifndef PSR_MODE_EL0t
> #define PSR_MODE_EL0t 0x00
> +#endif
>
> #define PSR_GUEST32_INIT
> (PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC)
> #define PSR_GUEST64_INIT
> (PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_EL1h)
>
> I'm not sure this is the right fix, which is why I didn't send the patch
> for review the usual way, but I hope it's helpful. Please let me know if
> you'd like me to send a proper patch.
This is a glibc bug and is already documented on the wiki:
https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions#error:_.22PSR_MODE_EL3h.22_redefined
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-07 8:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-07 8:24 ARM cross-compile build fix Razvan Cojocaru
2016-09-07 8:46 ` Julien Grall
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).