Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1384793 > unrolled thread
| Started by | Paul Burton <paul.burton@imgtec.com> |
|---|---|
| First post | 2016-04-22 10:50 +0200 |
| Last post | 2016-04-22 19:40 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] MIPS: Allow R6 compact branch policy to be left unspecified Paul Burton <paul.burton@imgtec.com> - 2016-04-22 10:50 +0200
Re: [PATCH] MIPS: Allow R6 compact branch policy to be left unspecified "Maciej W. Rozycki" <macro@imgtec.com> - 2016-04-22 18:00 +0200
Re: [PATCH] MIPS: Allow R6 compact branch policy to be left unspecified James Hogan <james.hogan@imgtec.com> - 2016-04-22 19:40 +0200
| From | Paul Burton <paul.burton@imgtec.com> |
|---|---|
| Date | 2016-04-22 10:50 +0200 |
| Subject | [PATCH] MIPS: Allow R6 compact branch policy to be left unspecified |
| Message-ID | <rqEWJ-7zC-1@gated-at.bofh.it> |
It turns out that some toolchains which support MIPS R6 don't support
the -mcompact-branches flag to specify compact branch behaviour. Default
to not providing the -mcompact-branch option to the compiler such that
we can build with such toolchains.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: c1a0e9bc885d ("MIPS: Allow compact branch policy to be changed")
Cc: stable <stable@vger.kernel.org> # v4.4+
---
arch/mips/Kconfig.debug | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
index f0e314c..e91b3d1 100644
--- a/arch/mips/Kconfig.debug
+++ b/arch/mips/Kconfig.debug
@@ -117,7 +117,15 @@ if CPU_MIPSR6
choice
prompt "Compact branch policy"
- default MIPS_COMPACT_BRANCHES_OPTIMAL
+ default MIPS_COMPACT_BRANCHES_DEFAULT
+
+config MIPS_COMPACT_BRANCHES_DEFAULT
+ bool "Toolchain Default (don't specify)"
+ help
+ Don't pass the -mcompact-branches flag to the compiler, allowing it
+ to use its default (generally "optimal"). This is particularly
+ useful for early R6-supporting toolchains which don't support the
+ -mcompact-branches flag.
config MIPS_COMPACT_BRANCHES_NEVER
bool "Never (force delay slot branches)"
--
2.8.0
[toc] | [next] | [standalone]
| From | "Maciej W. Rozycki" <macro@imgtec.com> |
|---|---|
| Date | 2016-04-22 18:00 +0200 |
| Subject | Re: [PATCH] MIPS: Allow R6 compact branch policy to be left unspecified |
| Message-ID | <rqLET-4cJ-19@gated-at.bofh.it> |
| In reply to | #1384793 |
On Fri, 22 Apr 2016, Paul Burton wrote:
> It turns out that some toolchains which support MIPS R6 don't support
> the -mcompact-branches flag to specify compact branch behaviour. Default
> to not providing the -mcompact-branch option to the compiler such that
> we can build with such toolchains.
Good idea overall, one further suggestion below.
> diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
> index f0e314c..e91b3d1 100644
> --- a/arch/mips/Kconfig.debug
> +++ b/arch/mips/Kconfig.debug
> @@ -117,7 +117,15 @@ if CPU_MIPSR6
>
> choice
> prompt "Compact branch policy"
> - default MIPS_COMPACT_BRANCHES_OPTIMAL
> + default MIPS_COMPACT_BRANCHES_DEFAULT
> +
> +config MIPS_COMPACT_BRANCHES_DEFAULT
> + bool "Toolchain Default (don't specify)"
> + help
> + Don't pass the -mcompact-branches flag to the compiler, allowing it
> + to use its default (generally "optimal"). This is particularly
> + useful for early R6-supporting toolchains which don't support the
> + -mcompact-branches flag.
>
> config MIPS_COMPACT_BRANCHES_NEVER
> bool "Never (force delay slot branches)"
How about making the option depend on DEBUG_KERNEL and maybe making it an
umbrella setting to hide details from users who do not want to be
bothered, i.e. something like:
config MIPS_COMPACT_BRANCHES_OVERRIDE
bool "Override the toolchain default for compact branch policy"
depends on DEBUG_KERNEL
default n
[...]
if MIPS_COMPACT_BRANCHES_OVERRIDE
choice
prompt "Compact branch policy"
default MIPS_COMPACT_BRANCHES_OPTIMAL
[...]
endif # MIPS_COMPACT_BRANCHES_OVERRIDE
?
Maciej
[toc] | [prev] | [next] | [standalone]
| From | James Hogan <james.hogan@imgtec.com> |
|---|---|
| Date | 2016-04-22 19:40 +0200 |
| Subject | Re: [PATCH] MIPS: Allow R6 compact branch policy to be left unspecified |
| Message-ID | <rqNdD-5NN-5@gated-at.bofh.it> |
| In reply to | #1385326 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, Apr 22, 2016 at 04:56:02PM +0100, Maciej W. Rozycki wrote: > On Fri, 22 Apr 2016, Paul Burton wrote: > > > It turns out that some toolchains which support MIPS R6 don't support > > the -mcompact-branches flag to specify compact branch behaviour. Default > > to not providing the -mcompact-branch option to the compiler such that > > we can build with such toolchains. > > Good idea overall, one further suggestion below. > > > diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug > > index f0e314c..e91b3d1 100644 > > --- a/arch/mips/Kconfig.debug > > +++ b/arch/mips/Kconfig.debug > > @@ -117,7 +117,15 @@ if CPU_MIPSR6 > > > > choice > > prompt "Compact branch policy" > > - default MIPS_COMPACT_BRANCHES_OPTIMAL > > + default MIPS_COMPACT_BRANCHES_DEFAULT > > + > > +config MIPS_COMPACT_BRANCHES_DEFAULT > > + bool "Toolchain Default (don't specify)" > > + help > > + Don't pass the -mcompact-branches flag to the compiler, allowing it > > + to use its default (generally "optimal"). This is particularly > > + useful for early R6-supporting toolchains which don't support the > > + -mcompact-branches flag. > > > > config MIPS_COMPACT_BRANCHES_NEVER > > bool "Never (force delay slot branches)" > > How about making the option depend on DEBUG_KERNEL and maybe making it an > umbrella setting to hide details from users who do not want to be > bothered, i.e. something like: > > config MIPS_COMPACT_BRANCHES_OVERRIDE > bool "Override the toolchain default for compact branch policy" > depends on DEBUG_KERNEL > default n Although note that "default n" is redundant. Cheers James > [...] > if MIPS_COMPACT_BRANCHES_OVERRIDE > choice > prompt "Compact branch policy" > default MIPS_COMPACT_BRANCHES_OPTIMAL > [...] > endif # MIPS_COMPACT_BRANCHES_OVERRIDE > > ? > > Maciej >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web