Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: TLBI RVALE1IS requires tlb-rmi with LLVM_IAS=1 #1106

Closed
nathanchance opened this issue Jul 24, 2020 · 33 comments
Closed

error: TLBI RVALE1IS requires tlb-rmi with LLVM_IAS=1 #1106

nathanchance opened this issue Jul 24, 2020 · 33 comments

Comments

@nathanchance
Copy link
Member

@nathanchance nathanchance commented Jul 24, 2020

arch/arm64/include/asm/tlbflush.h:346:5: error: TLBI RVALE1IS requires tlb-rmi
                                __tlbi(rvale1is, addr);
                                ^
arch/arm64/include/asm/tlbflush.h:47:26: note: expanded from macro '__tlbi'
#define __tlbi(op, ...)         __TLBI_N(op, ##__VA_ARGS__, 1, 0)
                                ^
arch/arm64/include/asm/tlbflush.h:45:35: note: expanded from macro '__TLBI_N'
#define __TLBI_N(op, arg, n, ...) __TLBI_##n(op, arg)
                                  ^
<scratch space>:21:1: note: expanded from here
__TLBI_1
^
arch/arm64/include/asm/tlbflush.h:38:32: note: expanded from macro '__TLBI_1'
#define __TLBI_1(op, arg) asm ("tlbi " #op ", %0\n"                            \
                               ^
<inline asm>:1:7: note: instantiated into assembly here
        tlbi rvale1is, x1
             ^

Introduced by https://git.kernel.org/arm64/c/d1d3aa98b1d4826a19adfefb69b96142a0cac633.

To reproduce:

$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/

$ cd linux-next

$ git revert --no-edit f7b93d42945cc71e1346dd5ae07c59061d56745e

$ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 LLVM_IAS=1 O=out/arm64 distclean defconfig mm/mprotect.o
@nickdesaulniers
Copy link
Member

@nickdesaulniers nickdesaulniers commented Jul 25, 2020

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).

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Jul 25, 2020

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,                   \
@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Jul 25, 2020

Actually, this should work due to https://git.kernel.org/arm64/c/7c78f67e9bd97478d56157c2ad53823668b5b822. However, I think there is something funky with -march= getting passed down to the assembler via the -Wa,-march= flag.

$ cat test.c
void foo(void) {
        asm("tlbi vmalle1os");
}

$ clang --target=aarch64-linux-gnu -march=armv8.4-a -c -o /dev/null test.c

$ clang --target=aarch64-linux-gnu -Wa,-march=armv8.4-a -c -o /dev/null test.c
<inline asm>:1:7: error: TLBI VMALLE1OS requires tlb-rmi
        tlbi vmalle1os
             ^
1 error generated.

$ clang --target=aarch64-linux-gnu -no-integrated-as --prefix=${CBL_BNTL}/aarch64-linux-gnu- -march=armv8.4-a -c -o /dev/null test.c

$ clang --target=aarch64-linux-gnu -no-integrated-as --prefix=${CBL_BNTL}/aarch64-linux-gnu- -Wa,-march=armv8.4-a -c -o /dev/null test.c

I feel like we have run into this before? I cannot remember or find it though.

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Jul 25, 2020

I think there is something funky with -march= getting passed down to the assembler via the -Wa,-march= flag.

-Wa is only passed to an external assembler, it's ignored with IAS, which uses the -march passed to clang instead. Otherwise, we could pass an appropriate -march to IAS and work around issue #1078 too...

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Jul 28, 2020

Is there any reason not to pass -march=armv8.4-a always or should it only be done when using the integrated assembler? If the later, do we want to add some new Kconfig symbol like AS_IS_LLVM or AS_IS_CLANG which could be true if LTO_CLANG is set or LLVM_IAS=1?

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Jul 28, 2020

Is there any reason not to pass -march=armv8.4-a always or should it only be done when using the integrated assembler?

If we pass -march=armv8.4-a to the compiler, it might generate instructions that are not supported on older hardware. Typically in inline assembly these are wrapped in alternative macros, where the instructions are patched in at runtime only if the hardware supports them. However, passing the -march to the assembler only is fine.

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Jul 29, 2020

Maybe we should add the .arch_extension if CONFIG_CC_IS_CLANG or is that too dirty/hacky?

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Jul 29, 2020

Does GNU assembler understand .arch_extension tlb-rmi? If it does, I think your earlier patch looked fine. Maybe we can even remove the unnecessary -Wa,-march=archv8.4-a at the same time?

@nickdesaulniers
Copy link
Member

@nickdesaulniers nickdesaulniers commented Jul 29, 2020

Maybe we should add the .arch_extension if CONFIG_CC_IS_CLANG or is that too dirty/hacky?

No. We've sent patches for this in the past that have added the assembler directive unconditionally. See also:

Does GNU assembler understand .arch_extension tlb-rmi?

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).

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Jul 29, 2020

My local copy of 2.34 doesn't seem to

OK, we need to work around this some other way in that case.

One option would be to autodetect whether .arch_extension tlb-rmi works in inline assembly (similarly to cc_has_k_constraint in arch/arm64/Makefile) and do something like this in the header:

