Skip to contentSkip to conversation

Introduce MMIO/PIO dispatch file descriptors (ioregionfd)

RFC Jörg Thalheim 1 participant 1 message Jul 14, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

The patches does not compile because vcpu->ioregion_ctx is missing a len field.

arch/x86/kvm/x86.c: In function ‘complete_ioregion_fast_pio’:
arch/x86/kvm/x86.c:9680:58: error: ‘struct <anonymous>’ has no member named ‘len’
9680 | memcpy(&val, vcpu->ioregion_ctx.val, vcpu->ioregion_ctx.len);
| ^

Gcc8 was also unhappy that the function would have no return values for cases.

---
 arch/x86/kvm/x86.c  | 1 +
 virt/kvm/ioregion.c | 1 +
 2 files changed, 2 insertions(+)
arch/x86/kvm/x86.c +1 -0
index 7dc1b80170f1..73205619cdd3 100644
@@ -9709,6 +9709,7 @@ static int complete_ioregion_io(struct kvm_vcpu *vcpu)
 		return complete_ioregion_mmio(vcpu);
 	if (vcpu->arch.pio.count)
 		return complete_ioregion_pio(vcpu);
+	return 0;
 }
 #endif /* CONFIG_KVM_IOREGION */
 
virt/kvm/ioregion.c +1 -0
index d53e3d1cd2ff..e0a52b2a56df 100644
@@ -311,6 +311,7 @@ get_ioregion_list(struct kvm *kvm, enum kvm_bus bus_idx)
 		return &kvm->ioregions_mmio;
 	if (bus_idx == KVM_PIO_BUS)
 		return &kvm->ioregions_pio;
+	return NULL;
 }
 
 /* check for not overlapping case and reverse */
Signature · 1 line
2.32.0