kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_
       [not found] <20200923105646.47864-1-stefanha@redhat.com>
@ 2020-09-23 12:43 ` Philippe Mathieu-Daudé
  2020-09-23 13:31 ` no-reply
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-23 12:43 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel
  Cc: Fam Zheng, Peter Maydell, sheepdog, Matthew Rosato, Paul Durrant,
	Jason Wang, David Hildenbrand, Yuval Shaia, Jiaxun Yang,
	Markus Armbruster, Max Filippov, Alistair Francis, Gerd Hoffmann,
	Huacai Chen, Eric Blake, Stefano Stabellini, Alberto Garcia, kvm,
	Yoshinori Sato, Juan Quintela, Jiri Slaby, Michael S. Tsirkin,
	Michael Roth, Halil Pasic, Christian Borntraeger,
	Aleksandar Markovic, Marcel Apfelbaum, Anthony Perard,
	Marc-André Lureau, Liu Yuan, Richard Henderson, Thomas Huth,
	Eduardo Habkost, Stefan Weil, Peter Lieven,
	Dr. David Alan Gilbert, qemu-s390x, qemu-arm, xen-devel,
	qemu-riscv, Sunil Muthuswamy, John Snow, Hailiang Zhang,
	Kevin Wolf, Daniel P. Berrangé,
	qemu-block, Bastian Koppelmann, Cornelia Huck, Laurent Vivier,
	Max Reitz, Sagar Karandikar, Palmer Dabbelt, Paolo Bonzini,
	Aleksandar Rikalo, Aurelien Jarno

On 9/23/20 12:56 PM, Stefan Hajnoczi wrote:
> clang's C11 atomic_fetch_*() functions only take a C11 atomic type
> pointer argument. QEMU uses direct types (int, etc) and this causes a
> compiler error when a QEMU code calls these functions in a source file
> that also included <stdatomic.h> via a system header file:
> 
>   $ CC=clang CXX=clang++ ./configure ... && make
>   ../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid)
> 
> Avoid using atomic_*() names in QEMU's atomic.h since that namespace is
> used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h
> and <stdatomic.h> can co-exist. I checked /usr/include on my machine and
> searched GitHub for existing "qatomic_" users but there seem to be none.
> 
> This patch was generated using:
> 
>   $ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \
>     sort -u >/tmp/changed_identifiers
>   $ for identifier in $(</tmp/changed_identifiers); do
>         sed -i "s%\<$identifier\>%q$identifier%g" \
>             $(git grep -I -l "\<$identifier\>")
>     done
> 
> I manually fixed line-wrap issues and misaligned rST tables.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Reviewed using 'git-diff --color-words'.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
> v3:
>  * Use qatomic_ instead of atomic_ [Paolo]
>  * The diff of my manual fixups is available here:
>    https://vmsplice.net/~stefan/atomic-namespace-pre-fixups-v3.diff
>    - Dropping #ifndef qatomic_fetch_add in atomic.h
>    - atomic_##X(haddr, val) glue macros not caught by grep
>    - Keep atomic_add-bench name
>    - C preprocessor backslash-newline ('\') column alignment
>    - Line wrapping
> v2:
>  * The diff of my manual fixups is available here:
>    https://vmsplice.net/~stefan/atomic-namespace-pre-fixups.diff
>    - Dropping #ifndef qemu_atomic_fetch_add in atomic.h
>    - atomic_##X(haddr, val) glue macros not caught by grep
>    - Keep atomic_add-bench name
>    - C preprocessor backslash-newline ('\') column alignment
>    - Line wrapping
>  * Use grep -I to avoid accidentally modifying binary files (RISC-V
>    OpenSBI ELFs) [Eric Blake]
>  * Tweak .gitorder to show atomic.h changes first [Eric Blake]
>  * Update grep commands in commit description so reviewers can reproduce
>    mechanical changes [Eric Blake]
> ---


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_
       [not found] <20200923105646.47864-1-stefanha@redhat.com>
  2020-09-23 12:43 ` [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_ Philippe Mathieu-Daudé
@ 2020-09-23 13:31 ` no-reply
  2020-09-23 15:13 ` Stefan Hajnoczi
  2020-10-02 16:43 ` Matthew Rosato
  3 siblings, 0 replies; 5+ messages in thread
From: no-reply @ 2020-09-23 13:31 UTC (permalink / raw)
  To: stefanha
  Cc: qemu-devel, mdroth, jsnow, Alistair.Francis, pasic, mjrosato,
	peter.maydell, eblake, armbru, kraxel, sheepdog, ysato, berrange,
	thuth, kvm, paul, qemu-s390x, mst, dgilbert, aurelien,
	aleksandar.qemu.devel, sw, qemu-riscv, qemu-block,
	zhang.zhanghailiang, jcmvbkbc, borntraeger, berto, kwolf, pl,
	pbonzini, marcandre.lureau, jiaxun.yang, laurent, anthony.perard,
	yuval.shaia.ml, xen-devel, chenhc, sunilmut, kbastian, quintela,
	cohuck, mreitz, rth, jslaby, marcel.apfelbaum, sagark,
	namei.unix, jasowang, palmer, aleksandar.rikalo, sstabellini,
	fam, david, ehabkost, stefanha, qemu-arm

Patchew URL: https://patchew.org/QEMU/20200923105646.47864-1-stefanha@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20200923105646.47864-1-stefanha@redhat.com
Subject: [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/20200922210101.4081073-1-jsnow@redhat.com -> patchew/20200922210101.4081073-1-jsnow@redhat.com
 * [new tag]         patchew/20200923113900.72718-1-david@redhat.com -> patchew/20200923113900.72718-1-david@redhat.com
 * [new tag]         patchew/20200923131829.3849-1-erich.mcmillan@hp.com -> patchew/20200923131829.3849-1-erich.mcmillan@hp.com
Switched to a new branch 'test'
07abb8e qemu/atomic.h: rename atomic_ to qatomic_

=== OUTPUT BEGIN ===
ERROR: Macros with multiple statements should be enclosed in a do - while loop
#2797: FILE: include/qemu/atomic.h:152:
+#define qatomic_rcu_read__nocheck(ptr, valptr)           \
+    __atomic_load(ptr, valptr, __ATOMIC_RELAXED);        \
     smp_read_barrier_depends();

ERROR: space required before that '*' (ctx:VxB)
#2942: FILE: include/qemu/atomic.h:333:
+#define qatomic_read__nocheck(p)   (*(__typeof__(*(p)) volatile*) (p))
                                                                ^

ERROR: Use of volatile is usually wrong, please add a comment
#2942: FILE: include/qemu/atomic.h:333:
+#define qatomic_read__nocheck(p)   (*(__typeof__(*(p)) volatile*) (p))

ERROR: space required before that '*' (ctx:VxB)
#2943: FILE: include/qemu/atomic.h:334:
+#define qatomic_set__nocheck(p, i) ((*(__typeof__(*(p)) volatile*) (p)) = (i))
                                                                 ^

ERROR: Use of volatile is usually wrong, please add a comment
#2943: FILE: include/qemu/atomic.h:334:
+#define qatomic_set__nocheck(p, i) ((*(__typeof__(*(p)) volatile*) (p)) = (i))

ERROR: space required after that ',' (ctx:VxV)
#2948: FILE: include/qemu/atomic.h:337:
+#define qatomic_set(ptr, i)     qatomic_set__nocheck(ptr,i)
                                                         ^

ERROR: memory barrier without comment
#3020: FILE: include/qemu/atomic.h:395:
+#define qatomic_xchg(ptr, i)    (smp_mb(), __sync_lock_test_and_set(ptr, i))

WARNING: Block comments use a leading /* on a separate line
#3094: FILE: include/qemu/atomic.h:447:
+/* qatomic_mb_read/set semantics map Java volatile variables. They are

WARNING: Block comments use a leading /* on a separate line
#6177: FILE: util/bitmap.c:214:
+        /* If we avoided the full barrier in qatomic_or(), issue a

WARNING: Block comments use a leading /* on a separate line
#7192: FILE: util/rcu.c:85:
+        /* Instead of using qatomic_mb_set for index->waiting, and

WARNING: Block comments use a leading /* on a separate line
#7218: FILE: util/rcu.c:154:
+        /* In either case, the qatomic_mb_set below blocks stores that free

total: 7 errors, 4 warnings, 6267 lines checked

Commit 07abb8e79dbe (qemu/atomic.h: rename atomic_ to qatomic_) has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200923105646.47864-1-stefanha@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_
       [not found] <20200923105646.47864-1-stefanha@redhat.com>
  2020-09-23 12:43 ` [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_ Philippe Mathieu-Daudé
  2020-09-23 13:31 ` no-reply
@ 2020-09-23 15:13 ` Stefan Hajnoczi
  2020-10-02 16:43 ` Matthew Rosato
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-09-23 15:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael Roth, John Snow, Alistair Francis, Halil Pasic,
	Matthew Rosato, Peter Maydell, Eric Blake, Markus Armbruster,
	Gerd Hoffmann, sheepdog, Yoshinori Sato, Daniel P. Berrangé,
	Thomas Huth, kvm, Paul Durrant, qemu-s390x, Michael S. Tsirkin,
	Dr. David Alan Gilbert, Aurelien Jarno, Aleksandar Markovic,
	Stefan Weil, qemu-riscv, qemu-block, Hailiang Zhang,
	Max Filippov, Christian Borntraeger, Alberto Garcia, Kevin Wolf,
	Peter Lieven, Paolo Bonzini, Marc-André Lureau, Jiaxun Yang,
	Laurent Vivier, Anthony Perard, Yuval Shaia, xen-devel,
	Huacai Chen, Sunil Muthuswamy, Bastian Koppelmann, Juan Quintela,
	Cornelia Huck, Max Reitz, Richard Henderson, Jiri Slaby,
	Marcel Apfelbaum, Sagar Karandikar, Liu Yuan, Jason Wang,
	Palmer Dabbelt, Aleksandar Rikalo, Stefano Stabellini, Fam Zheng,
	David Hildenbrand, Eduardo Habkost, qemu-arm

[-- Attachment #1: Type: text/plain, Size: 1842 bytes --]

On Wed, Sep 23, 2020 at 11:56:46AM +0100, Stefan Hajnoczi wrote:
> clang's C11 atomic_fetch_*() functions only take a C11 atomic type
> pointer argument. QEMU uses direct types (int, etc) and this causes a
> compiler error when a QEMU code calls these functions in a source file
> that also included <stdatomic.h> via a system header file:
> 
>   $ CC=clang CXX=clang++ ./configure ... && make
>   ../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid)
> 
> Avoid using atomic_*() names in QEMU's atomic.h since that namespace is
> used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h
> and <stdatomic.h> can co-exist. I checked /usr/include on my machine and
> searched GitHub for existing "qatomic_" users but there seem to be none.
> 
> This patch was generated using:
> 
>   $ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \
>     sort -u >/tmp/changed_identifiers
>   $ for identifier in $(</tmp/changed_identifiers); do
>         sed -i "s%\<$identifier\>%q$identifier%g" \
>             $(git grep -I -l "\<$identifier\>")
>     done
> 
> I manually fixed line-wrap issues and misaligned rST tables.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> v3:
>  * Use qatomic_ instead of atomic_ [Paolo]
>  * The diff of my manual fixups is available here:
>    https://vmsplice.net/~stefan/atomic-namespace-pre-fixups-v3.diff
>    - Dropping #ifndef qatomic_fetch_add in atomic.h
>    - atomic_##X(haddr, val) glue macros not caught by grep
>    - Keep atomic_add-bench name
>    - C preprocessor backslash-newline ('\') column alignment
>    - Line wrapping

Thanks, applied quickly due to high risk of conflicts:
https://github.com/stefanha/qemu/commits/block

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_
       [not found] <20200923105646.47864-1-stefanha@redhat.com>
                   ` (2 preceding siblings ...)
  2020-09-23 15:13 ` Stefan Hajnoczi
@ 2020-10-02 16:43 ` Matthew Rosato
  2020-10-03  8:48   ` Paolo Bonzini
  3 siblings, 1 reply; 5+ messages in thread
From: Matthew Rosato @ 2020-10-02 16:43 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel
  Cc: Fam Zheng, Peter Maydell, sheepdog, Paul Durrant, Jason Wang,
	David Hildenbrand, Yuval Shaia, Markus Armbruster, Max Filippov,
	Alistair Francis, Gerd Hoffmann, Huacai Chen, Stefano Stabellini,
	Alberto Garcia, kvm, Yoshinori Sato, Juan Quintela, Jiri Slaby,
	Michael S. Tsirkin, Michael Roth, Halil Pasic,
	Christian Borntraeger, Aleksandar Markovic, Anthony Perard,
	Marc-André Lureau, Liu Yuan, Richard Henderson, Thomas Huth,
	Eduardo Habkost, Stefan Weil, Peter Lieven,
	Dr. David Alan Gilbert, qemu-s390x, qemu-arm, xen-devel,
	qemu-riscv, Sunil Muthuswamy, John Snow, Hailiang Zhang,
	Kevin Wolf, Daniel P. Berrangé,
	qemu-block, Bastian Koppelmann, Cornelia Huck, Laurent Vivier,
	Max Reitz, Sagar Karandikar, Palmer Dabbelt, Paolo Bonzini,
	Aleksandar Rikalo, Aurelien Jarno

On 9/23/20 6:56 AM, Stefan Hajnoczi wrote:
> clang's C11 atomic_fetch_*() functions only take a C11 atomic type
> pointer argument. QEMU uses direct types (int, etc) and this causes a
> compiler error when a QEMU code calls these functions in a source file
> that also included <stdatomic.h> via a system header file:
> 
>    $ CC=clang CXX=clang++ ./configure ... && make
>    ../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid)
> 
> Avoid using atomic_*() names in QEMU's atomic.h since that namespace is
> used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h
> and <stdatomic.h> can co-exist. I checked /usr/include on my machine and
> searched GitHub for existing "qatomic_" users but there seem to be none.
> 
> This patch was generated using:
> 
>    $ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \
>      sort -u >/tmp/changed_identifiers
>    $ for identifier in $(</tmp/changed_identifiers); do
>          sed -i "s%\<$identifier\>%q$identifier%g" \
>              $(git grep -I -l "\<$identifier\>")
>      done
> 
> I manually fixed line-wrap issues and misaligned rST tables.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
..snip..
> 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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_
  2020-10-02 16:43 ` Matthew Rosato
@ 2020-10-03  8:48   ` Paolo Bonzini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2020-10-03  8:48 UTC (permalink / raw)
  To: Matthew Rosato, Stefan Hajnoczi, qemu-devel
  Cc: Fam Zheng, Peter Maydell, sheepdog, Paul Durrant, Jason Wang,
	David Hildenbrand, Yuval Shaia, Markus Armbruster, Max Filippov,
	Alistair Francis, Gerd Hoffmann, Huacai Chen, Stefano Stabellini,
	Alberto Garcia, kvm, Yoshinori Sato, Juan Quintela, Jiri Slaby,
	Michael S. Tsirkin, Michael Roth, Halil Pasic,
	Christian Borntraeger, Aleksandar Markovic, Anthony Perard,
	Marc-André Lureau, Liu Yuan, Richard Henderson, Thomas Huth,
	Eduardo Habkost, Stefan Weil, Peter Lieven,
	Dr. David Alan Gilbert, qemu-s390x, qemu-arm, xen-devel,
	qemu-riscv, Sunil Muthuswamy, John Snow, Hailiang Zhang,
	Kevin Wolf, Daniel P. Berrangé,
	qemu-block, Bastian Koppelmann, Cornelia Huck, Laurent Vivier,
	Max Reitz, Sagar Karandikar, Palmer Dabbelt, Aleksandar Rikalo,
	Aurelien Jarno

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-03  8:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200923105646.47864-1-stefanha@redhat.com>
2020-09-23 12:43 ` [PATCH v3] qemu/atomic.h: rename atomic_ to qatomic_ 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 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).