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 Drop Emacs local variables lists redundant with .dir-locals.el 2016-07-12 16:19:16 +02:00
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 cutils: Rewrite x86 buffer zero checking 2016-09-14 12:25:14 +02:00
compatfd.c
coroutine-gthread.c
coroutine-sigaltstack.c coroutine-sigaltstack: use helper for allocating stack memory 2016-09-29 14:13:39 +02:00
coroutine-ucontext.c coroutine-ucontext: use helper for allocating stack memory 2016-09-29 14:13:39 +02:00
coroutine-win32.c coroutine: add a macro for the coroutine stack size 2016-09-29 14:13:39 +02:00
crc32c.c
cutils.c cutils: Move buffer_is_zero and subroutines to a new file 2016-09-13 19:09:45 +02:00
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 util: Fix assertion in iov_copy() upon zero 'bytes' and non-zero 'offset' 2016-08-03 18:44:57 +02:00
log.c log: fix parsing of multiple trace:PATTERN log args 2016-09-14 22:52:44 +02:00
Makefile.objs aio: convert from RFifoLock to QemuRecMutex 2016-10-28 21:50:18 +08:00
memfd.c
mmap-alloc.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
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 osdep: Introduce qemu_dup 2016-07-13 13:26:02 +02:00
oslib-posix.c Fix FreeBSD (10.x) build after 7dc9ae43 2016-11-22 10:56:01 +00:00
oslib-win32.c util: Introduce qemu_get_pid_name 2016-10-04 10:00:27 +02:00
path.c
qdist.c qdist: return "(empty)" instead of NULL when printing an empty dist 2016-08-03 18:44:56 +02:00
qemu-config.c block: Add bdrv_runtime_opts to query-command-line-options 2016-10-07 13:34:07 +02:00
qemu-coroutine-io.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-coroutine-lock.c coroutine: Assert that no locks are held on termination 2016-09-05 19:06:48 +02:00
qemu-coroutine-sleep.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-coroutine.c coroutine: add qemu_coroutine_entered() function 2016-09-28 17:11:23 +01:00
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 qht: fix unlock-after-free segfault upon resizing 2016-10-06 18:04:13 +02:00
range.c range: Replace internal representation of Range 2016-07-04 16:49:33 +03:00
rcu.c rcu: simplify memory barriers 2016-10-24 11:30:56 +02:00
readline.c
throttle.c throttle: Don't allow burst limits to be lower than the normal limits 2016-08-05 09:59:06 +01:00
timed-average.c
trace-events trace: move util/qemu-coroutine*.c trace points into correct file 2016-09-28 19:17:54 +01:00
unicode.c
uri.c
uuid.c uuid: Tighten uuid parse 2016-09-23 11:42:52 +08:00