On 30/06/2022 13.30, Nico Boehr wrote:
An invalid PSW causes a program interrupt. When an invalid PSW is introduced in the pgm_new_psw, an interrupt loop occurs as soon as a program interrupt is caused. QEMU should detect that and panick the guest, hence add a test for it. Signed-off-by: Nico Boehr <nrb@xxxxxxxxxxxxx> ---
....
+int main(void) +{ + report_prefix_push("pgmint-loop"); + + lowcore.pgm_new_psw.addr = (uint64_t) pgm_int_handler; + /* bit 12 set is invalid */ + lowcore.pgm_new_psw.mask = extract_psw_mask() | BIT(63 - 12);
Basically patch looks fine to me ... just an idea for an extension (but that could also be done later):
Looking at the is_valid_psw() function in the Linux kernel sources, there are a couple of additional condition that could cause a PGM interrupt loop ... you could maybe check them here, too, e.g. by adding a "extra_params = -append '...'" in the unittests.cfg file to select the indiviual tests via argv[] ?
Thomas