]> xenbits.xensource.com Git - qemu-upstream-4.2-testing.git/commit
xen-mapcache: pass the right size argument to test_bits
authorHanweidong <hanweidong@huawei.com>
Tue, 2 Apr 2013 13:22:41 +0000 (13:22 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 5 Apr 2013 15:32:46 +0000 (15:32 +0000)
commitbf8e2e756e3e98b8388068173e24d99d1e09d2dd
tree15f46351ffc991dc460af63919f94426e7e885ec
parent0718150131d1d68436ba92b209fa50430198e6f4
xen-mapcache: pass the right size argument to test_bits

Compute the correct size for test_bits().
qemu_get_ram_ptr() and qemu_safe_ram_ptr() will call xen_map_cache()
with size is 0 if the requested address is in the RAM.  Then
xen_map_cache() will pass the size 0 to test_bits() for checking if the
corresponding pfn was mapped in cache. But test_bits() will always
return 1 when size is 0 without any bit testing. Actually, for this
case, test_bits should check one bit. So this patch introduced a
__test_bit_size which is greater than 0 and a multiple of XC_PAGE_SIZE,
then test_bits can work correctly with __test_bit_size
>> XC_PAGE_SHIFT as its size.

upstream-commit-id: 044d4e1aae539bd4214175bd9591b3de7986cf18

Signed-off-by: Zhenguo Wang <wangzhenguo@huawei.com>
Signed-off-by: Weidong Han <hanweidong@huawei.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-mapcache.c