From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CFAF606A688 for ; Wed, 2 Dec 2026 14:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=hIJ3yON6; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=IKa7Y4ot DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=rBTSalvz2oqL9it6o6KC4mR8996nzRoxMkOEqwaKQYs=; b=hIJ3yON6+r9OQhNn04P9lhSBa+ AKDLow3hDYGcagw2dFNGhoioYx6EOs7oarrjhF+L1qsGpskBODpIs0DA5e5upEpQSB1tTq1+X43hP oBGnjiumX/TvE2TT2ThUqHOAkXg20trmdu0730NTU+dnpNCmbU/A/3wU6R5ThVKcn361p0wpJZRkY vOuAfC+mMKoigE4VEhW0Nvm6ods22Gv+0R+vFhWA1Czj2kJJeDALweYGyHO4YAJcS9Old9B/P3DyU m4f8WLS1gHBhSlW7vpMXBa7E9i8H9QBuYiE++RaYHSzzdW748uhwpCf+pU3B2LsNwkGKRAIppRrL+ ZkevOW1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYl4g-0000000BhFb-2QqP; Wed, 02 Dec 2026 14:12:46 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYl4d-0000000BhCV-3irG for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 14:12:45 +0000 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2AM5eG2795080; Wed, 2 Dec 2026 14:12:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pp1; bh=rBTSalvz2oqL9it6o6KC4mR8996n zRoxMkOEqwaKQYs=; b=IKa7Y4otviQZRUs/wgzYIDmkLsvIG37QCSCefLytoxxA F37G5Ahxm6EhMgAwVqSXaKUBXmzio8Az7xZIrpg1ZBcdRN0srfnoRCeLyjtOjR6r 3FWqnuN5HFqBSxKr+iMZku3RqxjL8oIEn80o86Io0NPJO6471xFSI0GCFHlb0odE AkkJwr593BzPEOcRPoXB2u719j9zYHVpDlE3xF2XjanXqKBY8EPizjqQyoDyGPbG JkQXBxrWbwJnrrs6732zucU9HqTlk2yEPpYp/hajaxp28QjpyMbiiyqx/kiKlUFw 3HpuiKtUjEME0fgTQzxCyijhlECS6lFbnjIYniaPmA== 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 4j7pmta4dw-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 02 Dec 2026 14:12:08 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2BYsIl2046213; Wed, 2 Dec 2026 14:12:07 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4jaajsa2t1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2026 14:12:06 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6B2EC2UV40567194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Dec 2026 14:12:03 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D64EA20043; Wed, 2 Dec 2026 14:12:02 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 750BB20040; Wed, 2 Dec 2026 14:12:02 +0000 (GMT) Received: from a46lp73.lnxne.boe (unknown [9.87.84.240]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 2 Dec 2026 14:12:02 +0000 (GMT) From: Steffen Eiden Subject: [PATCH 00/12] KVM: s390: arm64: SMCCC, timers and IRQ line Date: Wed, 02 Dec 2026 15:11:38 +0100 Message-Id: <20261202-smccc-v1-0-48340e2737b6@linux.ibm.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/22O0W6DMAxFfwXlea6SQIDw1P+YKpQYh0VdaEcg6 lT135cWaZrE3nyt63N8Z5FmT5F1xZ3NlHz0lykH8VYw/DDTSOCHnJnkshZCNhADIgK2aLl2TUs WWe5eZ3L+9uK8n7Y809eaccu2ZIFiNC9cV2wwrsBPcYIkQYBzstFtY4wU8vjpp/V28DYc8BLY3 1d+b2uI33GmEYbaDI7jUFZD1aXq2d6rpIJzCn0aPfZxWW2EJLIUVYlGotJKm730X0zC69qfPZ6 fBA5G8tJyYaxWzZ5gTSTIc/BLV+iqbIhaW6Or2enx+AH+gI7oewEAAA== X-Change-ID: 20261127-smccc-c8cb09f78ebc To: Marc Zyngier , Oliver Upton , Fuad Tabba , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Mark Rutland , Andreas Grapentin , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Sven Schnelle , Friedrich Welter , Gautam Gala , Hariharan Mari , Hendrik Brueckner , Nico Boehr , Ulrich Weigand , Arnd Bergmann , Paolo Bonzini Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, Steffen Eiden X-Mailer: b4 0.14.3 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: p2YFNOx-E9UcMK4exVNCVL7w4CFIKz7O X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA1NiBTYWx0ZWRfX6l+giMKb97Ba /sw1vhq6zmJxJ30FFg6NeaaIYXhKroMN8UWla/c+UwNBGqhOjgBvLtducy1MBI2fZsi4WoY5QsM FtUiRQ/zAdJsPqUcUpn5OoXu4YwhH/g85wxombdRP2DqZbBFQz04gTzNuvCPLxfh8y5Qbi1pD60 THK+cK60+dLfx1DwwpIk3uTW0uvUI75gf2vX6JJwv/3+hcAImNIQ4zIG3MsEYrCZgTnScIW4/Sf OYyAdJPgJhj5RZQ63IEb80RnkD7ut6FoizrRSGg4Q6+1YP1sMbk7NzIsTcDBpQQh8ak/N3yIrR3 cObTqPcSWUvvKuFw2Y40Npx8E/E7fPS2R3QcJhCXmcK+OWbwbtC8ql97Fr50o93kyFdqfMEVxa3 xqSrBgwarfGR9Fuq0AizV/bJ0wYkoRRMrz9ST5c7DOunNCXFSlu+ZL52aa0Y2uPbqqZjQboJAj3 GTtDe9g1hAvKVI+psfQ== X-Proofpoint-GUID: p2YFNOx-E9UcMK4exVNCVL7w4CFIKz7O X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA1NiBTYWx0ZWRfXwsXIgj057Rit ZlooXdY3abJw6OUFtWaF42AITtlq1g31vqnetWP00ikJiF5/Zh2xjTNrjFPKYTBgkOmy0dn/qVc pctQ3AMjiS4WT8isBJ8BtygOnDJ4yTw= X-Authority-Analysis: v=2.4 cv=U9cHnuru c=1 sm=1 tr=0 ts=6b102738 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=oh15QwwALRXypobzXI0A:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_02,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020056 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261202_061243_969381_6F20B332 X-CRM114-Status: GOOD ( 24.50 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Add SMCCC/PSCI support, the arm64 architected timers, WFx* handling and the userspace IRQ line for KVM/arm64 on s390. The arm64 SMCCC, timer and vCPU power management code is shared with s390 and wired into the s390 KVM module. This is the third series on the way to arm64 guests on s390. The first series laid the KVM foundation (basic module, vCPU run, simple page faults) and is included in v7.4. The second series built the system register layer [1]. This series adds the guest CPU management layer on top. Power management with PSCI, full SMCCC handling, the architected timers and interrupt injection from userspace. This series depends on the second series [1], on the vCPU kick enabling series [2], and on the vgic stubs patch [3] PATCH 04 and 05 can be squashed into series 2 [1] and will be when I send v5. I just did not want to send a respin after a few days w/o much comments. Changes in detail: arm64: Prepare headers and code for sharing with s390: guard arm64 headers that reside in include/ such that s390 can consume them, and move a few things/ The moves add a bit of churn in the diff but reduce the number of shared sections required for the timer from seven to two. Share the SMCCC related files (hypercalls, psci, trng, pvtime) as a whole.Share the timer functionality that is architecture agnostic. As timers work differently on s390 only a subset can be reused. Share the functions for managing SMP guests. s390: Implement the mp_state plumbing for arm64 guests backed by the shared power-off/suspend infrastructure and the MPIDR data used for SMP guest management. Use the shared arm64 code for handling SMCCCs and implement the final host-side plumbing, removing the primitive SYSTEM_OFF only implementation. Add support for the arm64 architected timers (virtual and physical) of an arm64 guest. The SAE block holds the timer control registers, and ISTATUS in CTL is set when a timer condition is met. The shared arm64 arch_timer.c is built with s390-specific backends: CTL and CVAL are accessed through vcpu_{read,write}_sys_reg(), and the guest counter is obtained with PTFF QAGPT from the guest physical time offset (GPTO) in the SAE block. Trap WFx* and handle them in kvm_handle_wfx(). A vCPU halted in WFI or WFIT is woken by a background hrtimer armed for the earliest of the enabled guest timer expiries and the WFIT deadline; on expiry the hrtimer raises KVM_REQ_UNBLOCK and wakes the vCPU. There is no in-kernel irqchip (yet!), so timer output level changes cannot be injected. After each guest exit handled in the kernel, including a timer interception (SAE_ICPTR_TIMER), ISTATUS in CTL is compared with the level last seen by userspace and the vCPU exits with KVM_EXIT_INTR on a change. On vCPU reset both timers are disabled and unmasked. Implement the IRQ line for the !irqchip_in_kernel case, i.e. interrupt injection from userspace. A branch with this series at kernel.org is available [4]. Steffen [1] https://lore.kernel.org/all/20261127-sysreg-v4-0-a6318d18aab5@linux.ibm.com [2] https://lore.kernel.org/all/20261125-vcpu_kick-v1-0-a203b01ab957@linux.ibm.com [3] https://lore.kernel.org/all/20261125-kvm_vgic_stubs-v1-1-c53ca2c5959a@linux.ibm.com [4] https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git/log/?h=sae --- Andreas Grapentin (1): KVM: s390: arm64: Add IRQ line Gautam Gala (2): KVM: s390: arm64: Provide timer infrastructure KVM: s390: arm64: Trap WFx Steffen Eiden (9): arm64: Prepare for sharing with s390 arm64: Share timer and smccc functionality with s390 KVM: arm64: Share timer and smccc code with s390 KVM: s390: arm64: Use register shadow helper KVM: s390: arm64: Shadow the guest timer CVAL registers KVM: s390: arm64: Use mpstate for guests KVM: s390: arm64: Enable full smccc support KVM: s390: arm64: Report fwregs to userspace KVM: s390: arm64: Integrate guest timer arch/arm64/include/asm/kvm_emulate.h | 4 +- arch/arm64/include/asm/kvm_host.h | 40 +++--- arch/arm64/include/asm/kvm_mmu.h | 2 + arch/arm64/include/asm/pvclock-abi.h | 1 + arch/arm64/kvm/arch_timer.c | 95 +++++++------- arch/arm64/kvm/arm.c | 25 +++- arch/arm64/kvm/hypercalls.c | 4 + arch/arm64/kvm/psci.c | 3 + arch/arm64/kvm/pvtime.c | 2 + arch/arm64/kvm/trng.c | 2 + arch/s390/include/arm64/kvm_emulate.h | 6 + arch/s390/include/asm/kvm_host_arm64.h | 45 ++++++- arch/s390/kvm/Kconfig | 1 + arch/s390/kvm/arm64/Makefile | 7 +- arch/s390/kvm/arm64/Makefile.gen | 7 +- arch/s390/kvm/arm64/arch_timer.c | 226 ++++++++++++++++++++++++++++++++ arch/s390/kvm/arm64/arm.c | 227 ++++++++++++++++++++++++++++++--- arch/s390/kvm/arm64/guest.c | 14 ++ arch/s390/kvm/arm64/handle_exit.c | 105 ++++++++++----- arch/s390/kvm/arm64/hypercalls.c | 32 +++++ arch/s390/kvm/arm64/psci.c | 20 +++ arch/s390/kvm/arm64/pvtime.c | 15 +++ arch/s390/kvm/arm64/reset.c | 14 +- arch/s390/kvm/arm64/sys_regs.c | 8 +- arch/s390/kvm/arm64/trace.h | 45 +++++++ arch/s390/kvm/arm64/trng.c | 12 ++ arch/s390/tools/Makefile.arm64h | 2 + include/kvm/arm_hypercalls.h | 3 + include/kvm/arm_psci.h | 3 + 29 files changed, 836 insertions(+), 134 deletions(-) base-commit: 9437ee8b6cf607e883b36e44bd755968daaebd48 change-id: 20261127-smccc-c8cb09f78ebc prerequisite-message-id: 20261105-insn-v2-1-ff27987aa212@linux.ibm.com prerequisite-patch-id: ed28ef94c9056cb81bb738f1b54745d012cb613f prerequisite-change-id: 20261106-sysreg-d6adf0cd34d4:v4 prerequisite-patch-id: ed28ef94c9056cb81bb738f1b54745d012cb613f prerequisite-patch-id: 4f6b2386967522be268f77ca6eb9487a3503dc96 prerequisite-patch-id: 539f1138a427fddb952a5f7a0691e8acd974d0fb prerequisite-patch-id: 3e9b8384f07ff18911f48eabe625a1c0507a5e96 prerequisite-patch-id: fc58c00a1006ecffd045728020ef01308022ac03 prerequisite-patch-id: 2c22bad7059a38c4ea01ca774d0c0b49cea27fba prerequisite-patch-id: c809f818609fed0a0f8ccb1721b96f5329505543 prerequisite-patch-id: b35581eba719557148ea84232698457adc8c8cc4 prerequisite-patch-id: 0b8792bac82c24bfac0b5912d2eec5da32413747 prerequisite-patch-id: 58fb40b78dd793ca3b24cadadad8868bc54aa20e prerequisite-patch-id: d986b0811f1feac0678eb135ce5c44140748431b prerequisite-patch-id: 0e3d84b8259a175fceb67b01bc37c1830805636b prerequisite-patch-id: 53a6741f3c6ec60c798995ccbf4d2b293619ec34 prerequisite-patch-id: b71ccf22e4cb8fccf4ca9eea558af14163b256db prerequisite-patch-id: bba91e0c077b1f308e2ec914a54399f775d9090d prerequisite-patch-id: 9be57897346558cd0bea61d946d85d3ba9a17f2e prerequisite-patch-id: f4ae3a54ce24b78e335eb1f019b971419d82720a prerequisite-patch-id: cc8dfe5b2b8a3f28b3c29b1a10827d99f987694d prerequisite-patch-id: f27d96dacb5c7dadc01f1cc72158b8b3f64d7053 prerequisite-patch-id: 1c69a0380267279633c8ba33bf1d30c13877e033 prerequisite-patch-id: 20ac948d6ec4bfd4b9c3d053bcb0fcb3fe067486 prerequisite-patch-id: db6b83091a6107dbfd9c4311af14fadf1534375f prerequisite-patch-id: af30d541a7cabea0981dfe79276d1e9991a8c91a prerequisite-patch-id: 5eead648d962cbdc9f45ce40538f174faedd5775 prerequisite-patch-id: 97589af6c7ac9efe15c371883511fc05d4f1c870 prerequisite-patch-id: f661ef5923e8026fab81d73e596006ac30d5cbac prerequisite-message-id: 20261125-kvm_vgic_stubs-v1-1-c53ca2c5959a@linux.ibm.com prerequisite-patch-id: bd1a0c1fa7ff80d9edd5fff5258d8af1de06d7d7 prerequisite-message-id: 20261125-vcpu_kick-v1-0-a203b01ab957@linux.ibm.com prerequisite-patch-id: 90cb98820a1c6fec2085ca6830827f90c6b659ab prerequisite-patch-id: 36feb5c5ca141ca0a94f60e8cc27e3969f3ebefd