All of lore.kernel.org
 help / color / mirror / Atom feed
From: guoj17@chinatelecom.cn
To: peterz@infradead.org, mingo@redhat.com, will@kernel.org,
	tglx@linutronix.de, bp@alien8.de, dave.hansen@linux.intel.com,
	x86@kernel.org
Cc: longman@redhat.com, boqun.feng@gmail.com,
	linux-kernel@vger.kernel.org, hpa@zytor.com, nathan@kernel.org,
	ndesaulniers@google.com, trix@redhat.com, llvm@lists.linux.dev,
	huyd12@chinatelecom.cn, Guo Jin <guoj17@chinatelecom.cn>
Subject: [PATCH] locking: fix kernel/locking/ inline asm error
Date: Tue,  8 Nov 2022 14:01:26 +0800	[thread overview]
Message-ID: <20221108060126.2505-1-guoj17@chinatelecom.cn> (raw)

From: Guo Jin <guoj17@chinatelecom.cn>

When compiling linux 6.1.0-rc3 configured with CONFIG_64BIT=y
and CONFIG_PARAVIRT_SPINLOCKS=y on x86_64 using LLVM 11.0,
an error: "<inline asm> error: changed section flags for
.spinlock.text, expected:: 0x6" occurred.

The reason is the .spinlock.text in kernel/locking/qspinlock.o
is used many times, but its flags are omitted in subsequent use.

LLVM 11.0 assembler didn't permit to
leave out flags in subsequent uses of the same sections.

So this patch adds the corresponding flags to avoid above error.

Signed-off-by: Guo Jin <guoj17@chinatelecom.cn>
---
 arch/x86/include/asm/qspinlock_paravirt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/qspinlock_paravirt.h b/arch/x86/include/asm/qspinlock_paravirt.h
index 60ece592b220..dbb38a6b4dfb 100644
--- a/arch/x86/include/asm/qspinlock_paravirt.h
+++ b/arch/x86/include/asm/qspinlock_paravirt.h
@@ -37,7 +37,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");
  *   rsi = lockval           (second argument)
  *   rdx = internal variable (set to 0)
  */
-asm    (".pushsection .spinlock.text;"
+asm    (".pushsection .spinlock.text, \"ax\";"
 	".globl " PV_UNLOCK ";"
 	".type " PV_UNLOCK ", @function;"
 	".align 4,0x90;"
-- 
2.25.1


             reply	other threads:[~2022-11-08  6:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08  6:01 guoj17 [this message]
2022-11-08 22:40 ` [PATCH] locking: fix kernel/locking/ inline asm error Nathan Chancellor
2022-11-10 10:05   ` 回复: " huyd12
2022-11-10 20:50     ` Nathan Chancellor
2022-11-16  9:21 ` [tip: locking/urgent] locking: Fix qspinlock/x86 " tip-bot2 for Guo Jin
2022-11-16  9:40   ` Juergen Gross
2022-11-16 10:39     ` Peter Zijlstra

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=20221108060126.2505-1-guoj17@chinatelecom.cn \
    --to=guoj17@chinatelecom.cn \
    --cc=boqun.feng@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=huyd12@chinatelecom.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=trix@redhat.com \
    --cc=will@kernel.org \
    --cc=x86@kernel.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.