]> xenbits.xensource.com Git - xen.git/commit
tools: merge several bitop functions into xc_bitops.h
authorOlaf Hering <olaf@aepfle.de>
Fri, 10 Jun 2011 08:47:03 +0000 (10:47 +0200)
committerOlaf Hering <olaf@aepfle.de>
Fri, 10 Jun 2011 08:47:03 +0000 (10:47 +0200)
commitaa1355f971287932e2ba09dfb04a6122ecc3951f
treeb84ec9861d1b3409fed90ebaa7e6b8d857af4a3b
parent9c1ebbba309d04e15c8bc768843127c2c8b84c5f
tools: merge several bitop functions into xc_bitops.h

Bitmaps are used in save/restore, xenpaging and blktap2.  Merge the code into a
private xc_bitops.h file. All users are single threaded, so locking is not an
issue. The array of bits is handled as volatile because the x86 save/restore
code passes the bitmap to the hypervisor which in turn modifies the bitmap.

blktap2 uses a private bitmap. There was a possible overflow in the
bitmap_size() function, the remainder was not considered.

ia64 save/restore uses a bitmap to send the number of vcpus to the host.

x86 save/restore uses a bitmap to track dirty pages. This bitmap is shared with
the hypervisor. An unused function count_bits() was removed and a new
bitmap_size() function is now used.

xenpaging uses 3 private bitmaps to track the gfns which are in paged-out
state.  It had a copy of some Linux bitops.h, which is now obsolete. Also the
BITS_PER_LONG macro was hardcoded to 64 which made it impossible to run 32bit
tools on a 64bit host. Wether this works at all has to be tested, yet.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
12 files changed:
tools/blktap2/drivers/block-log.c
tools/libxc/ia64/xc_ia64_linux_restore.c
tools/libxc/ia64/xc_ia64_linux_save.c
tools/libxc/ia64/xc_ia64_save_restore.h
tools/libxc/xc_bitops.h [new file with mode: 0644]
tools/libxc/xc_domain_save.c
tools/xenpaging/bitops.h [deleted file]
tools/xenpaging/policy_default.c
tools/xenpaging/xc.c
tools/xenpaging/xc.h
tools/xenpaging/xenpaging.c
tools/xenpaging/xenpaging.h