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 4B1573E7179; Mon, 13 Jul 2026 15:44:28 +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=1783957471; cv=none; b=HBwdyudcPqoMh8HyyZJztV/mtaZ9+t8P73PrY8whPdEcKoTxR2Ji17zRbUtAA13cYytPQy4QR06DfhB/OP9kust5ZM8RoBe+6Fc1LgUd/RCyzGljtD/3yBT1sMRZoG938WJZ+c9LftB6OBjvQxkZls/dm9K3qToc3HwS6Og4a44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783957471; c=relaxed/simple; bh=WQy4yHPFrrhmfGfUGbOeZTrbvBCp38LrhCThPXmRmWw=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=oRX8GceOeNC0j2Za0vDKTQZWNsLKZqxnNzI6r2/cKPY6akIfA/XjOiotQyKPHKfZuGmQwXggirjAp3JKE0LNSjVFz6JUQfHQcMaaIbehtsxdimy3TwRx/1odXlPIeSKB4kTKmpVnCYQmEMT0V5YKm3TXxdUMyIP/QCqBu/hf2nA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Hqc6eerJ; 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="Hqc6eerJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E2191F000E9; Mon, 13 Jul 2026 15:44:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783957468; bh=ktat63NoLnQpNFRxdcKM+BBqHKM1jhe2e2iY2Jj0yeo=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Hqc6eerJdrbCEWaKt7jGPuoqeJJ0VQdLenlPIJJ5p/V8gM8LGIRmMCjMIL8y+Jksd 9sfQs6jYk76e/GKObrQFXebIn5Ns55gVIT7QQGKAI9Xy2xBD7CWehQrAWOPY3WQEun pUK6cSuVzy7AGD58f3cjKzEtNWGXB0PjNnpMGAAtptKDfsckKW7xfuvlSHOsK5nsBv ius06YeOJFsTuDZAqDdi1jk/BSsbiundQ6r0J3a8dTVrrPDgB59uy5AAdASNEloasZ TuQ8wDDbDZhYZpNZaULPHs7E4twhO0K/LIO6JGuIdIjX4riO5fjGXTXRP8gjYfGqOh gG2wVqhdAVNiw== Received: from sofa.misterjones.org ([185.219.108.64] helo=lobster-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 1wjIpW-00000004YVN-0FTA; Mon, 13 Jul 2026 15:44:26 +0000 Date: Mon, 13 Jul 2026 16:46:15 +0100 Message-ID: <878q7e6gfs.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 , Suzuki K Poulose , Sven Schnelle , Ulrich Weigand , Vasily Gorbik , Will Deacon , Zenghui Yu Subject: Re: [PATCH v4 25/27] KVM: s390: arm64: Implement vCPU IOCTLs In-Reply-To: <20260710140752.984749-K-seiden@linux.ibm.com> References: <20260706085229.979525-1-seiden@linux.ibm.com> <20260706085229.979525-26-seiden@linux.ibm.com> <874ii97obu.wl-maz@kernel.org> <20260710140752.984749-K-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: kvm@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, suzuki.poulose@arm.com, svens@linux.ibm.com, Ulrich.Weigand@de.ibm.com, gor@linux.ibm.com, will@kernel.org, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Fri, 10 Jul 2026 15:07:52 +0100, Steffen Eiden wrote: > > On Wed, Jul 08, 2026 at 11:44:37AM +0100, Marc Zyngier wrote: > > On Mon, 06 Jul 2026 09:52:25 +0100, > > Steffen Eiden wrote: > > > > > > +static void adjust_pc(struct kvm_vcpu *vcpu) > > > +{ > > > + if (vcpu_get_flag(vcpu, INCREMENT_PC)) { > > > + kvm_skip_instr(vcpu); > > > + vcpu_clear_flag(vcpu, INCREMENT_PC); > > > + } > > > +} > > > > Can you clarify the semantics of adjust_pc() here? arm64 also deals > > with exceptions in the same code, and I wonder how you deal with this. > > > > We will do the same thing as native arm64 does. The KVM in this series > has no clue what an exception is. Thus I skipped the handling here. The > exception stuff is added in the second series anlongside with the sysreg > handling. Hmm, OK. Maybe I tend to view these things as tied together: - updating PC on the back of taking an exception - injecting an exception on the back of taking another exception These two are the basic primitives to affect the guest's execution flow, and the sysreg stuff builds on top of that. But if that's the other way around makes more sense to you, fair enough. > > ... > > > > + > > > + kvm_sigset_deactivate(vcpu); > > > +out: > > > + if (unlikely(vcpu_get_flag(vcpu, INCREMENT_PC))) > > > + adjust_pc(vcpu); > > > > arm64 has the following statements: > > > > if (unlikely(vcpu_get_flag(vcpu, PENDING_EXCEPTION) || > > vcpu_get_flag(vcpu, INCREMENT_PC))) > > kvm_call_hyp(__kvm_adjust_pc, vcpu); > > > > It isn't clear to me why you can afford not to deal with pending > > exceptions when returning to userspace. > > > > Same reasoning like above. We'll do the exact same thing as native arm64 > with the next series. > > Thanks for looking into s390 code :) I have the ugly feeling that this is going to come with the territory... ;-) M. -- Jazz isn't dead. It just smells funny.