Skip to content

Commit cc81b6d

Browse files
Fuad TabbaMarc Zyngier
authored andcommitted
KVM: arm64: Change kvm_handle_mmio_return() return polarity
Most exit handlers return <= 0 to indicate that the host needs to handle the exit. Make kvm_handle_mmio_return() consistent with the exit handlers in handle_exit(). This makes the code easier to reason about, and makes it easier to add other handlers in future patches. No functional change intended. Signed-off-by: Fuad Tabba <tabba@google.com> Acked-by: Oliver Upton <oliver.upton@linux.dev> Link: https://lore.kernel.org/r/20240423150538.2103045-15-tabba@google.com Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 40458a6 commit cc81b6d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

arch/arm64/kvm/arm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
974974

975975
if (run->exit_reason == KVM_EXIT_MMIO) {
976976
ret = kvm_handle_mmio_return(vcpu);
977-
if (ret)
977+
if (ret <= 0)
978978
return ret;
979979
}
980980

arch/arm64/kvm/mmio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu)
8686

8787
/* Detect an already handled MMIO return */
8888
if (unlikely(!vcpu->mmio_needed))
89-
return 0;
89+
return 1;
9090

9191
vcpu->mmio_needed = 0;
9292

@@ -117,7 +117,7 @@ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu)
117117
*/
118118
kvm_incr_pc(vcpu);
119119

120-
return 0;
120+
return 1;
121121
}
122122

123123
int io_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa)

0 commit comments

Comments
 (0)