error: TLBI RVALE1IS requires tlb-rmi with LLVM_IAS=1 #1106
Comments
|
It looks like this is an ARMv8.4-A extension and requires |
|
The inline asm likely needs the directive (rather than a global asm statement which wont get merged or none at all and no command line flag to set the target arch). |
|
This works, would it be acceptable? diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h
index d493174415db..fbdbe24af4cb 100644
--- a/arch/arm64/include/asm/tlbflush.h
+++ b/arch/arm64/include/asm/tlbflush.h
@@ -28,14 +28,16 @@
* not. The macros handles invoking the asm with or without the
* register argument as appropriate.
*/
-#define __TLBI_0(op, arg) asm ("tlbi " #op "\n" \
+#define __TLBI_0(op, arg) asm (".arch_extension tlb-rmi\n" \
+ "tlbi " #op "\n" \
ALTERNATIVE("nop\n nop", \
"dsb ish\n tlbi " #op, \
ARM64_WORKAROUND_REPEAT_TLBI, \
CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
: : )
-#define __TLBI_1(op, arg) asm ("tlbi " #op ", %0\n" \
+#define __TLBI_1(op, arg) asm (".arch_extension tlb-rmi\n" \
+ "tlbi " #op ", %0\n" \
ALTERNATIVE("nop\n nop", \
"dsb ish\n tlbi " #op ", %0", \
ARM64_WORKAROUND_REPEAT_TLBI, \ |
|
Actually, this should work due to https://git.kernel.org/arm64/c/7c78f67e9bd97478d56157c2ad53823668b5b822. However, I think there is something funky with
I feel like we have run into this before? I cannot remember or find it though. |
|
|
Is there any reason not to pass |
If we pass |
|
Maybe we should add the |
|
Does GNU assembler understand |
No. We've sent patches for this in the past that have added the assembler directive unconditionally. See also:
My local copy of 2.34 doesn't seem to: .arch armv8.4-a+crc
.text
.globl foo
foo:
.arch_extension tlb-rmi
tlbi vmalle1os$ aarch64-linux-gnu-as x.s
x.s: Assembler messages:
x.s:5: Error: unknown architectural extension `tlb-rmi'Probably need to file a bug there. (cc @kbeyls as a heads up for ARMs GNU binutils folks). |
OK, we need to work around this some other way in that case. One option would be to autodetect whether #ifdef CONFIG_CC_AS_HAS_TLBRMI
#define __TLBRMI_PREAMBLE ".arch_extension tlb-rmi"
#else
#define __TLBRMI_PREAMBLE
#endif
...
define __TLBI_0(op, arg) asm (__TLBRMI_PREAMBLE "\n"
...Not exactly ideal, but it should work with GNU as and IAS. |
Yes, this was what I had in mind. I will try to test it tonight. I am not sure that we really have any other option with the current code:
Are there any other alternatives? |
|
For what it's worth, that patch sort of works. However, it falls apart when using |
Right. I suppose we could filter out |
Using |
|
|
Great, thank you for testing! Do you want to send a patch upstream, so we can see if the maintainers are fine with this approach? |
|
Sure, I will draft up a commit message and send it along. |
|
Unfortunately,
I think the real solution here is to get |
|
Which binutils version doesn't support the |
|
According to the help text, anything earlier than 2.30 will not support it: https://git.kernel.org/arm64/c/7c78f67e9bd97478d56157c2ad53823668b5b822 No, |
OK, so maybe we could also use the In the long term, getting newer versions of binutils to support |
|
I will see if I can test that within the new few days. Sorry, drowning a bit with school and work sapping the energy out of me. |
|
Sure, no worries. We could possibly even change |
|
Maybe a Kconfig |
|
This is now in Linus' tree. I worked around it for now with commit 4ea7d40. Thoughts?
Looking at |
|
That is probably worth sending just to see what upstream thinks. |
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. As binutils doesn't support .arch_extension tlb-rmi, this change adds .arch armv8.4-a to __TLBI_0 and __TLBI_1 to fix the issue with both LLVM IAS and binutils. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. As binutils doesn't support .arch_extension tlb-rmi, this change adds .arch armv8.4-a to __TLBI_0 and __TLBI_1 to fix the issue with both LLVM IAS and binutils. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux/linux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux/linux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux/linux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Link: ClangBuiltLinux#1106 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Tested-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Link: ClangBuiltLinux#1106 Link: https://lore.kernel.org/r/20200827203608.1225689-1-samitolvanen@google.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
|
Merged into mainline: https://git.kernel.org/linus/1764c3edc66880778604f5053fe2dda7b3ddd2c1 |
mainline inclusion from mainline-v5.8 commit 1764c3e category: bugfix CVE: NA ----------------------- Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Tested-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Link: ClangBuiltLinux/linux#1106 Link: https://lore.kernel.org/r/20200827203608.1225689-1-samitolvanen@google.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Yuan Can <yuancan@huawei.com> Reviewed-by: Xie XiuQi <xiexiuqi@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
mainline inclusion from mainline-v5.8 commit 1764c3e category: bugfix CVE: NA ----------------------- Commit 7c78f67 ("arm64: enable tlbi range instructions") breaks LLVM's integrated assembler, because -Wa,-march is only passed to external assemblers and therefore, the new instructions are not enabled when IAS is used. This change adds a common architecture version preamble, which can be used in inline assembly blocks that contain instructions that require a newer architecture version, and uses it to fix __TLBI_0 and __TLBI_1 with ARM64_TLB_RANGE. Fixes: 7c78f67 ("arm64: enable tlbi range instructions") Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Tested-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Link: ClangBuiltLinux/linux#1106 Link: https://lore.kernel.org/r/20200827203608.1225689-1-samitolvanen@google.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Yuan Can <yuancan@huawei.com> Reviewed-by: Xie XiuQi <xiexiuqi@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Introduced by https://git.kernel.org/arm64/c/d1d3aa98b1d4826a19adfefb69b96142a0cac633.
To reproduce:
The text was updated successfully, but these errors were encountered: