qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 2/2] migration: Make dirty_bytes_last_sync atomic


From: Paolo Bonzini
Subject: Re: [PATCH v5 2/2] migration: Make dirty_bytes_last_sync atomic
Date: Thu, 27 Apr 2023 10:19:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1

On 4/26/23 22:10, Juan Quintela wrote:
Don't use __nocheck() functions.

Doesn't this break on 32-bit platforms?

#if defined(__x86_64__) || defined(__sparc__) || defined(__mips64)
# define ATOMIC_REG_SIZE  8
#else
# define ATOMIC_REG_SIZE  sizeof(void *)
#endif

#define qatomic_set(ptr, i)  do {                      \
    qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \
    qatomic_set__nocheck(ptr, i);                      \
} while(0)

So if sizeof(void*) == 4 it would trigger a compile-time assertion.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]