From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 28A925335B4; Thu, 1 Oct 2026 15:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790867563; cv=none; b=D6uWBOJa1e4Kzpii6O4+Az8mPKc/AX9S6/VtjlBXmdgV3GHHr2xrqJpkKdftuMolMX4syEQC1VyZIlqOwylLmjYgiBZtfL4qTC8MalItZNGyIKMcitxmzLWGI2cXjzQKSNjTP/dTTh/CFSrTcQUcEiIKJN68jpgV6EYFw5tc5Qk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790867563; c=relaxed/simple; bh=ozz1C6dVuxbIm7Haps4G3u9mV6Qlp/cJorm0ZFBVOyY=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=ea+n5XHnswDgCsfXIssBJwfkP2SjzxUH1Kfcq+7jQR5RM7logyb6+oGKMGWW4jGENq6xNNp7EiBED8JDof7Uhx6/KKnbWamqJ6Y4m3jJov6U7+ylod5T/S3rN0bcshhDFLAhZbxnceEt2zUgqblFQWLWR8KT+kdzRZcDrKJJOkU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EXjsYr3f; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EXjsYr3f" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.