All of lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: tlb: __flush_tlb_mm need to use int asid var for BE correct operation
Date: Mon, 7 Oct 2013 11:49:36 +0100	[thread overview]
Message-ID: <20131007104936.GG465@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20131007104524.GK12758@n2100.arm.linux.org.uk>

On Mon, Oct 07, 2013 at 11:45:24AM +0100, Russell King - ARM Linux wrote:
> On Sun, Oct 06, 2013 at 11:47:38PM -0700, Victor Kamensky wrote:
> > __flush_tlb_mm function need to use intermediate 'int' type 'asid'
> > variable int tlb_op macro call. Direct use of ASID macro produces
> > 64 bit unsigned long long type passed to inline assembler statement
> > as 'r' operand (32bit), and resulting behavior is not well specified.
> > It works in little endian case, but is broken in big endian case. In
> > big endian case gcc generate such code that 0 is passed to
> > 'mcr	15, 0, r4, cr8, cr3, {2}' operation.
> > 
> > Note other functions like __local_flush_tlb_mm, and local_flush_tlb_mm
> > already use intermediate 'asid' variable in similar code.
> 
> A much better solution would be to ensure that ASID() only returns
> the 'unsigned' type, not a long long type.
> 
> #define ASID(mm)        ((unsigned)(mm)->context.id.counter & ~ASID_MASK)

Yup, that looks good to me. This is similar to the problem Ben already fixed
in the mmid macro, so I think this should be included as part of his BE
series.

Speaking of which -- it's probably a good time to refresh and repost that if
we're aiming for 3.13...

Will

  reply	other threads:[~2013-10-07 10:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07  6:47 [PATCH] ARM: tlb: __flush_tlb_mm need to use int asid var for BE correct operation Victor Kamensky
2013-10-07  6:47 ` Victor Kamensky
2013-10-07 10:32   ` Ben Dooks
2013-10-07 10:33   ` Ben Dooks
2013-10-07 10:45   ` Russell King - ARM Linux
2013-10-07 10:49     ` Will Deacon [this message]
2013-10-07 10:55       ` Ben Dooks
2013-10-07 13:15         ` Thomas Petazzoni

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=20131007104936.GG465@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 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.