From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9AA51A315C; Fri, 25 Apr 2025 10:48:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745578107; cv=none; b=fxbsTyNq3csBWlyFypmP23MEn/VqOcOG0wkSuJ9lrb3msnVT+SH57K4E7Il/czCZbD+ggRc24CjE3T6/mJHweUQF7ahw76X6+p7OPXXhaKhQbh8N3ptARcSbuiCtlt+Df9szn/MRi71sNLN4GbfHXodjtXPBJzS5DlnUyd0YiTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745578107; c=relaxed/simple; bh=J7s3QtS1y8NxrN3e4R6heuEhfQ129IhNm+6sUboFvCo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iGq/nxtMAJu/iBRseSXJPr0G+dfNQLdxEoHsaNxLb9hsLaJbAFzddOE+l6Y2XoZpTd60LmnllEaghYY7Z6k4mcc2cHXfbXbpFLSbOGNNrEC5azZJU7nNtQsxXAlsvWB7iztA85oqzEFvBg+lPjBN0Fr8WDVYwAHs8L5civUbOmo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92989106F; Fri, 25 Apr 2025 03:48:19 -0700 (PDT) Received: from [10.57.45.160] (unknown [10.57.45.160]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 818C63F66E; Fri, 25 Apr 2025 03:48:21 -0700 (PDT) Message-ID: Date: Fri, 25 Apr 2025 11:48:20 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 04/43] arm64: RME: Add wrappers for RMI calls Content-Language: en-GB To: Steven Price , kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Catalin Marinas , Marc Zyngier , 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" References: <20250416134208.383984-1-steven.price@arm.com> <20250416134208.383984-5-steven.price@arm.com> From: Suzuki K Poulose In-Reply-To: <20250416134208.383984-5-steven.price@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Steven On 16/04/2025 14:41, Steven Price wrote: > The wrappers make the call sites easier to read and deal with the > boiler plate of handling the error codes from the RMM. > > Reviewed-by: Gavin Shan > Signed-off-by: Steven Price > --- > Changes from v7: > * Minor renaming of parameters and updated comments > Changes from v5: > * Further improve comments > Changes from v4: > * Improve comments > Changes from v2: > * Make output arguments optional. > * Mask RIPAS value rmi_rtt_read_entry() > * Drop unused rmi_rtt_get_phys() > --- > arch/arm64/include/asm/rmi_cmds.h | 508 ++++++++++++++++++++++++++++++ > 1 file changed, 508 insertions(+) > create mode 100644 arch/arm64/include/asm/rmi_cmds.h > > diff --git a/arch/arm64/include/asm/rmi_cmds.h b/arch/arm64/include/asm/rmi_cmds.h > new file mode 100644 > index 000000000000..27cd2751f3bf > --- /dev/null > +++ b/arch/arm64/include/asm/rmi_cmds.h > @@ -0,0 +1,508 @@ ... > + > +/** > + * rmi_rtt_destroy() - Destroy an RTT > + * @rd: PA of the RD > + * @ipa: Base of the IPA range described by the RTT > + * @level: Depth of the RTT within the tree > + * @out_rtt: Pointer to write the PA of the RTT which was destroyed > + * @out_top: Pointer to write the top IPA of non-live RTT entries > + * > + * Destroys an RTT. The RTT must be non-live, i.e. none of the entries in the > + * table are in ASSIGNED or TABLE state. minor nit: It may be worth emphasising that you mean HIPAS here and not RMI_ASSIGNED (as returned by RTT_READ_ENTRY). The key is, an unprotected live leaf mapping (i.e., HIPAS=ASSIGNED_NS) is considered non-live. Either ways: Reviewed-by: Suzuki K Poulose