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

CONFIG-MATOM=y (arch/x86/crypto/curve25519-x86_64.c: error: inline assembly requires more registers than available ) #2046

Open
alavalas1 opened this issue Jul 30, 2024 · 0 comments

Comments

@alavalas1
Copy link

Hi All ,

During Enable config MATOM kernel_v6.6 compilation with matom config ( config_matom=y)-error was encountered : inline assembly requires more registers than available**

As we observed below issue is running long back, as anyone is plan to upstream proposal for this issue?
if any other similar patches are upstream and issue resolved ?

Please help to let me know the any other information regards same issue, how to overcome.

https://lore.kernel.org/all/[email protected]/T/#u

The clang optimization for atom results in a large number of objtool
warnings like

drivers/video/hdmi.o: warning: objtool: hdmi_infoframe_check()+0x74: unreachable instruction
lib/crypto/curve25519.o: warning: objtool: init_module()+0x12: unreachable instruction
drivers/clk/bcm/clk-iproc-armpll.o: warning: objtool: iproc_armpll_setup()+0x10c: unreachable instruction
drivers/video/fbdev/core/cfbfillrect.o: warning: objtool: cfb_fillrect()+0xa2: unreachable instruction
drivers/clk/bcm/clk-iproc-pll.o: warning: objtool: iproc_pll_clk_setup()+0x36d: unreachable instruction
drivers/clk/bcm/clk-iproc-asiu.o: warning: objtool: iproc_asiu_setup()+0x2cf: unreachable instruction

and in rare cases problems with the register allocator:

arch/x86/crypto/curve25519-x86_64.c:610:3: error: inline assembly requires more registers than available

error: ran out of registers during register allocation

All of those can be avoided by changing the -mtune= option for
clang, leaving the -march= option unchanged. It's really a bug
that should be fxied in llvm, but it's fairly clear that the
atom optimizations are not well exercised in llvm, so not
using them is probably the safe choice regardless.

Link: #1483
Signed-off-by: Arnd Bergmann [email protected]

arch/x86/Makefile | 4 ++++
arch/x86/Makefile_32.cpu | 4 ++++
2 files changed, 8 insertions(+)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 7488cfbbd2f6..4c6f92b32385 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -120,7 +120,11 @@ else
cflags-$(CONFIG_MK8) += -march=k8
cflags-$(CONFIG_MPSC) += -march=nocona
cflags-$(CONFIG_MCORE2) += -march=core2
+ifdef CONFIG_CC_IS_CLANG

  •    cflags-$(CONFIG_MATOM)		+= -march=atom -mtune=generic
    

+else
cflags-$(CONFIG_MATOM) += -march=atom
+endif
cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic
KBUILD_CFLAGS += $(cflags-y)

diff --git a/arch/x86/Makefile_32.cpu b/arch/x86/Makefile_32.cpu
index 94834c4b5e5e..a17b089f367c 100644
--- a/arch/x86/Makefile_32.cpu
+++ b/arch/x86/Makefile_32.cpu
@@ -33,8 +33,12 @@ cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)
cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
cflags-$(CONFIG_MVIAC7) += -march=i686
cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)
+ifdef CONFIG_CC_IS_CLANG
+cflags-$(CONFIG_MATOM) += -march=atom -mtune=generic
+else
cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom,$(call cc-option,-march=core2,-march=i686))
$(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
+endif

AMD Elan support

cflags-$(CONFIG_MELAN) += -march=i486

2.29.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant