From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C3F933C278E; Tue, 3 Mar 2026 14:37:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772548623; cv=none; b=YDr1Hvj87EtSZV1mlE/cBsIYKoWZsKbLt8s2nBEkOMKxVhdTn0TkO6sPkfQLL6EM63ZguqXBUzIP3goKm1NKW/W/dBIFGkONbiO9h5vyc0OBM4GzDXC6M7clq0rfVwj2lE8U6uTPg7PqIn7ecT+nL2RLCmsTtHmv0NvNC7pkXa0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772548623; c=relaxed/simple; bh=m/46LDof3LqadCUxR8EzTO5Nf7CZ0A3+ar1RNvzBB9o=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=VcvGeWaVlRgyrffGl9iQRSfkLiYPbsEjCUn6i77jZWqU8qyxc7Dy9JNgUMbo1UvbzLB0xSxcj7VA9s7uvmVOHqiB6XBBrxK9x+2m0OH+RKX9nIl3LnuHt7U4sbCLPxYc0qISt7DfsFlwOBxqlWEzi7UFN2mlH42MiAFNjbtPBL0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RhIGlnEx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RhIGlnEx" 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) 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: 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 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.