#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.

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Jul 30, 2020

My local copy of 2.34 doesn't seem to

OK, we need to work around this some other way in that case.

One option would be to autodetect whether .arch_extension tlb-rmi works in inline assembly (similarly to cc_has_k_constraint in arch/arm64/Makefile) and do something like this in the header:

#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:

  1. -Wa,-march= does not work with the integrated assembler.

  2. -march= to $(CC) is invalid as it could break older CPUs.

  3. binutils does not appear to support .arch_extension tlb-rmi, which means that we can only use it conditionally.

Are there any other alternatives?

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Jul 30, 2020

For what it's worth, that patch sort of works. However, it falls apart when using LLVM_IAS=0 and LTO is disabled for a certain translation unit (or units), such as working around #1105.

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Jul 30, 2020

it falls apart when using LLVM_IAS=0 and LTO is disabled for a certain translation unit (or units)

Right. I suppose we could filter out -no-integrated-as from KBUILD_CFLAGS in this case (in addition to CC_FLAGS_LTO) to avoid using two different assemblers for inline assembly. I would rather not use IAS for stand-alone assembly with LTO by default to avoid making the build even more brittle than it is now.

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Jul 30, 2020

Are there any other alternatives?

Using .arch armv8.4-a instead of .arch_extension tlb-rmi might work for both GNU as and IAS. Since this overrides the -Wa,-march parameter, it might need to be updated later if the kernel decides to use even newer instructions, especially since with gcc this might apply to all inline assembly in the translation unit.

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Jul 31, 2020

.arch armv8.4-a does indeed work.

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Jul 31, 2020

.arch armv8.4-a does indeed work.

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?

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Jul 31, 2020

Sure, I will draft up a commit message and send it along.

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Aug 1, 2020

Unfortunately, .arch armv8.4-a does not work with older versions of binutils:

/tmp/ccDAfphj.s: Assembler messages:
/tmp/ccDAfphj.s:1801: Error: unknown architecture `armv8.4-a'

/tmp/ccDAfphj.s:2128: Error: unknown architecture `armv8.4-a'

/tmp/ccDAfphj.s:2262: Error: unknown architecture `armv8.4-a'

/tmp/ccDAfphj.s:2366: Error: unknown architecture `armv8.4-a'

I think the real solution here is to get .arch_extension tlb-rmi supported in binutils then use that when the assembler supports it, maybe falling back to .arch armv8.4-a if not to cover needing both GNU as and the integrated assembler within the same build.

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Aug 1, 2020

Which binutils version doesn't support the .arch? Does the -march parameter still work with it?

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Aug 1, 2020

According to the help text, anything earlier than 2.30 will not support it: https://git.kernel.org/arm64/c/7c78f67e9bd97478d56157c2ad53823668b5b822

No, -march= will not work but that prevent the option from even being selected.

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Aug 1, 2020

No, -march= will not work but that prevent the option from even being selected.

OK, so maybe we could also use the .arch directive only when the option is selected? That would fix the issue with old binutils, right?

In the long term, getting newer versions of binutils to support .arch_extension tlb-rmi would obviously be better, but we still have to support existing versions as well.

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Aug 3, 2020

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.

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Aug 3, 2020

Sure, no worries. We could possibly even change $(cc-option,-Wa$(comma)-march=armv8.4-a) to $(as-instr,.arch armv8.4-a), but I'm not sure if that's needed.

@nickdesaulniers
Copy link
Member

@nickdesaulniers nickdesaulniers commented Aug 3, 2020

Maybe a Kconfig as-instr check is more appropriate for detecting tooling support?

@samitolvanen
Copy link
Member

@samitolvanen samitolvanen commented Aug 4, 2020

This is now in Linus' tree. I worked around it for now with commit 4ea7d40. Thoughts?

Maybe a Kconfig as-instr check is more appropriate for detecting tooling support?

Looking at arch/arm64/Kconfig, they also use a -Wa,-march check for AS_HAS_PAC, so I decided to keep it unchanged for now.

@nathanchance
Copy link
Member Author

@nathanchance nathanchance commented Aug 5, 2020

That is probably worth sending just to see what upstream thinks.

samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 10, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 11, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 11, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 11, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 12, 2020
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>
nathanchance pushed a commit to nathanchance/WSL2-Linux-Kernel that referenced this issue Aug 14, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 14, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 15, 2020
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>
nathanchance pushed a commit to nathanchance/WSL2-Linux-Kernel that referenced this issue Aug 19, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 19, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 20, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 21, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 21, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 24, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 24, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 25, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 25, 2020
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>
nathanchance pushed a commit to nathanchance/WSL2-Linux-Kernel that referenced this issue Aug 26, 2020
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>
samitolvanen added a commit to samitolvanen/linux that referenced this issue Aug 26, 2020
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>
torvalds pushed a commit to torvalds/linux that referenced this issue Aug 28, 2020
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>
it-is-a-robot pushed a commit to openeuler-mirror/kernel that referenced this issue Oct 26, 2020
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>
it-is-a-robot pushed a commit to openeuler-mirror/kernel that referenced this issue Oct 26, 2020
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants