qemu-e2k/util
Max Reitz 6725f887ac hbitmap: Fix shifts of constants by granularity
An hbitmap's granularity may be anything from 0 to 63, so when shifting
constants by its value, they should not be plain ints.

Even having changed the types, hbitmap_serialization_granularity() still
tries to shift 64 to the right by the granularity. This operation is
undefined if the granularity is greater than 57. Adding an assertion is
fine for now, because serializing is done only in tests so far, but this
means that only bitmaps with a granularity below 58 can be serialized
and we should thus add a hbitmap_is_serializable() function later.

One of the two places touched in this patch uses
QEMU_ALIGN_UP(x, 1 << y). We can use ROUND_UP() there, since the second
parameter is obviously a power of two.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20161115224732.1334-1-mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
2016-11-29 17:46:36 +08:00
..
acl.c
base64.c
bitmap.c bitmap: refine and move BITMAP_{FIRST/LAST}_WORD_MASK 2016-10-08 11:25:29 +03:00
bitops.c
buffer.c
bufferiszero.c
compatfd.c
coroutine-gthread.c
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
crc32c.c
cutils.c
envlist.c
error.c
event_notifier-posix.c
event_notifier-win32.c
fifo8.c
getauxval.c
hbitmap.c hbitmap: Fix shifts of constants by granularity 2016-11-29 17:46:36 +08:00
hexdump.c
host-utils.c
id.c
iov.c
log.c
Makefile.objs aio: convert from RFifoLock to QemuRecMutex 2016-10-28 21:50:18 +08:00
memfd.c
mmap-alloc.c
module.c module: Don't load the same module if requested multiple times 2016-10-07 14:14:06 +02:00
notify.c
osdep.c
oslib-posix.c Fix FreeBSD (10.x) build after 7dc9ae43 2016-11-22 10:56:01 +00:00
oslib-win32.c
path.c
qdist.c
qemu-config.c
qemu-coroutine-io.c
qemu-coroutine-lock.c
qemu-coroutine-sleep.c
qemu-coroutine.c
qemu-error.c qemu-error: remove dependency of stubs on monitor 2016-11-01 16:06:57 +01:00
qemu-openpty.c
qemu-option.c
qemu-progress.c
qemu-sockets.c sockets: add AF_VSOCK support 2016-10-31 19:49:33 -05:00
qemu-thread-posix.c qemu-thread: introduce QemuRecMutex 2016-10-28 21:50:18 +08:00
qemu-thread-win32.c qemu-thread: introduce QemuRecMutex 2016-10-28 21:50:18 +08:00
qemu-timer-common.c
qht.c
range.c
rcu.c rcu: simplify memory barriers 2016-10-24 11:30:56 +02:00
readline.c
throttle.c
timed-average.c
trace-events
unicode.c
uri.c
uuid.c