From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF7DF3314D9; Mon, 10 Aug 2026 15:54:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786377268; cv=none; b=JvgOgMiJ/xb/spMFbQwyXIHTTkS9gGUKyHiOWTF75KXzjg5eFuG2r3G7uTn+/cTzR2nVMdDiQAz/FggVa/HRSn4e8ZNk4ROqy/NIJ94jmTDKEfW8yz/vFEr1ezDztQLut/2g0qYbofKqp5Vdfe6RkZoeXH2kjNgxGvUxFdPT7Is= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786377268; c=relaxed/simple; bh=bLnHy7f70h4PkdGwizz8ef6zFFer4pHaelc42fJYfNI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D+kgnROjL1okdXxcgyu0qsOpj3IsTH3kdFYSFuRQC4/YXVuokn3JcF8KqlympPvwaTw5LH/VQdTLHI/5r/Ba96ECLAOQtx4ih2hTTbM8/3OUznGJ8r19A8Xnx4hvVp4G3Jeism7UrVV2LrcXPD6RxWQzHh4rjdG3uxKgec7VdWE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=mI24JEYF; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="mI24JEYF" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67AFWpnO2026262; Mon, 10 Aug 2026 15:54:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=mjMfqi BujNNCgUacSed9Jf2pZlzO6KCunI7UVflzk5E=; b=mI24JEYF1olAdsfZ/96I/Y z4c9WtgMySSh44vkHGjObz2sfKr16yVA6wScOJ9ax8pN/2cWCb/5F/sTDtTg/yW7 PwLz/Zm5keG/pvJa4uIJqpxGgFYVa9wNP0PSqgkf5/7Ft50B3PDnOii4IhD0TJpb a61E3crfQ1jEt8Brbdu0XGecdcNhbdMY5O4JDinB4dcO6QXvI+D0dFVlC22xEJ2z HfqPbgC3kOLO6xMsJuG2utvsN+fa5Uf/1uhE1wX9Bl3hOyFksmPLN2qS5Ow0dYl0 C0I6J3DQHI24QGbRo0af4ncqVfZjLbmZV+/sK1X6aVDoNmpt/fCvRXfEhZqN32/Q == Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fwvm9gu9y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Aug 2026 15:54:22 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 67AFgXnh015321; Mon, 10 Aug 2026 15:54:21 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4fxf5vwh4e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Aug 2026 15:54:20 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 67AFsF4b31785250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Aug 2026 15:54:15 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E0AC20049; Mon, 10 Aug 2026 15:54:15 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E18220040; Mon, 10 Aug 2026 15:54:14 +0000 (GMT) Received: from [192.168.88.52] (unknown [9.111.41.151]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 10 Aug 2026 15:54:14 +0000 (GMT) From: Christoph Schlameuss Date: Mon, 10 Aug 2026 17:53:52 +0200 Subject: [PATCH v2 04/20] KVM: s390: vsie: Add ssca_block and ssca_entry structs Precedence: bulk X-Mailing-List: linux-s390@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260810-vsie-sigpi-v2-4-e8d59a2f2f70@linux.ibm.com> References: <20260810-vsie-sigpi-v2-0-e8d59a2f2f70@linux.ibm.com> In-Reply-To: <20260810-vsie-sigpi-v2-0-e8d59a2f2f70@linux.ibm.com> To: kvm@vger.kernel.org, linux-s390@vger.kernel.org Cc: Alexander Gordeev , Christian Borntraeger , Claudio Imbrenda , David Hildenbrand , Eric Farman , Heiko Carstens , Janosch Frank , Nico Boehr , Paolo Bonzini , Shuah Khan , Sven Schnelle , Vasily Gorbik , Christoph Schlameuss X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2848; i=schlameuss@linux.ibm.com; h=from:subject:message-id; bh=bLnHy7f70h4PkdGwizz8ef6zFFer4pHaelc42fJYfNI=; b=owGbwMvMwCUmoqVx+bqN+mXG02pJDFmVXxR3Tpx+5Hqvel/jscOP72RvZFfNT15WqZJWdiFa7 kX2gbgNHaUsDGJcDLJiiizV4tZ5VX2tS+cctLwGM4eVCWQIAxenAEwk6R/D/8rc7MxDCSf0I8pv hMpJq699a5e51XdZtPf2L/lb/fa9M2ZkuDVpTuauyYavP1SYl72dffGxeui3+PXTtO2iungEt12 /yQ0A X-Developer-Key: i=schlameuss@linux.ibm.com; a=openpgp; fpr=0E34A68642574B2253AF4D31EEED6AB388551EC3 X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODEwMDEzNCBTYWx0ZWRfX605JonrT1di2 manFPA41WSL3YBzRviybtik6NoTp5qHRkt6AUdcwHT5bGwmggjbZ113X+goXAfnAUuih64bv2pd Yeig4gWwxkdzXkqFy44nMbgFP5A3lWg94j5N3ONZnzOK6OR4T/24ObKi3/SS/ugyr6ZLGVoPGUI nv7iHzVSpNKY6+tSKXMtGv+plfYlq8Gz69rTbg0iI/rvvp4OKv2XmPnvWH91ilZw4K4EYa7GytJ DpHt3Qwj5GT+Xktu5c8EKQkIz4gnIWpuiHaoMJjeS6PFYVnb1H1xvVewswuXjBD4Xc3V0LNI4Cn qaZvpTOeBYBPtQGcvp0q5KANbQSzSlmw8PFefq927bmx1k+78rSmSHiQLaaEhrFDUamCbVufxMj 7Pwz/nal2sCj2YWgY0BcGmEkITf/PjsnL7Y153w6nuZNEuqLSmfVmkY19QofTu21b9HpPC4TAIB V/LnRZsYqyDY7kAETPQ== X-Proofpoint-ORIG-GUID: SDu_Z6nssrK9absjw-w_65K66YomkOzv X-Proofpoint-Spam-Info: AW1haW4tMjYwODEwMDEzNCBTYWx0ZWRfXwquBzJDAMR/b RM3VUPZTBXw9eTIoxS/W7Hhz1198eign5817dvX4EyART7uC9AwnYrsGWmy7Ip0djDFmHFFn/wQ xPzPkgcLpAQBp47GcnpHKBmvw+Wfhp0= X-Authority-Analysis: v=2.4 cv=IfK3n2qa c=1 sm=1 tr=0 ts=6a79f42e cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=KXQrNVq8KaMVEL7Tj7gA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: SDu_Z6nssrK9absjw-w_65K66YomkOzv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-10_03,2026-08-10_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608100134 Add the required guest-1 structures for the ssca to the SIE control block for use in later patches. The shadow SCA features the address of the original SCA as well as an entry for each original SIGP entry. The entries contain the addresses of the shadow state description and original SIGP entry. Reviewed-by: Janosch Frank Signed-off-by: Christoph Schlameuss --- arch/s390/include/asm/kvm_host_types.h | 25 ++++++++++++++++++++++++- tools/testing/selftests/kvm/include/s390/sie.h | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/arch/s390/include/asm/kvm_host_types.h b/arch/s390/include/asm/kvm_host_types.h index ac82dd09fce5..8326ba1d2ead 100644 --- a/arch/s390/include/asm/kvm_host_types.h +++ b/arch/s390/include/asm/kvm_host_types.h @@ -6,6 +6,8 @@ #include #include +#define KVM_S390_MAX_VSIE_VCPUS 256 + #define KVM_S390_BSCA_CPU_SLOTS 64 #define KVM_S390_ESCA_CPU_SLOTS 248 @@ -47,6 +49,13 @@ struct bsca_entry { __u64 reserved2[2]; }; +struct ssca_entry { + __u64 reserved1; + __u64 ssda; + __u64 ossea; + __u64 reserved2; +}; + union ipte_control { unsigned long val; struct { @@ -88,6 +97,20 @@ struct esca_block { struct esca_entry cpu[KVM_S390_ESCA_CPU_SLOTS]; }; +/* + * The shadow sca / ssca needs to cover both bsca and esca depending on what the + * guest uses so we allocate space for 256 entries that are defined in the + * architecture. + * The header part of the struct must not cross page boundaries. + */ +struct ssca_block { + __u64 osca; + __u64 reserved08[7]; + struct ssca_entry cpu[KVM_S390_MAX_VSIE_VCPUS]; +}; + +static_assert(offsetof(struct ssca_block, cpu) == 64); + /* * This struct is used to store some machine check info from lowcore * for machine checks that happen while the guest is running. @@ -317,7 +340,7 @@ struct kvm_s390_sie_block { __u32 fac; /* 0x01a0 */ __u8 reserved1a4[20]; /* 0x01a4 */ __u64 cbrlo; /* 0x01b8 */ - __u8 reserved1c0[8]; /* 0x01c0 */ + __u64 osda; /* 0x01c0 */ #define ECD_HOSTREGMGMT 0x20000000 #define ECD_MEF 0x08000000 #define ECD_ETOKENF 0x02000000 diff --git a/tools/testing/selftests/kvm/include/s390/sie.h b/tools/testing/selftests/kvm/include/s390/sie.h index 160acd4a1db9..4ff1c1a354af 100644 --- a/tools/testing/selftests/kvm/include/s390/sie.h +++ b/tools/testing/selftests/kvm/include/s390/sie.h @@ -223,7 +223,7 @@ struct kvm_s390_sie_block { __u32 fac; /* 0x01a0 */ __u8 reserved1a4[20]; /* 0x01a4 */ __u64 cbrlo; /* 0x01b8 */ - __u8 reserved1c0[8]; /* 0x01c0 */ + __u64 osda; /* 0x01c0 */ #define ECD_HOSTREGMGMT 0x20000000 #define ECD_MEF 0x08000000 #define ECD_ETOKENF 0x02000000 -- 2.55.0