From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D686ECA5FCF for ; Thu, 1 Oct 2026 16:51:03 +0000 (UTC) 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:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=U+uboDNmd3c4+oklKhah8Yxki5qXO3q5Peg5zVIsILo=; b=yaO2Mdk4CyIeXb6tRLT01uCk0B fHnr6uJD8kNCMG2P0J/7RRqdBCjLr0T12BwisokDEQHC78gGalTW2BND7WN1pPRGsDlTXQzi0XPf5 yyWoJ7/39yv+fvytnmwPC4dvT0tM6q/K8mDRYTQ9JMebizZt7L0PV8acfqWGHxhtS+kUPQjciODVx zMEIfUURL2yiC96LHGPNFubOGMSqrUv3WDfn7hOqLUHlB0bvHh/LWlhFf9ZPwbHyrHZtRmIUrOqzs 35xOLRCF2gamz31vDYcL5R4CvdvODLjEAjrxQ5QwQ6b1FU8pf0p1Sx360XLkyGAJI9LHxqoQynqHf 2urHD51g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xCISh-00000009UDg-1CLv; Thu, 01 Oct 2026 15:12:43 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xCISg-00000009UDU-10YU for linux-arm-kernel@lists.infradead.org; Thu, 01 Oct 2026 15:12:42 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id E524E4115A; Thu, 1 Oct 2026 15:12:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C415D1F000FF; Thu, 1 Oct 2026 15:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1790867561; bh=U+uboDNmd3c4+oklKhah8Yxki5qXO3q5Peg5zVIsILo=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=EXjsYr3f9pk1lSJ048/qqJa1G/jbortu2tHrJtCudQVO2+7tqauxJ+/+f9p0waRi7 1uY4s7FPFIZu0WxNaYxlUICOcD7sKykQwEypzkeI5xMv3IgVVbq8n4KRsajjb3BIq1 b88p5JWvYfF6QWcNjkrIDL3TLUVbFBDa6UcpTX6N9TSKW4Wc8k1L+3iUF7eH6jCaTg 93jFhVkJQQ2BW9oSyPN7Imk5R9GGZXmy0UdDsnC+aS6gHhq9F2njzzXoDFeXX2TR2i YRzt/RAjNUg7FFQfVJ2LxzO58lCK6hPoNrThjczfiMz/LtxEDSRuEdMQGzf+KV54Hl vTFevA+w2d6IQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xCISd-0000000Fqe0-1JUm; Thu, 01 Oct 2026 15:12:39 +0000 Date: Thu, 01 Oct 2026 16:12:38 +0100 Message-ID: <86wls1315l.wl-maz@kernel.org> From: Marc Zyngier To: Steffen Eiden Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Alexander Gordeev , Andreas Grapentin , Arnd Bergmann , Catalin Marinas , Christian Borntraeger , Claudio Imbrenda , David Hildenbrand , Friedrich Welter , Gautam Gala , Hariharan Mari , Heiko Carstens , Hendrik Brueckner , Ilya Leoshkevich , Janosch Frank , Joey Gouly , Nico Boehr , Nina Schoetterl-Glausch , Oliver Upton , Paolo Bonzini , Sean Christopherson , Suzuki K Poulose , Sven Schnelle , Ulrich Weigand , Vasily Gorbik , Will Deacon , Zenghui Yu , Fuad Tabba Subject: Re: (subset) [PATCH v9 00/24] KVM: s390: Introduce arm64 KVM In-Reply-To: <20261001132715.108643-A-seiden@linux.ibm.com> References: <20260930173441.66762-1-seiden@linux.ibm.com> <179085262878.3865846.5787241839391727949.b4-ty@b4> <20261001132715.108643-A-seiden@linux.ibm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: seiden@linux.ibm.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, agordeev@linux.ibm.com, gra@linux.ibm.com, arnd@arndb.de, catalin.marinas@arm.com, borntraeger@linux.ibm.com, imbrenda@linux.ibm.com, david@kernel.org, fritz@linux.ibm.com, ggala@linux.ibm.com, hari55@linux.ibm.com, hca@linux.ibm.com, brueckner@linux.ibm.com, iii@linux.ibm.com, frankja@linux.ibm.com, joey.gouly@arm.com, nrb@linux.ibm.com, oss@nina.schoetterlglausch.eu, oupton@kernel.org, pbonzini@redhat.com, seanjc@google.com, suzuki.poulose@arm.com, svens@linux.ibm.com, Ulrich.Weigand@de.ibm.com, gor@linux.ibm.com, will@kernel.org, yuzenghui@huawei.com, fuad.tabba@linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 01 Oct 2026 14:27:15 +0100, Steffen Eiden wrote: > > On Thu, Oct 01, 2026 at 12:04:51PM +0100, Marc Zyngier wrote: > > On Wed, 30 Sep 2026 19:34:15 +0200, Steffen Eiden wrote: > > > Introduce arm-on-s390. Enable KVM-accelerated ARM CPU virtualisation on s390. > > > > > > The new KVM functionally depends on KVM/vfio: Use file-based reference > > > counting for KVM [5] The series itself should apply w/o those. > > > > > > For the original, now partially outdated, cover letter, have a look at versions > > > one to three [1]. > > > > > > [...] > > > > Applied to next, thanks! > > > > [05/24] arm64: ptrace: Use constants for compat register numbers > > commit: 295d3df9b1e425099a4eb37954a02c4a08fdb496 > > [06/24] arm64: sysreg: Convert SPSR_ELx to automatic register generation > > commit: d3d78520068779779e1ed7aa0dd8a3ce63e1ca43 > > [07/24] KVM: arm64: Access elements of vcpu_gp_regs individually > > commit: 29d92585ab987bb80b1e78d811aaea2a8db86e62 > > [08/24] KVM: arm64: Use accessor functions for core regs > > commit: 89ed62818f10e38e64fea46d43ee6455a1beb647 > > [09/24] arm64: Prepare sharing arm64 headers with s390 > > commit: df6a70516adec8b7f5fa49e1755d8ee33d980d9c > > [10/24] arm64: Share arm64 headers with s390 > > commit: c7e18ba462536e870b0ff4deca581babcac9135b > > [11/24] KVM: arm64: Share arm64 code with s390 > > commit: dcb776bfcccc9662001a75b99dbfbef55f46eb31 > > > > Note that there were a few conflicts. Please check that I resolved > > them correctly. > > > After rebasing on those the arm-on-s390 part does not build anymore :( Well, that's sort of expected. The kvmarm tree doesn't have the S390 stuff yet, and contains tons of new stuff. > We are missing the definition of > static __always_inline bool esr_abt_is_s1ptw(unsigned long esr) > > > quick fix: > > on top of [10/24] arm64: Share arm64 headers with s390 > > diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h > index bf35cbe8ddcb..0708f792c631 100644 > --- a/arch/arm64/include/asm/kvm_emulate.h > +++ b/arch/arm64/include/asm/kvm_emulate.h > @@ -367,10 +367,13 @@ static __always_inline u64 kvm_vcpu_get_esr(const struct kvm_vcpu *vcpu) > return vcpu->arch.fault.esr_el2; > } > > +#if ARM64_S390_COMMON == 1 > static __always_inline bool esr_abt_is_s1ptw(unsigned long esr) > { > return esr & ESR_ELx_S1PTW; > } > + > +#endif /* ARM64_S390_COMMON == 1 */ > > static __always_inline bool esr_abt_is_exec_fault(unsigned long esr) > { > > > > A cleaner solution it to move this defenition just below > void kvm_vcpu_wfi(struct kvm_vcpu *vcpu) in > [09/24] arm64: Prepare sharing arm64 headers with s390 > and expand the shared region in the following patch. I'm redoing the merge and fixing it as follows (note that the ARM64_S390_COMMON guards are already present): @@ -336,16 +367,6 @@ static __always_inline u64 kvm_vcpu_get_esr(const struct kvm_vcpu *vcpu) return vcpu->arch.fault.esr_el2; } -static __always_inline bool esr_abt_is_s1ptw(unsigned long esr) -{ - return esr & ESR_ELx_S1PTW; -} - -static __always_inline bool esr_abt_is_exec_fault(unsigned long esr) -{ - return esr_trap_is_iabt(esr) && !esr_abt_is_s1ptw(esr); -} - static inline bool guest_hyp_wfx_traps_enabled(const struct kvm_vcpu *vcpu) { u64 esr = kvm_vcpu_get_esr(vcpu); @@ -389,6 +410,12 @@ static inline u64 kvm_vcpu_get_disr(const struct kvm_vcpu *vcpu) return vcpu->arch.fault.disr_el1; } +#if ARM64_S390_COMMON == 1 +static __always_inline bool esr_abt_is_s1ptw(unsigned long esr) +{ + return esr & ESR_ELx_S1PTW; +} + static inline u32 kvm_vcpu_hvc_get_imm(const struct kvm_vcpu *vcpu) { return kvm_vcpu_get_esr(vcpu) & ESR_ELx_xVC_IMM_MASK; @@ -456,6 +483,13 @@ static __always_inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu) return kvm_vcpu_get_esr(vcpu) & ESR_ELx_FSC; } +#endif /* ARM64_S390_COMMON == 1 */ + +static __always_inline bool esr_abt_is_exec_fault(unsigned long esr) +{ + return esr_trap_is_iabt(esr) && !esr_abt_is_s1ptw(esr); +} + static inline bool kvm_vcpu_trap_is_permission_fault(const struct kvm_vcpu *vcpu) { Does this work for you? M. -- Without deviation from the norm, progress is not possible.