* [PATCH] x86,spinlock: make disabling virt_spin_lock_key contingent on CONFIG_PARAVIRT
@ 2024-07-15 17:18 Rik van Riel
2024-07-16 9:41 ` Jürgen Groß
0 siblings, 1 reply; 2+ messages in thread
From: Rik van Riel @ 2024-07-15 17:18 UTC (permalink / raw)
To: Juergen Gross
Cc: Thomas Gleixner, Arnd Bergmann, linux-kernel, x86, Ingo Molnar,
Borislav Petkov, Dave Hansen, kernel-team
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86,spinlock: make disabling virt_spin_lock_key contingent on CONFIG_PARAVIRT
2024-07-15 17:18 [PATCH] x86,spinlock: make disabling virt_spin_lock_key contingent on CONFIG_PARAVIRT Rik van Riel
@ 2024-07-16 9:41 ` Jürgen Groß
0 siblings, 0 replies; 2+ messages in thread
From: Jürgen Groß @ 2024-07-16 9:41 UTC (permalink / raw)
To: Rik van Riel
Cc: Thomas Gleixner, Arnd Bergmann, linux-kernel, x86, Ingo Molnar,
Borislav Petkov, Dave Hansen, kernel-team
On 15.07.24 19:18, Rik van Riel wrote:
> 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")
Reviewed-by: Juergen Gross <jgross@suse.com>
Juergen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-16 9:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-15 17:18 [PATCH] x86,spinlock: make disabling virt_spin_lock_key contingent on CONFIG_PARAVIRT Rik van Riel
2024-07-16 9:41 ` Jürgen Groß
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®