public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: "Maciej W. Rozycki" <macro@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>, <linux-mips@linux-mips.org>,
	"Ralf Baechle" <ralf@linux-mips.org>, <fengguang.wu@intel.com>,
	"stable # v4 . 4+" <stable@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] MIPS: Allow R6 compact branch policy to be left unspecified
Date: Fri, 22 Apr 2016 18:32:45 +0100	[thread overview]
Message-ID: <20160422173245.GC2467@jhogan-linux.le.imgtec.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1604221648580.21846@tp.orcam.me.uk>

[-- Attachment #1: Type: text/plain, Size: 1910 bytes --]

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
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-04-22 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22  8:43 [PATCH] MIPS: Allow R6 compact branch policy to be left unspecified Paul Burton
2016-04-22 15:56 ` Maciej W. Rozycki
2016-04-22 17:32   ` James Hogan [this message]
2016-05-11 12:05     ` Ralf Baechle
2016-05-11 13:22       ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160422173245.GC2467@jhogan-linux.le.imgtec.org \
    --to=james.hogan@imgtec.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@imgtec.com \
    --cc=paul.burton@imgtec.com \
    --cc=ralf@linux-mips.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox