All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Nicolas Saenz Julienne <nsaenz@amazon.com>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org, nh-open-source@amazon.com
Subject: Re: [kvm-unit-tests PATCH] x86: Make set/clear_bit() atomic
Date: Fri, 14 Feb 2025 17:18:24 -0800	[thread overview]
Message-ID: <Z6_rYA-8SJm_aQlY@google.com> (raw)
In-Reply-To: <20250214173644.22895-1-nsaenz@amazon.com>

On Fri, Feb 14, 2025, Nicolas Saenz Julienne wrote:
> x86 is the only architecture that defines set/clear_bit() as non-atomic.
> This makes it incompatible with arch-agnostic code that might implicitly
> require atomicity. And it was observed to corrupt the 'online_cpus'
> bitmap, as non BSP CPUs perform RmWs on the bitmap concurrently during
> bring up. See:
> 
> ap_start64()
>   save_id()
>     set_bit(apic_id(), online_cpus)
> 
> Address this by making set/clear_bit() atomic.

OMG, this is arguaby worse than the per-CPU stack/data mess.  *sigh*

I'll grab this, I'm putting together a pull request for a few things.

  reply	other threads:[~2025-02-15  1:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 17:36 [kvm-unit-tests PATCH] x86: Make set/clear_bit() atomic Nicolas Saenz Julienne
2025-02-15  1:18 ` Sean Christopherson [this message]
2025-02-24 17:23 ` Sean Christopherson

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=Z6_rYA-8SJm_aQlY@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=nh-open-source@amazon.com \
    --cc=nsaenz@amazon.com \
    --cc=pbonzini@redhat.com \
    /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.