mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 05:05:36 +00:00
exec.c: Use atomic_rcu_read() to access dispatch in memory_region_section_get_iotlb()
When accessing the dispatch pointer in an AddressSpace within an RCU critical section we should always use atomic_rcu_read(). Fix an access within memory_region_section_get_iotlb() which was incorrectly doing a direct pointer access. Backports commit 0b8e2c1002afddc8ef3d52fa6fc29e4768429f98 from qemu
This commit is contained in:
parent
75701d03ee
commit
5192f806aa
|
@ -774,7 +774,11 @@ hwaddr memory_region_section_get_iotlb(CPUState *cpu,
|
||||||
iotlb |= PHYS_SECTION_ROM;
|
iotlb |= PHYS_SECTION_ROM;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
iotlb = section - section->address_space->dispatch->map.sections;
|
AddressSpaceDispatch *d;
|
||||||
|
|
||||||
|
// Unicorn: uses atomic_read instead of atomic_rcu_read
|
||||||
|
d = atomic_read(§ion->address_space->dispatch);
|
||||||
|
iotlb = section - d->map.sections;
|
||||||
iotlb += xlat;
|
iotlb += xlat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue