Re: [kvm-unit-tests PATCH v4 2/6] s390x: add function to set DAT mode for all interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Nico Boehr (2023-07-11 09:35:10)
[...]
> diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c
> index 3f993a363ae2..d97b5a3a7e97 100644
> --- a/lib/s390x/interrupt.c
> +++ b/lib/s390x/interrupt.c
[...]
> +void irq_set_dat_mode(bool dat, uint64_t as)
> +{
> +       struct psw* irq_psws[] = {
> +               OPAQUE_PTR(GEN_LC_EXT_NEW_PSW),
> +               OPAQUE_PTR(GEN_LC_SVC_NEW_PSW),
> +               OPAQUE_PTR(GEN_LC_PGM_NEW_PSW),
> +               OPAQUE_PTR(GEN_LC_MCCK_NEW_PSW),
> +               OPAQUE_PTR(GEN_LC_IO_NEW_PSW),
> +               NULL /* sentinel */
> +       };
> +
> +       assert(as == AS_PRIM || as == AS_ACCR || as == AS_SECN || as == AS_HOME);
> +
> +       for (struct psw *psw = irq_psws[0]; psw != NULL; psw++) {

This is obviously completely wrong and leads to a bunch of random memory in
lowcore being overwritten. For weird optimization reasons, this actually
terminates. I will sent a fixed version, where I simply don't do fancy pointer
stuff but just iterate over an array index...

Thanks Claudio.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux