]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commit
Fix map cache low/high/low bug
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 9 Sep 2008 13:02:03 +0000 (14:02 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 9 Sep 2008 13:02:54 +0000 (14:02 +0100)
commite09e851dd87d11fbd0777444cca068ae33073420
treebee9f859f5c309f1b38383732fbdae05e8849002
parent0dd77a196931380c2588f83ed662e8826cfde9b2
Fix map cache low/high/low bug

This small patch fixes an issue leading to a crash (segfault, although
with earlier changesets I was seeing sigbus - not sure what changed)
in qemu-dm when the following conditions occur:

1. A valid mapping for a bucket on a low address exists

2. Immediately after accessing memory mapped in this bucket, an access
occurs to a high (beyond assigned ram) address beyond the 1GB limit
for 32bit map cache wrapping around to the previous bucket's entry
number.

3. The next call to map cache again accesses the low address.

In this scenario, the guest mem for the low bucket has been unmapped
by the remap_bucket caused by 2., but because the valid_mapping
bit-test fails, map_cache returns before last_address_index has been
updated. The subsequent call to map_cache therefore never remaps the
low, valid bucket and instead returns a vaddr pointing to memory that
has failed to get mapped.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
(cherry picked from commit 77304a4b670e068e555385b7ed8a04ed0b8e9bac)
hw/xen_machine_fv.c