public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <jhogan@kernel.org>
To: Matt Redfearn <matt.redfearn@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	Philippe Ombredanne <pombredanne@nexb.com>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 1/6] MIPS: Move ehb() to barrier.h
Date: Thu, 17 May 2018 15:30:47 +0100	[thread overview]
Message-ID: <20180517143046.GA24704@jamesdev> (raw)
In-Reply-To: <1515148270-9391-2-git-send-email-matt.redfearn@mips.com>

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

On Fri, Jan 05, 2018 at 10:31:05AM +0000, Matt Redfearn wrote:
> The current location of ehb() in mipsmtregs.h does not make sense, since
> it is not strictly related to multi-threading, and may be used in code
> which does not include mipsmtregs.h

>  arch/mips/include/asm/barrier.h    | 13 +++++++++++++
>  arch/mips/include/asm/mipsmtregs.h |  8 --------

But ehb isn't really a memory barrier like the other barriers in
barrier.h, its an execution hazard barrier, as used when available by
the hazard macros in hazards.h, and in fact there is already an _ehb()
there.

I suspect the intention was that most MIPS arch code using ehb would do
so using the appropriate hazard abstractions, which would do the right
number of NOPs on hardware without the EHB instruction. Code that is
specific to certain arch revisions (like the MIPS MT code and MIPS KVM)
can get away with using _ehb/ehb, but should use the abstractions where
they exist to make intentions clear.

None of the specific hazards in hazards.h really match the case in patch
2, I suppose you could have a new sync_mfc0_hazard() macro, but its so
specific and EHB should be guaranteed to exist there, so perhaps _ehb()
should just be used instead of ehb() there? (with a comment to describe
what operations are being protected from what hazards).

Cheers
James

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2018-05-17 14:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05 10:31 [PATCH 0/6] irqchip/mips-gic: Enable & use VEIC mode if available Matt Redfearn
2018-01-05 10:31 ` [PATCH 1/6] MIPS: Move ehb() to barrier.h Matt Redfearn
2018-05-17 14:30   ` James Hogan [this message]
2018-01-05 10:31 ` [PATCH 2/6] MIPS: CPS: Introduce mips_gic_enable_eic Matt Redfearn
2018-01-05 10:31 ` [PATCH 3/6] MIPS: Generic: Support GIC in EIC mode Matt Redfearn
2018-02-05 14:11   ` James Hogan
2018-01-05 10:31 ` [PATCH 4/6] irqchip/mips-gic: Always attempt to enable " Matt Redfearn
2018-01-05 10:31 ` [PATCH 5/6] irqchip/mips-gic: Use separate vector for shared interrupts in " Matt Redfearn
2018-01-05 10:31 ` [PATCH 6/6] irqchip/mips-gic: Separate local interrupt handling Matt Redfearn
2018-03-14 11:15 ` [PATCH 0/6] irqchip/mips-gic: Enable & use VEIC mode if available Marc Zyngier
2018-03-14 15:46   ` James Hogan
2018-03-14 15:53     ` Marc Zyngier

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=20180517143046.GA24704@jamesdev \
    --to=jhogan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=matt.redfearn@mips.com \
    --cc=pombredanne@nexb.com \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox