Skip to content

Commit e907fa1

Browse files
committed
KVM: s390: selftests: Add ucontrol gis routing test
JIRA: https://issues.redhat.com/browse/RHEL-113440 commit b1da33b Author: Christoph Schlameuss <schlameuss@linux.ibm.com> Date: Mon Dec 16 10:21:38 2024 +0100 KVM: s390: selftests: Add ucontrol gis routing test Add a selftests for the interrupt routing configuration when using ucontrol VMs. Calling the test may trigger a null pointer dereferences on kernels not containing the fixes in this patch series. Signed-off-by: Christoph Schlameuss <schlameuss@linux.ibm.com> Tested-by: Hariharan Mari <hari55@linux.ibm.com> Reviewed-by: Hariharan Mari <hari55@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20241216092140.329196-5-schlameuss@linux.ibm.com Message-ID: <20241216092140.329196-5-schlameuss@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
1 parent d9f9082 commit e907fa1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tools/testing/selftests/kvm/s390/ucontrol_test.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,4 +775,23 @@ TEST_F(uc_kvm, uc_flic_attrs)
775775
close(cd.fd);
776776
}
777777

778+
TEST_F(uc_kvm, uc_set_gsi_routing)
779+
{
780+
struct kvm_irq_routing *routing = kvm_gsi_routing_create();
781+
struct kvm_irq_routing_entry ue = {
782+
.type = KVM_IRQ_ROUTING_S390_ADAPTER,
783+
.gsi = 1,
784+
.u.adapter = (struct kvm_irq_routing_s390_adapter) {
785+
.ind_addr = 0,
786+
},
787+
};
788+
int rc;
789+
790+
routing->entries[0] = ue;
791+
routing->nr = 1;
792+
rc = ioctl(self->vm_fd, KVM_SET_GSI_ROUTING, routing);
793+
ASSERT_EQ(-1, rc) TH_LOG("err %s (%i)", strerror(errno), errno);
794+
ASSERT_EQ(EINVAL, errno) TH_LOG("err %s (%i)", strerror(errno), errno);
795+
}
796+
778797
TEST_HARNESS_MAIN

0 commit comments

Comments
 (0)