mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 12:09:58 +00:00
Xen, mapcache: Fix the compute of the size of bucket.
Because the size of a mapping is wrong when there is an offset and a size >= bucket_size. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
parent
77ba8fef89
commit
09ab48ee6c
@ -216,12 +216,14 @@ tryagain:
|
||||
}
|
||||
|
||||
/* size is always a multiple of MCACHE_BUCKET_SIZE */
|
||||
if ((address_offset + (__size % MCACHE_BUCKET_SIZE)) > MCACHE_BUCKET_SIZE)
|
||||
__size += MCACHE_BUCKET_SIZE;
|
||||
if (__size % MCACHE_BUCKET_SIZE)
|
||||
__size += MCACHE_BUCKET_SIZE - (__size % MCACHE_BUCKET_SIZE);
|
||||
if (!__size)
|
||||
if (size) {
|
||||
__size = size + address_offset;
|
||||
if (__size % MCACHE_BUCKET_SIZE) {
|
||||
__size += MCACHE_BUCKET_SIZE - (__size % MCACHE_BUCKET_SIZE);
|
||||
}
|
||||
} else {
|
||||
__size = MCACHE_BUCKET_SIZE;
|
||||
}
|
||||
|
||||
entry = &mapcache->entry[address_index % mapcache->nr_buckets];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user