lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 17 May 2016 15:55:54 +0100
From:	Paul Burton <paul.burton@...tec.com>
To:	<linux-mips@...ux-mips.org>, Ralf Baechle <ralf@...ux-mips.org>
CC:	"Maciej W . Rozycki" <Maciej.Rozycki@...tec.com>,
	Paul Burton <paul.burton@...tec.com>,
	"stable # v4 . 4+" <stable@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH v2 2/2] MIPS: Error out if unsupported compact branch policy is set

If an explicit compact branch policy is requested by the user via the
debug options in Kconfig, and the toolchain does not support specifying
an explicit compact branch policy, then error out with an understandable
error message to make it clearer what's happened.

Signed-off-by: Paul Burton <paul.burton@...tec.com>
Fixes: c1a0e9bc885d ("MIPS: Allow compact branch policy to be changed")
Cc: stable <stable@...r.kernel.org> # v4.4+

---

Changes in v2:
- New patch.

 arch/mips/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index e78d60d..1ac4612 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -194,9 +194,13 @@ toolchain-msa				:= $(call cc-option-yn,$(mips-cflags) -mhard-float -mfp64 -Wa$(
 cflags-$(toolchain-msa)			+= -DTOOLCHAIN_SUPPORTS_MSA
 endif
 
-cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_NEVER)	+= -mcompact-branches=never
-cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_OPTIMAL)	+= -mcompact-branches=optimal
-cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_ALWAYS)	+= -mcompact-branches=always
+ifeq ($(call cc-option-yn,-mcompact-branches=optimal), y)
+  cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_NEVER)		+= -mcompact-branches=never
+  cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_OPTIMAL)	+= -mcompact-branches=optimal
+  cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_ALWAYS)		+= -mcompact-branches=always
+else ifneq ($(CONFIG_MIPS_COMPACT_BRANCHES_DEFAULT),y)
+  $(error Compact branch policy specified, but lacking toolchain support)
+endif
 
 #
 # Firmware support
-- 
2.8.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