From: victor.kamensky@linaro.org (Victor Kamensky)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: tlb: ASID macro should give 32bit result for BE correct operation
Date: Mon, 7 Oct 2013 08:48:23 -0700 [thread overview]
Message-ID: <1381160903-1248-2-git-send-email-victor.kamensky@linaro.org> (raw)
In-Reply-To: <1381160903-1248-1-git-send-email-victor.kamensky@linaro.org>
In order for ASID macro to be used as expression passed to
inline asm as 'r' operand it needs to give 32 bit unsigned result,
not unsigned 64bit expression.
Otherwise when 64bit ASID is passed to inline assembler statement
as 'r' operand (32bit) compiler behavior is not well specified.
For example when __flush_tlb_mm function compiled in big endian
case, and ASID is passed to tlb_op macro directly, 0 will be passed
as 'mcr 15, 0, r4, cr8, cr3, {2}' argument in r4, unless ASID
macro changed to produce 32 bit result.
Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
---
arch/arm/include/asm/mmu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index 6f18da0..64fd151 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -16,7 +16,7 @@ typedef struct {
#ifdef CONFIG_CPU_HAS_ASID
#define ASID_BITS 8
#define ASID_MASK ((~0ULL) << ASID_BITS)
-#define ASID(mm) ((mm)->context.id.counter & ~ASID_MASK)
+#define ASID(mm) ((unsigned int)((mm)->context.id.counter & ~ASID_MASK))
#else
#define ASID(mm) (0)
#endif
--
1.8.1.4
next prev parent reply other threads:[~2013-10-07 15:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 15:48 [PATCH v2] ARM: tlb: ASID macro should give 32bit result for BE correct operation Victor Kamensky
2013-10-07 15:48 ` Victor Kamensky [this message]
2013-10-07 15:50 ` Will Deacon
2013-10-07 15:52 ` Russell King - ARM Linux
2013-10-07 16:19 ` Victor Kamensky
2013-10-07 15:57 ` Ben Dooks
2013-10-07 16:37 ` Victor Kamensky
2013-10-07 17:24 ` Ben Dooks
2013-10-07 22:49 ` Santosh Shilimkar
2013-10-08 0:53 ` Victor Kamensky
2013-10-08 0:55 ` Kim Phillips
2013-10-08 7:09 ` Ben Dooks
2013-10-09 1:22 ` Kim Phillips
2013-10-09 20:42 ` Ben Dooks
2013-10-08 21:37 ` Ben Dooks
2013-10-08 6:59 ` Ben Dooks
2013-10-08 13:37 ` Santosh Shilimkar
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=1381160903-1248-2-git-send-email-victor.kamensky@linaro.org \
--to=victor.kamensky@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).