exec: Add missing rcu_read_unlock

rcu_read_unlock was not called if the address_space_access_valid result is
negative.

This caused (at least) a problem when qemu on PPC/E500+TAP failed to terminate
properly and instead got stuck in a deadlock.

Backports commit 662a97d74f9b34cafe9aeb6d96620a97d768a1fa from qemu
This commit is contained in:
Roman Kapl 2018-03-01 09:12:20 -05:00 committed by Lioncash
parent 488b6cc82b
commit 337f57dd2c
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -2244,6 +2244,8 @@ bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_
if (!memory_access_is_direct(mr, is_write)) { if (!memory_access_is_direct(mr, is_write)) {
l = memory_access_size(mr, l, addr); l = memory_access_size(mr, l, addr);
if (!memory_region_access_valid(mr, xlat, l, is_write)) { if (!memory_region_access_valid(mr, xlat, l, is_write)) {
// Unicorn: commented out
//rcu_read_unlock();
return false; return false;
} }
} }