All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: jiaqingtong97@163.com, tsbogend@alpha.franken.de,
	mark.tomlinson@alliedtelesis.co.nz, paulburton@kernel.org
Cc: linux-mips@vger.kernel.org
Subject: Re: [PATCH] MIPS: OCTEON: Add OCTEON II build and configuration option
Date: Sat, 19 Dec 2020 14:08:49 +0800	[thread overview]
Message-ID: <c749749f-0d9b-461d-0f9b-f8ac828a7681@flygoat.com> (raw)
In-Reply-To: <20201218162845.9317-1-jiaqingtong97@163.com>



在 2020/12/19 上午12:28, jiaqingtong97@163.com 写道:
> From: Jia Qingtong <jiaqingtong97@163.com>
>
> If building for OCTEON II only,we can select compiler options that
> give better code, but will not run on earlier chips.


I'd rather add a workaround Kconfig option and default y for it.
In case no other optimization can be enabled for OCTANE2, like

WORKAROUND_OCTANE_BARRIER

Thanks

- Jiaxun

>
> Signed-off-by: Jia Qingtong <jiaqingtong97@163.com>
> ---
>   arch/mips/cavium-octeon/Kconfig | 9 +++++++++
>   arch/mips/include/asm/sync.h    | 3 ++-
>   2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/cavium-octeon/Kconfig b/arch/mips/cavium-octeon/Kconfig
> index 4984e462be30..3e0759142656 100644
> --- a/arch/mips/cavium-octeon/Kconfig
> +++ b/arch/mips/cavium-octeon/Kconfig
> @@ -1,6 +1,15 @@
>   # SPDX-License-Identifier: GPL-2.0
>   if CPU_CAVIUM_OCTEON
>   
> +config CAVIUM_OCTEON2
> +	bool "Build the kernel to be used only OCTEON II processor cores"
> +	default "n"
> +	help
> +		This option enables the generation of Octeon2 specific
> +		instructions by the compiler, resulting in a kernel that is
> +		more efficient, but that will not run on Octeon and
> +		OcteonPlus processor cores.
> +
>   config CAVIUM_CN63XXP1
>   	bool "Enable CN63XXP1 errata workarounds"
>   	default "n"
> diff --git a/arch/mips/include/asm/sync.h b/arch/mips/include/asm/sync.h
> index aabd097933fe..fda181c16c5f 100644
> --- a/arch/mips/include/asm/sync.h
> +++ b/arch/mips/include/asm/sync.h
> @@ -155,10 +155,11 @@
>    * effective barrier as noted by commit 6b07d38aaa52 ("MIPS: Octeon: Use
>    * optimized memory barrier primitives."). Here we specify that the affected
>    * sync instructions should be emitted twice.
> + * Cavium OcteonII and later CPUs has fixed above bug.
>    * Note that this expression is evaluated by the assembler (not the compiler),
>    * and that the assembler evaluates '==' as 0 or -1, not 0 or 1.
>    */
> -#ifdef CONFIG_CPU_CAVIUM_OCTEON
> +#if defined CONFIG_CPU_CAVIUM_OCTEON && !defined CONFIG_CAVIUM_OCTEON2
>   # define __SYNC_rpt(type)	(1 - (type == __SYNC_wmb))
>   #else
>   # define __SYNC_rpt(type)	1

  reply	other threads:[~2020-12-19  6:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 16:28 [PATCH] MIPS: OCTEON: Add OCTEON II build and configuration option jiaqingtong97
2020-12-19  6:08 ` Jiaxun Yang [this message]
2020-12-19 15:39   ` Thomas Bogendoerfer
2020-12-27 14:56     ` [PATCH v2] MIPS: OCTEON: Add WAR_OCTEON_BARRIER workaround config jiaqingtong97

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=c749749f-0d9b-461d-0f9b-f8ac828a7681@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=jiaqingtong97@163.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=mark.tomlinson@alliedtelesis.co.nz \
    --cc=paulburton@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.