···2901290129022902struct kvm_s390_irq_state {29032903 __u64 buf;29042904- __u32 flags;29042904+ __u32 flags; /* will stay unused for compatibility reasons */29052905 __u32 len;29062906- __u32 reserved[4];29062906+ __u32 reserved[4]; /* will stay unused for compatibility reasons */29072907};2908290829092909Userspace passes in the above struct and for each pending interrupt a29102910struct kvm_s390_irq is copied to the provided buffer.29112911+29122912+The structure contains a flags and a reserved field for future extensions. As29132913+the kernel never checked for flags == 0 and QEMU never pre-zeroed flags and29142914+reserved, these fields can not be used in the future without breaking29152915+compatibility.2911291629122917If -ENOBUFS is returned the buffer provided was too small and userspace29132918may retry with a bigger buffer.···2937293229382933struct kvm_s390_irq_state {29392934 __u64 buf;29352935+ __u32 flags; /* will stay unused for compatibility reasons */29402936 __u32 len;29412941- __u32 pad;29372937+ __u32 reserved[4]; /* will stay unused for compatibility reasons */29422938};29392939+29402940+The restrictions for flags and reserved apply as well.29412941+(see KVM_S390_GET_IRQ_STATE)2943294229442943The userspace memory referenced by buf contains a struct kvm_s390_irq29452944for each interrupt to be injected into the guest.
+1-4
arch/s390/kvm/Makefile
···11+# SPDX-License-Identifier: GPL-2.012# Makefile for kernel virtual machines on s39023#34# Copyright IBM Corp. 200844-#55-# This program is free software; you can redistribute it and/or modify66-# it under the terms of the GNU General Public License (version 2 only)77-# as published by the Free Software Foundation.8596KVM := ../../../virt/kvm107common-objs = $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/async_pf.o $(KVM)/irqchip.o $(KVM)/vfio.o
+1-4
arch/s390/kvm/diag.c
···11+// SPDX-License-Identifier: GPL-2.012/*23 * handling diagnose instructions34 *45 * Copyright IBM Corp. 2008, 201155- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): Carsten Otte <cotte@de.ibm.com>118 * Christian Borntraeger <borntraeger@de.ibm.com>
+1-4
arch/s390/kvm/gaccess.h
···11+/* SPDX-License-Identifier: GPL-2.0 */12/*23 * access guest memory34 *45 * Copyright IBM Corp. 2008, 201455- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): Carsten Otte <cotte@de.ibm.com>118 */
+1-4
arch/s390/kvm/guestdbg.c
···11+// SPDX-License-Identifier: GPL-2.012/*23 * kvm guest debug support34 *45 * Copyright IBM Corp. 201455- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): David Hildenbrand <dahi@linux.vnet.ibm.com>118 */
+1-4
arch/s390/kvm/intercept.c
···11+// SPDX-License-Identifier: GPL-2.012/*23 * in-kernel handling for sie intercepts34 *45 * Copyright IBM Corp. 2008, 201455- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): Carsten Otte <cotte@de.ibm.com>118 * Christian Borntraeger <borntraeger@de.ibm.com>
+1-4
arch/s390/kvm/interrupt.c
···11+// SPDX-License-Identifier: GPL-2.012/*23 * handling kvm guest interrupts34 *45 * Copyright IBM Corp. 2008, 201555- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): Carsten Otte <cotte@de.ibm.com>118 */
+1-4
arch/s390/kvm/irq.h
···11+/* SPDX-License-Identifier: GPL-2.0 */12/*23 * s390 irqchip routines34 *45 * Copyright IBM Corp. 201455- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>118 */
+5-6
arch/s390/kvm/kvm-s390.c
···11+// SPDX-License-Identifier: GPL-2.012/*22- * hosting zSeries kernel virtual machines33+ * hosting IBM Z kernel virtual machines (s390x)34 *44- * Copyright IBM Corp. 2008, 200955- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.55+ * Copyright IBM Corp. 2008, 201796 *107 * Author(s): Carsten Otte <cotte@de.ibm.com>118 * Christian Borntraeger <borntraeger@de.ibm.com>···38053808 r = -EINVAL;38063809 break;38073810 }38113811+ /* do not use irq_state.flags, it will break old QEMUs */38083812 r = kvm_s390_set_irq_state(vcpu,38093813 (void __user *) irq_state.buf,38103814 irq_state.len);···38213823 r = -EINVAL;38223824 break;38233825 }38263826+ /* do not use irq_state.flags, it will break old QEMUs */38243827 r = kvm_s390_get_irq_state(vcpu,38253828 (__u8 __user *) irq_state.buf,38263829 irq_state.len);
+1-4
arch/s390/kvm/kvm-s390.h
···11+/* SPDX-License-Identifier: GPL-2.0 */12/*23 * definition for kvm on s39034 *45 * Copyright IBM Corp. 2008, 200955- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): Carsten Otte <cotte@de.ibm.com>118 * Christian Borntraeger <borntraeger@de.ibm.com>
+10-6
arch/s390/kvm/priv.c
···11+// SPDX-License-Identifier: GPL-2.012/*23 * handling privileged instructions34 *45 * Copyright IBM Corp. 2008, 201355- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): Carsten Otte <cotte@de.ibm.com>118 * Christian Borntraeger <borntraeger@de.ibm.com>···232235 VCPU_EVENT(vcpu, 4, "%s", "retrying storage key operation");233236 return -EAGAIN;234237 }235235- if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)236236- return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);237238 return 0;238239}239240···241246 unsigned char key;242247 int reg1, reg2;243248 int rc;249249+250250+ if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)251251+ return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);244252245253 rc = try_handle_skey(vcpu);246254 if (rc)···273275 unsigned long addr;274276 int reg1, reg2;275277 int rc;278278+279279+ if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)280280+ return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);276281277282 rc = try_handle_skey(vcpu);278283 if (rc)···311310 unsigned char key, oldkey;312311 int reg1, reg2;313312 int rc;313313+314314+ if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)315315+ return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);314316315317 rc = try_handle_skey(vcpu);316318 if (rc)
+1-4
arch/s390/kvm/sigp.c
···11+// SPDX-License-Identifier: GPL-2.012/*23 * handling interprocessor communication34 *45 * Copyright IBM Corp. 2008, 201355- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): Carsten Otte <cotte@de.ibm.com>118 * Christian Borntraeger <borntraeger@de.ibm.com>
+1-4
arch/s390/kvm/vsie.c
···11+// SPDX-License-Identifier: GPL-2.012/*23 * kvm nested virtualization support for s390x34 *45 * Copyright IBM Corp. 201655- *66- * This program is free software; you can redistribute it and/or modify77- * it under the terms of the GNU General Public License (version 2 only)88- * as published by the Free Software Foundation.96 *107 * Author(s): David Hildenbrand <dahi@linux.vnet.ibm.com>118 */
+2-2
include/uapi/linux/kvm.h
···630630631631struct kvm_s390_irq_state {632632 __u64 buf;633633- __u32 flags;633633+ __u32 flags; /* will stay unused for compatibility reasons */634634 __u32 len;635635- __u32 reserved[4];635635+ __u32 reserved[4]; /* will stay unused for compatibility reasons */636636};637637638638/* for KVM_SET_GUEST_DEBUG */