Skip to content

Commit 570ef30

Browse files
stsquadrth7680
authored andcommitted
tcg: update comments for save_iotlb_data in cputlb
I missed Emilio's review comments: Message-ID: <20200718205107.GA994221@sff> and the patch got merged. Correcting the comments now. Reviewed-by: Emilio G. Cota <[email protected]> Signed-off-by: Alex Bennée <[email protected]> Message-Id: <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent 7adfbea commit 570ef30

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

accel/tcg/cputlb.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,10 +1075,8 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
10751075

10761076
/*
10771077
* Save a potentially trashed IOTLB entry for later lookup by plugin.
1078-
*
1079-
* We also need to track the thread storage address because the RCU
1080-
* cleanup that runs when we leave the critical region (the current
1081-
* execution) is actually in a different thread.
1078+
* This is read by tlb_plugin_lookup if the iotlb entry doesn't match
1079+
* because of the side effect of io_writex changing memory layout.
10821080
*/
10831081
static void save_iotlb_data(CPUState *cs, hwaddr addr,
10841082
MemoryRegionSection *section, hwaddr mr_offset)
@@ -1408,8 +1406,9 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr,
14081406
* This almost never fails as the memory access being instrumented
14091407
* should have just filled the TLB. The one corner case is io_writex
14101408
* which can cause TLB flushes and potential resizing of the TLBs
1411-
* loosing the information we need. In those cases we need to recover
1412-
* data from a copy of the io_tlb entry.
1409+
* losing the information we need. In those cases we need to recover
1410+
* data from a copy of the iotlbentry. As long as this always occurs
1411+
* from the same thread (which a mem callback will be) this is safe.
14131412
*/
14141413

14151414
bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,

0 commit comments

Comments
 (0)