[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <24cdf320-35e3-76f2-6e07-8b5548ac67a0@android.com>
Date: Wed, 1 Nov 2017 10:49:00 -0700
From: Mark Salyzyn <salyzyn@...roid.com>
To: Robin Murphy <robin.murphy@....com>, linux-kernel@...r.kernel.org
Cc: Mark Rutland <mark.rutland@....com>,
Christoffer Dall <cdall@...aro.org>,
Stefan Traby <stefan@...lo-penguin.com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Marc Zyngier <marc.zyngier@....com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Dave Martin <Dave.Martin@....com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] arm64: write_sysreg asm illegal for aarch32
On 11/01/2017 10:14 AM, Robin Murphy wrote:
> On 01/11/17 16:58, Mark Salyzyn wrote:
>> Cross compiling to aarch32 (for vdso32) using clang correctly
>> identifies that (the unused) write_sysreg inline asm directive is
>> illegal in that architectural context:
>>
>> arch/arm64/include/asm/arch_timer.h: error: invalid input constraint 'rZ' in asm
>> write_sysreg(cntkctl, cntkctl_el1);
>> ^
>> arch/arm64/include/asm/sysreg.h: note: expanded from macro 'write_sysreg'
>> : : "rZ" (__val));
>> ^
>>
>> GCC normally checks for correctness everywhere. But uniquely for
>> unused asm, will optimize out and suppress the error report.
> It sounds more like some paths are wrong in the compat vDSO build if
> it's pulling in this header in the first place - nothing in this file is
> relevant to AArch32.
>
> Robin.
>
And yet, when you CROSS_COMPILE_ARM32 a vdso32, you have no choice but
to utilize the arm64 headers since they contain all the relevant kernel
structures and environment.
asm/arch_timer.h (remember we are using arm instructions to access
arch64 timers)
linux/time.h (really only for struct timespec())
asm/processor.h (eg: cpu_relax())
pull in a _lot_ of architectural related cruft that always somehow picks
up asm/sysreg.h somewhere in the multitude of includes to fulfill some
unused inline's needs.
-- Mark
Powered by blists - more mailing lists