From: Ian Campbell Subject: Re: [PATCH 4/4] xenctx: Support arm64 and actually implement output for 32 and 64 bit Date: Fri, 12 Apr 2013 15:36:31 +0100 Message-ID: <1365777391.15783.73.camel@zakaz.uk.xensource.com> References: <1365772372.15783.40.camel@zakaz.uk.xensource.com> <1365772407-32225-4-git-send-email-ian.campbell@citrix.com> <1365776702.15783.67.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1365776702.15783.67.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xen.org" Cc: "Tim (Xen.org)" , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 2013-04-12 at 15:25 +0100, Ian Campbell wrote: > On Fri, 2013-04-12 at 14:13 +0100, Ian Campbell wrote: > (there's actually an issue with this change, but I'm going to comment on > that separately since it is thorny) [...] > @@ -218,7 +218,7 @@ typedef uint64_t xen_callback_t; > #define PSR_MODE_SYS 0x1f > > /* 64 bit modes */ > -#ifdef CONFIG_ARM_64 > +#ifdef __aarch64__ > #define PSR_MODE_BIT 0x10 /* Set iff AArch32 */ > #define PSR_MODE_EL3h 0x0d > #define PSR_MODE_EL3t 0x0c There is an issue here which is: tools/include/xen/arch-arm.h:229:0: error: "PSR_MODE_EL0t" redefined [-Werror] In file included from /usr/lib/gcc-cross/aarch64-linux-gnu/4.7/../../../../aarch64-linux-gnu/include/sys/user.h:25:0, from /usr/lib/gcc-cross/aarch64-linux-gnu/4.7/../../../../aarch64-linux-gnu/include/sys/procfs.h:34, from /usr/lib/gcc-cross/aarch64-linux-gnu/4.7/../../../../aarch64-linux-gnu/include/sys/ucontext.h:26, from /usr/lib/gcc-cross/aarch64-linux-gnu/4.7/../../../../aarch64-linux-gnu/include/signal.h:360, from xentrace.c:21: /usr/lib/gcc-cross/aarch64-linux-gnu/4.7/../../../../aarch64-linux-gnu/include/asm/ptrace.h:30:0: note: this is the location of the previous definition This is because Linux's asm/ptrace.h (which is in the include chain from ) defines a bunch of extra symbols. I "solved" it with the hack below, but really I think this is a bug in either Linux on arm64, or perhaps glibc for propagating it. I'll bring it up with the kernel guys but I wonder if we ought to take the patch as a skanky workaround for now... Ian. 8<------------------- >From 8d67164fce5e21e2b6353b02834aa40c81bb714a Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 12 Apr 2013 15:33:55 +0100 Subject: [PATCH] arm: Undefine PSR_MODE_* in public arch-arm.h These clash with symbols in Linux asm/ptrace.h. This is probably a bug in Linux (or perhaps glibc) but we work around it here. Signed-off-by: Ian Campbell --- xen/include/public/arch-arm.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index 2f5ce18..d1753d8 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -219,6 +219,16 @@ typedef uint64_t xen_callback_t; /* 64 bit modes */ #ifdef __aarch64__ + +#undef PSR_MODE_BIT +#undef PSR_MODE_EL3h +#undef PSR_MODE_EL3t +#undef PSR_MODE_EL2h +#undef PSR_MODE_EL2t +#undef PSR_MODE_EL1h +#undef PSR_MODE_EL1t +#undef PSR_MODE_EL0t + #define PSR_MODE_BIT 0x10 /* Set iff AArch32 */ #define PSR_MODE_EL3h 0x0d #define PSR_MODE_EL3t 0x0c -- 1.7.10.4