From: Peng Fan <peng.fan@oss.nxp.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: use assign_bit() where applicable
Date: Tue, 29 Sep 2026 09:12:26 +0800 [thread overview]
Message-ID: <arsQekT25sIRwjv+@shlinux89> (raw)
In-Reply-To: <arsNUfVv0NhKZ6zT@google.com>
Hi Sean,
On Mon, Sep 28, 2026 at 05:58:57PM -0700, Sean Christopherson wrote:
>On Sun, Sep 20, 2026, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> Convert open-coded if/else with set_bit/clear_bit and their
>> non-atomic __set_bit/__clear_bit variants to the assign_bit/__assign_bit
>> API.
>
>...
>
...
>>
>> - if (synic_has_vector_auto_eoi(synic, vector))
>> - __set_bit(vector, synic->auto_eoi_bitmap);
>> - else
>> - __clear_bit(vector, synic->auto_eoi_bitmap);
>> + __assign_bit(vector, synic->auto_eoi_bitmap,
>> + synic_has_vector_auto_eoi(synic, vector));
>
>Am I the only one that finds the assign_bit() code signficantly harder to follow?
No :) S390 maintainers also not like this.
>Maybe it's just that I haven't seen assign_bit() much, but I've come back to this
>patch several times, and I've had the same reaction every time. IMO, this is a
>solution looking for a problem.
>
It might be easy to read if the test condition is just a simple value, not
a function call.
Free to drop this patch.
Thanks
Peng
>
next prev parent reply other threads:[~2026-09-29 1:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 2:26 Peng Fan (OSS)
2026-09-29 0:58 ` Sean Christopherson
2026-09-29 1:12 ` Peng Fan [this message]
2026-09-29 8:15 ` David Laight
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=arsQekT25sIRwjv+@shlinux89 \
--to=peng.fan@oss.nxp.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peng.fan@nxp.com \
--cc=seanjc@google.com \
--cc=tglx@kernel.org \
--cc=vkuznets@redhat.com \
--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®