From: Rik van Riel <riel@surriel.com>
To: Juergen Gross <jgross@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org, x86@kernel.org,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
kernel-team@meta.com
Subject: [PATCH] x86,spinlock: make disabling virt_spin_lock_key contingent on CONFIG_PARAVIRT
Date: Mon, 15 Jul 2024 13:18:53 -0400 [thread overview]
Message-ID: <20240715131853.313c3bae@imladris.surriel.com> (raw)
The existence of virt_spin_lock_key is contingent only on CONFIG_PARAVIRT, not
on CONFIG_PARAVIRT_SPINLOCKS.
As a result, a kernel with CONFIG_PARAVIRT enabled, but CONFIG_PARAVIRT_SPINLOCKS
disabled will end up disabling queued spinlocks when running on bare metal.
Making the disabling of virt_spin_lock_key contingent on CONFIG_PARAVIRT, which
controls whether the key exists, results in queued spinlocks being enabled on
bare metal again.
Signed-off-by: Rik van Riel <riel@surriel.com>
Cc: stable@vger.kernel.org
Fixes: ce0a1b608bfc ("x86/paravirt: Silence unused native_pv_lock_init() function warning")
---
arch/x86/kernel/paravirt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 5358d43886ad..dd542a9c6667 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -55,7 +55,7 @@ DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
void __init native_pv_lock_init(void)
{
- if (IS_ENABLED(CONFIG_PARAVIRT_SPINLOCKS) &&
+ if (IS_ENABLED(CONFIG_PARAVIRT) &&
!boot_cpu_has(X86_FEATURE_HYPERVISOR))
static_branch_disable(&virt_spin_lock_key);
}
--
2.45.2
next reply other threads:[~2024-07-15 17:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-15 17:18 Rik van Riel [this message]
2024-07-16 9:41 ` Jürgen Groß
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=20240715131853.313c3bae@imladris.surriel.com \
--to=riel@surriel.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=jgross@suse.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®