|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH v7 17/27] cputlb: atomically update tlb fields used by tlb_reset_dirty |
Date: | Mon, 23 Jan 2017 11:17:27 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
On 01/19/2017 09:04 AM, Alex Bennée wrote: > The main use case for tlb_reset_dirty is to set the TLB_NOTDIRTY flags > in TLB entries to force the slow-path on writes. This is used to mark > page ranges containing code which has been translated so it can be > invalidated if written to. To do this safely we need to ensure the TLB > entries in question for all vCPUs are updated before we attempt to run > the code otherwise a race could be introduced. > > To achieve this we atomically set the flag in tlb_reset_dirty_range and > take care when setting it when the TLB entry is filled. > > On 32 bit systems attempting to emulate 64 bit guests we don't even > bother as we might not have the atomic primitives available. MTTCG is > disabled in this case and can't be forced on. The copy_tlb_helper > function helps keep the atomic semantics in one place to avoid > confusion. > > The dirty helper function is made static as it isn't used outside of > cputlb. > > Signed-off-by: Alex Bennée <address@hidden> Reviewed-by: Richard Henderson <address@hidden> r~
[Prev in Thread] | Current Thread | [Next in Thread] |