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 5FC24383C92; Thu, 12 Mar 2026 09:39:40 +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=1773308380; cv=none; b=XCmwZlhBwkZDgaOWom4VbfcAMWkhdOKF1BzknLwZUcn6fPUzSW8UfPaw6P5BcjURycTJ6ThJ2iW7wGXtmAUKcW7B743ZXpMwTmoKcBMpwo6LxFmgfu4UZAjARqtHL72leKTZdSi0bROJ8Qkxo88MK+8FiL7i5JWF39q9/76PNUk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773308380; c=relaxed/simple; bh=UAk43NccrQPWgbH1hCQpxC1aL/SVilMfAUwhDR2PNQ4=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=BsaW/5CWiSovFxchgZCZRBCo0vSJhtonIxE/SXo8tph+CGCXh80aqBtZnUXVGMBeh45YeHOpzZMh6ivw4qMaRUm940LZyFFZMtLQvo2okyd67P0JwG+auyfkihHm8tkpsK6CxzS1QYvQsaN+afDWgXbJ8ilwboQX0CIUDhE/MR4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X77W/luM; 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="X77W/luM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E54A0C116C6; Thu, 12 Mar 2026 09:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773308380; bh=UAk43NccrQPWgbH1hCQpxC1aL/SVilMfAUwhDR2PNQ4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=X77W/luMGxn5rnJvKDveNysjMQI0AFl+bwO7xgb29XxpB0CWy/BimckvNIwrRw2C2 yDfn16LCaPnobMcdqiTG1S0ccaualO+FKkyILLROZhIxpUn3l8RpQyQoOppexOQ81d 2eDORczRtYNVVQCmqcv8tn2ckwVNvcrgj3tBYF5Tsrhkn+x86RupwplsiRKnXcgOKW hgJ4JHv2FNQg9NZVFgYpU3r6/Z5hz/d9DL4gUE4n552wTez+B3DVskBUsQM6fVvjHx gR+P+PyPZfvp3CvY+n0kg5gZyiNd/MdpBo3ZngdGwgEvUy0o1SmPcZCCVEwPUXh/Fx DdZ3SIm4Oou4Q== 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 1w0cW1-00000001CjM-1BME; Thu, 12 Mar 2026 09:39:37 +0000 Date: Thu, 12 Mar 2026 09:39:36 +0000 Message-ID: <86342575ev.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> <87v7f2chde.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 Thu, 12 Mar 2026 09:28:16 +0000, Suzuki K Poulose wrote: > > On 11/03/2026 19:10, Marc Zyngier wrote: > > 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? > > One issue that I realised, is about the "flags" for the populate. > Data can be loaded as measured vs unmeasured in CCA (and in TDX > and SNP). I don't see a way to convey this with splice. Surely that should me a property of the memory region, and not the way it is copied, right? M. -- Without deviation from the norm, progress is not possible.