diff options
author | Julien Thierry <julien.thierry@arm.com> | 2019-03-07 08:36:03 +0000 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2019-04-26 14:55:19 +0100 |
commit | 026fb59cb4e96c9997ab26b64c1332363fd0ce97 (patch) | |
tree | ce75f558aedb1fc848e0d9e2fdfcaf403d8524d8 | |
parent | 90fa9c784d7a44713b1db00a27abd5efc88880fa (diff) | |
download | kvmtool-026fb59cb4e96c9997ab26b64c1332363fd0ce97.tar.gz |
brlock: Always pass argument to br_read_lock/unlock
The kvm argument is not passed to br_read_lock/unlock, this works for
the barrier implementation because the argument is not used. This ever
breaks if another lock implementation is used.
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | ioport.c | 4 | ||||
-rw-r--r-- | mmio.c | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -184,7 +184,7 @@ bool kvm__emulate_io(struct kvm_cpu *vcpu, u16 port, void *data, int direction, void *ptr = data; struct kvm *kvm = vcpu->kvm; - br_read_lock(); + br_read_lock(kvm); entry = ioport_search(&ioport_tree, port); if (!entry) goto out; @@ -201,7 +201,7 @@ bool kvm__emulate_io(struct kvm_cpu *vcpu, u16 port, void *data, int direction, } out: - br_read_unlock(); + br_read_unlock(kvm); if (ret) return true; @@ -124,7 +124,7 @@ bool kvm__emulate_mmio(struct kvm_cpu *vcpu, u64 phys_addr, u8 *data, u32 len, u { struct mmio_mapping *mmio; - br_read_lock(); + br_read_lock(vcpu->kvm); mmio = mmio_search(&mmio_tree, phys_addr, len); if (mmio) @@ -135,7 +135,7 @@ bool kvm__emulate_mmio(struct kvm_cpu *vcpu, u64 phys_addr, u8 *data, u32 len, u to_direction(is_write), (unsigned long long)phys_addr, len); } - br_read_unlock(); + br_read_unlock(vcpu->kvm); return true; } |