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 B18653DBA0; Wed, 11 Mar 2026 19:10:09 +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=1773256209; cv=none; b=uoCtkOcY9wbblawNte6pOBzvGJ6gE+ehibyEVJgvP78qh9phqROVN4bEdgJ41p6XVqPFrYKbeM4XTT1c6bcUADyce8HZu2L9gUlD2ObvxghGYCfBHdg/jRRY6cKp+2NwVSqpOZOJv58zj89sbJPj2NG8cn9teVIYi6vHLp5+dKs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773256209; c=relaxed/simple; bh=7ZsLa1T0BFC5juw0defQQ33UROr06FSoMCJDyDGnxkk=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=NjuoK2X127ShkulUqgWB8UtSZpig5av4vv35FcWnudr+RWVu30Gjh//W2GVQbWoJex75buQ4tX+DHtTVAoMEDbbEqVfeoa4TT8rY1kPHCzLjg++djRdlhFeE1uoMSdYqUOv+ewrKMtWRiqjH8dSRKltcaiJevi0ISeLwBR6A4HA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KYWA2VhG; 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="KYWA2VhG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F338C4CEF7; Wed, 11 Mar 2026 19:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773256209; bh=7ZsLa1T0BFC5juw0defQQ33UROr06FSoMCJDyDGnxkk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KYWA2VhGx6UU+p+ftz/FLsZ6Y//y8DzdvF0OtJLJjUIItwyyqnxvb13nvzBekRUbk l6PPgewl9tiij8yTpONZ5At9kTHAM41zo587Uj60R8h2WUyMqdOOlhOdA4y8CCN8WL dgmEVkRh0RMZ9LbZIIyn+MRzpcTbo6RuR7sKztz300/cIvetlzPYsIUKtsuFQsmozq 4BTNpU/bnfB/96i3xYhwwmJl/DiiXOYWcuRr/0Z04lnhvpImOiHsULnE9KVekm7XAi UeoJ3bt78awoa9Aq19eizM7McbOzoUtwf9eJvPZe02gj4yDfV+TRvGH+P9M1dewLlt h0KFekkAVkdFQ== 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 1w0OwY-0000000103e-3vLG; Wed, 11 Mar 2026 19:10:07 +0000 Date: Wed, 11 Mar 2026 19:10:05 +0000 Message-ID: <87v7f2chde.wl-maz@kernel.org> From: Marc Zyngier To: Steven Price Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Catalin Marinas , Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , 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: <33053e22-6cc6-4d55-bc7f-01f873a15d28@arm.com> 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> 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: 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, suzuki.poulose@arm.com, 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 Mon, 02 Mar 2026 15:23:44 +0000, Steven Price wrote: > > >> + struct kvm_arm_rmi_populate { > >> + __u64 base; > >> + __u64 size; > >> + __u64 source_uaddr; > >> + __u32 flags; > >> + __u32 reserved; > >> + }; > >> + > >> +Populate a region of protected address space by copying the data from the user > >> +space pointer provided. This is only valid before any VCPUs have been run. > >> +The ioctl might not populate the entire region and user space may have to > >> +repeatedly call it (with updated pointers) to populate the entire region. > > > > size as a __u64 is odd, as the return value from the ioctl is a signed > > int. This implies that you can't really report how many bytes you have > > copied. Some form of consistency wouldn't hurt. > > Good spot. In practice this works because >2GB in one operation is > highly unlikely to be processed in one go. But I guess I'll change this > to have an output size argument. I guess I could make the kernel update > all of base,size,source_uaddr which would simplify user space. In a conversation with Suzuki, I suggested that splice(2) could be a nicer way to express this, and allow asynchronous use with io-uring. After all, having a guestmem backend for CCA is not exactly outlandish, and having a splice implementation realistic enough. Thoughts? M. -- Jazz isn't dead. It just smells funny.