From: Paolo Bonzini <pbonzini@redhat.com>
To: Matthew Rosato <mjrosato@linux.ibm.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
sheepdog@lists.wpkg.org, kvm@vger.kernel.org,
"David Hildenbrand" <david@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Yuval Shaia" <yuval.shaia.ml@gmail.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
"Alistair Francis" <Alistair.Francis@wdc.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Huacai Chen" <chenhc@lemote.com>, "Jiri Slaby" <jslaby@suse.cz>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Alberto Garcia" <berto@igalia.com>,
xen-devel@lists.xenproject.org,
"Yoshinori Sato" <ysato@users.sourceforge.jp>,
"Juan Quintela" <quintela@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Michael Roth" <mdroth@linux.vnet.ibm.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
"Aleksandar Markovic" <aleksandar.qemu.devel@gmail.com>,
"Anthony Perard" <anthony.perard@citrix.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Stefan Weil" <sw@weilnetz.de>, "Peter Lieven" <pl@kamp.de>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Paul Durrant" <paul@xen.org>,
qemu-s390x@nongnu.org, qemu-arm@nongnu.org,
"Liu Yuan" <namei.unix@gmail.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Sunil Muthuswamy" <sunilmut@microsoft.com>,
"John Snow" <jsnow@redhat.com>,
"Richard Henderson" <rth@twiddle.net>,
"Kevin Wolf" <kwolf@redhat.com>,
qemu-riscv@nongnu.org, qemu-block@nongnu.org,
"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
"Cornelia Huck" <cohuck@redhat.com>,
"Hailiang Zhang" <zhang.zhanghailiang@huawei.com>,
"Max Reitz" <mreitz@redhat.com>,
"Sagar Karandikar" <sagark@eecs.berkeley.edu>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Laurent Vivier" <laurent@vivier.eu>
Subject: Re: [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_
Date: Sat, 3 Oct 2020 10:48:08 +0200 [thread overview]
Message-ID: <45ba3626-0e06-96c7-5ed8-ea561ae20f15@redhat.com> (raw)
In-Reply-To: <4e65d6fa-0a7e-015b-eb6f-5dd1cc3ddd91@linux.ibm.com>
On 02/10/20 18:43, Matthew Rosato wrote:
>> diff --git
>> a/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h
>> b/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h
>> index acd4c8346d..7b4062a1a1 100644
>> ---
>> a/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h
>> +++
>> b/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h
>> @@ -68,7 +68,7 @@ static inline int pvrdma_idx_valid(uint32_t idx,
>> uint32_t max_elems)
>> static inline int32_t pvrdma_idx(int *var, uint32_t max_elems)
>> {
>> - const unsigned int idx = atomic_read(var);
>> + const unsigned int idx = qatomic_read(var);
>> if (pvrdma_idx_valid(idx, max_elems))
>> return idx & (max_elems - 1);
>> @@ -77,17 +77,17 @@ static inline int32_t pvrdma_idx(int *var,
>> uint32_t max_elems)
>> static inline void pvrdma_idx_ring_inc(int *var, uint32_t max_elems)
>> {
>> - uint32_t idx = atomic_read(var) + 1; /* Increment. */
>> + uint32_t idx = qatomic_read(var) + 1; /* Increment. */
>> idx &= (max_elems << 1) - 1; /* Modulo size, flip gen. */
>> - atomic_set(var, idx);
>> + qatomic_set(var, idx);
>> }
>> static inline int32_t pvrdma_idx_ring_has_space(const struct
>> pvrdma_ring *r,
>> uint32_t max_elems, uint32_t *out_tail)
>> {
>> - const uint32_t tail = atomic_read(&r->prod_tail);
>> - const uint32_t head = atomic_read(&r->cons_head);
>> + const uint32_t tail = qatomic_read(&r->prod_tail);
>> + const uint32_t head = qatomic_read(&r->cons_head);
>> if (pvrdma_idx_valid(tail, max_elems) &&
>> pvrdma_idx_valid(head, max_elems)) {
>> @@ -100,8 +100,8 @@ static inline int32_t
>> pvrdma_idx_ring_has_space(const struct pvrdma_ring *r,
>> static inline int32_t pvrdma_idx_ring_has_data(const struct
>> pvrdma_ring *r,
>> uint32_t max_elems, uint32_t *out_head)
>> {
>> - const uint32_t tail = atomic_read(&r->prod_tail);
>> - const uint32_t head = atomic_read(&r->cons_head);
>> + const uint32_t tail = qatomic_read(&r->prod_tail);
>> + const uint32_t head = qatomic_read(&r->cons_head);
>> if (pvrdma_idx_valid(tail, max_elems) &&
>> pvrdma_idx_valid(head, max_elems)) {
>
>
> It looks like the changes in this file are going to get reverted the
> next time someone does a linux header sync.
Source code should not be at all imported from Linux. The hacks that
accomodate pvrdma in update-linux-headers.sh (like s/atomic_t/u32/)
really have no place there; the files in
include/standard-headers/drivers/infiniband/hw/vmw_pvrdma should all be
moved in hw/.
Paolo
prev parent reply other threads:[~2020-10-03 8:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 10:56 [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_ Stefan Hajnoczi
2020-09-23 12:04 ` Paolo Bonzini
2020-09-23 12:43 ` Philippe Mathieu-Daudé
2020-09-23 13:31 ` no-reply
2020-09-23 15:13 ` Stefan Hajnoczi
2020-10-02 16:43 ` Matthew Rosato
2020-10-03 8:48 ` Paolo Bonzini [this message]
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=45ba3626-0e06-96c7-5ed8-ea561ae20f15@redhat.com \
--to=pbonzini@redhat.com \
--cc=Alistair.Francis@wdc.com \
--cc=aleksandar.qemu.devel@gmail.com \
--cc=aleksandar.rikalo@syrmia.com \
--cc=anthony.perard@citrix.com \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=berto@igalia.com \
--cc=borntraeger@de.ibm.com \
--cc=chenhc@lemote.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=fam@euphon.net \
--cc=jasowang@redhat.com \
--cc=jcmvbkbc@gmail.com \
--cc=jslaby@suse.cz \
--cc=jsnow@redhat.com \
--cc=kbastian@mail.uni-paderborn.de \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwolf@redhat.com \
--cc=laurent@vivier.eu \
--cc=marcandre.lureau@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=namei.unix@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pasic@linux.ibm.com \
--cc=paul@xen.org \
--cc=peter.maydell@linaro.org \
--cc=pl@kamp.de \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=quintela@redhat.com \
--cc=rth@twiddle.net \
--cc=sagark@eecs.berkeley.edu \
--cc=sheepdog@lists.wpkg.org \
--cc=sstabellini@kernel.org \
--cc=stefanha@redhat.com \
--cc=sunilmut@microsoft.com \
--cc=sw@weilnetz.de \
--cc=thuth@redhat.com \
--cc=xen-devel@lists.xenproject.org \
--cc=ysato@users.sourceforge.jp \
--cc=yuval.shaia.ml@gmail.com \
--cc=zhang.zhanghailiang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).