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 A4FF3112586B for ; Wed, 11 Mar 2026 19:10:18 +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=y+rVV49EF0FMl8A4mEAP/i7Af0FPjtqL5f8uFjubBsU=; b=o+MzPhUI9loE1zIY0mhpgHRsIf aBW3EzOMuzfbIuluTnDwCP44LWMhs1aZagYfLak0b2iAUPRIKhYKwmB3cwiS/tSTJCBEZeWzCWRjC bPdarijWy2gHUPqNUlDwl3OjWlXvmHlnD9+NZemPPkrHDgMkmvHqbAHkKT7U48t1/LEGvLK8fyrlx D76jgTTapnbbpLyLq9/a2qQII+hkPKlkqhMYSRM4HyzPpQ8aPFJFGdc8XlPkJpj33u3MZ5Qy/QEyh AHuNQ0I0gN5Za6HvlrTfmUIjb7KeSFoWc1TnSP51gm0n2TvR2Bqk4PBQrAxmZvtaS0rztqu3M/ZIC H+8ZSeQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0Owe-0000000CIeU-2W8x; Wed, 11 Mar 2026 19:10:12 +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 1w0Owc-0000000CIde-00tv for linux-arm-kernel@lists.infradead.org; Wed, 11 Mar 2026 19:10:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 738B242B22; Wed, 11 Mar 2026 19:10:09 +0000 (UTC) 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) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260311_121010_081109_A2D6BD3C X-CRM114-Status: GOOD ( 19.94 ) 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 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.