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 057E3EC1459 for ; Tue, 3 Mar 2026 14:37:13 +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=mV12oqx36NxS2Iu/kn/WJFFlkK5zLro1Wfyx/TwCub4=; b=CXVgsd0kFGkQiux3Gwm1qdH9MC QlfxfLVFHerPOTxtOHGNxAbRfvHkf5YluC00QPKXdfx4ESYEDYaGfKWCVVVtM1Z719uTLaD3HugPQ Xg/5epXnoixiVAa9ttDbWXYtg3ty+fUF64rYco450Lq4QO35ADgi+EqpT3yoRgdNeb3KKlbYjcd5V ukuR8TL9qZRJRyc/JFO8It3vzDe62Rxv52ZDxqNt/AWhcwn/nO+ZXtspXTVaveNUkuE8YMSpmtHc1 lk1D2WXEvvoSpdxHPk1W9sRtu+77Rrtqpos6tVO/caD8D46e4UkCGKHlU8GmpW9dbokTTkvSZRecy 9GWtKYPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vxQrz-0000000FL22-14CK; Tue, 03 Mar 2026 14:37:07 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vxQrw-0000000FL1a-189C for linux-arm-kernel@lists.infradead.org; Tue, 03 Mar 2026 14:37:05 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 89DCC43FC4; Tue, 3 Mar 2026 14:37:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62312C116C6; Tue, 3 Mar 2026 14:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772548623; bh=m/46LDof3LqadCUxR8EzTO5Nf7CZ0A3+ar1RNvzBB9o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RhIGlnExbvHqjrKvCOMAYKyPDILck1mHKuxKeTG/9P6sPpSNVQ6cVGSbL7lVk0eE2 9UBoGOLIEh5qWL6s/JISGlQp4mz2iB1ITIS/uvl3pIwQGYg5ONc4wXsEBwsSEjDkaf HiozHmY/lH7MsUI5MKc3IsX58h9FjCaE+SHWEu7RxOJ7OYKS+ZT2t+QKfnIbgpP1mi Z6PxJHzw0gydgaJntW4yn9TDSF7osodkzkreMS3Hwm87DShNUjUQGxPNJEoNYQmCKg DutUnLfDX3IAkSu/QqMQWjQxTmao9OnlpFNO4lH+y/+Py6hImTNQ1TZaVemn0rovDS KiNaUBc0WC6sQ== 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 1vxQrs-0000000FfAT-4AND; Tue, 03 Mar 2026 14:37:01 +0000 Date: Tue, 03 Mar 2026 14:37:00 +0000 Message-ID: <86ecm17zeb.wl-maz@kernel.org> From: Marc Zyngier To: Suzuki K Poulose Cc: Steven Price , kvm@vger.kernel.org, kvmarm@lists.linux.dev, Catalin Marinas , Will Deacon , James Morse , Oliver Upton , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni , Gavin Shan , Shanker Donthineni , Alper Gun , "Aneesh Kumar K . V" , Emi Kisanuki , Vishal Annapurve Subject: Re: [PATCH v12 06/46] arm64: RMI: Define the user ABI In-Reply-To: References: <20251217101125.91098-1-steven.price@arm.com> <20251217101125.91098-7-steven.price@arm.com> <86tsuy8g0u.wl-maz@kernel.org> <33053e22-6cc6-4d55-bc7f-01f873a15d28@arm.com> <9d702666-72a8-43e4-8ab3-548d8154a529@arm.com> <86fr6h838s.wl-maz@kernel.org> 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: suzuki.poulose@arm.com, steven.price@arm.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, joey.gouly@arm.com, alexandru.elisei@arm.com, christoffer.dall@arm.com, tabba@google.com, linux-coco@lists.linux.dev, gankulkarni@os.amperecomputing.com, gshan@redhat.com, sdonthineni@nvidia.com, alpergun@google.com, aneesh.kumar@kernel.org, fj0570is@fujitsu.com, vannapurve@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260303_063704_350293_1FB271D4 X-CRM114-Status: GOOD ( 23.97 ) 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 Tue, 03 Mar 2026 14:23:08 +0000, Suzuki K Poulose wrote: > > On 03/03/2026 13:13, Marc Zyngier wrote: > > On Mon, 02 Mar 2026 17:13:41 +0000, > > Suzuki K Poulose wrote: > >> > >> More importantly, we have to make sure that the "RMI_PSCI_COMPLETE" is > >> invoked before both of the following: > >> 1. The "source" vCPU is run again > >> 2. More importantly the "target" vCPU is run. > > > > I don't understand why (1) is required. Once the VMM gets the request, > > The underlying issue is, the RMM doesn't have the VCPU object for the > "target" VCPU, to make the book keeping. Also, please note that for a > Realm, PSCI is emulated by the "RMM". Host is obviously notified of the > "PSCI" changes via EXIT_PSCI (note, it is not SMCCC exit) > so that it can be in sync with the real state. And does have a say in > CPU_ON. So, before we return to running the "source" CPU, > Host must provide the target VCPU object and its consent (via > psci_status) to the RMM. This allows the RMM to emulate the PSCI > request correctly and also at the same time keep its book keeping > in tact (i.e., marking the Target VCPU as runnable or not). > > When a "source" VCPU exits to the host with a PSCI_EXIT, the RMM > marks the source VCPU has a pending PSCI operation, and > RMI_PSCI_COMPLETE request ticks that off, making it runnable again. Sure. What I don't get is what this has to happen on the source vcpu thread. The RMM has absolutely no clue about that, and there should be no impediment to letting the target vcpu do it as it starts. Even better, you should be able to do that on the first thread that reenters the guest, completely removing any RMM knowledge from the PSCI handling in userspace. If you can't do that, then please consider fixing the RMM to allow it. Thanks, M. -- Without deviation from the norm, progress is not possible.