Thread (60 messages) 60 messages, 6 authors, 2020-01-21

Re: [PATCH v3 15/16] arm64: compile the kernel with ptrauth return address signing

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2020-01-21 16:50:22

On Tue, Jan 21, 2020 at 02:37:44PM +0000, Amit Kachhap wrote:
On 1/17/20 11:49 AM, Catalin Marinas wrote:
quoted
Also Will had a preference for warning during build if the user
requested a feature in .config (i.e. PAC) but the compiler/assembler
does not support it (that was for the LSE patch above). You could
attempt something similar with this patch.
I tried to add warnings like below which are in similar line to the above
link,

ifeq ($(CONFIG_ARM64_PTR_AUTH),y)
+  ifneq ($(CONFIG_CC_HAS_SIGN_RETURN_ADDRESS),y)
+    ifneq ($(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET),y)
+$(warning Pointer authentication not supported by compiler)
+    endif
+  endif
+  ifneq ($(CONFIG_AS_HAS_PAC),y)
+$(warning Pointer authentication not supported by assembler)
+  endif
endif

But the issue is that warnings are printed twice and becomes confusing.
First warning computed with the incorrect Kconfig flags and later with the
correct computed Kconfig flags. This may be due to arch/arm64/Kconfig
sourced twice.
I think there are two passes over the opt arch Makefile, hence a
warning based on the old config. Maybe there is a way to check which
pass this is and skip the check in the first instance. It needs more
digging, otherwise we could move the check to kernel/Makefile.

Yet another option would be to check whether CONFIG_AS_HAS_PAC in
.config is backed by the actual assembler option via the Makefile. It
means we duplicate the as-option check but it may be the cleanest.

Anyway, for the time being, just get the dependencies correctly in
Kconfig without the warnings.

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help