aboutsummaryrefslogtreecommitdiff
path: root/cputlb.c
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2017-04-27 10:48:20 +0530
committerDavid Gibson <david@gibson.dropbear.id.au>2017-05-11 09:45:14 +1000
commit7f9af1abdcc69fd1d3d8d2be68464329600616d6 (patch)
tree48e6fecd3e7273ed6c361ce255b488624a266742 /cputlb.c
parent253ce7b2cfc0bccc3470335b0d7282457926087d (diff)
downloadqemu-7f9af1abdcc69fd1d3d8d2be68464329600616d6.zip
qemu-7f9af1abdcc69fd1d3d8d2be68464329600616d6.tar.gz
qemu-7f9af1abdcc69fd1d3d8d2be68464329600616d6.tar.bz2
cputlb: handle first atomic write to the page
In case where the conditional write is the first write to the page, TLB_NOTDIRTY will be set and stop_the_world is triggered. Handle this as a special case and set the dirty bit. After that fall through to the actual atomic instruction below. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'cputlb.c')
-rw-r--r--cputlb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cputlb.c b/cputlb.c
index f5d056c..743776a 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -930,7 +930,13 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr,
tlb_addr = tlbe->addr_write;
}
- /* Notice an IO access, or a notdirty page. */
+ /* Check notdirty */
+ if (unlikely(tlb_addr & TLB_NOTDIRTY)) {
+ tlb_set_dirty(ENV_GET_CPU(env), addr);
+ tlb_addr = tlb_addr & ~TLB_NOTDIRTY;
+ }
+
+ /* Notice an IO access */
if (unlikely(tlb_addr & ~TARGET_PAGE_MASK)) {
/* There's really nothing that can be done to
support this apart from stop-the-world. */