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 BA896158D9C; Fri, 31 May 2024 16:29:29 +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=1717172971; cv=none; b=S1NaBt+QrlR6nCZ+Ju8ytVarUdY6lNdVfDTrhmh7xcE3/LVepuTije4cRVTmKJOpUORI7W+E8N18dMPNzMW/jgJ0cxkT+lGpwHzrQeqz8ZxspGv+HEmYh+Bmrr9TIuCIWpU2pvhVIGK8bTKA45cFTOoETg09+eZsBCKpj31/Lk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717172971; c=relaxed/simple; bh=ojtrrpN1OarLx49BhUQv9ID6AunPCtGWlhkKeZU2fRc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XaCK6yy5QMgz/kp2qecD2TNtywubM4Hj8BffkBwUL6NPq/AkDLVhjpVabmhlRoRp3dY3/1na1Y1SsQnjSl75vqH118qjzMzuQSsFPonfn0ICgGi4OETQUwGIwhoJf8nG94LGU3/fLwcwfpElE7jA5tbchEb3J3I0AkbH2LLNaio= 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 5EBEE1424; Fri, 31 May 2024 09:29:53 -0700 (PDT) Received: from [10.57.40.150] (unknown [10.57.40.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5C07F3F792; Fri, 31 May 2024 09:29:26 -0700 (PDT) Message-ID: <19650d71-2421-4cef-a858-9639a5537dbe@arm.com> Date: Fri, 31 May 2024 17:29:24 +0100 Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 13/14] arm64: rsi: Interfaces to query attestation token Content-Language: en-GB To: Steven Price , Catalin Marinas Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Sami Mujawar , 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 References: <20240412084213.1733764-1-steven.price@arm.com> <20240412084213.1733764-14-steven.price@arm.com> From: Suzuki K Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 22/05/2024 16:52, Steven Price wrote: > On 15/05/2024 12:10, Catalin Marinas wrote: >> On Fri, Apr 12, 2024 at 09:42:12AM +0100, Steven Price wrote: >>> diff --git a/arch/arm64/include/asm/rsi_cmds.h b/arch/arm64/include/asm/rsi_cmds.h >>> index b4cbeafa2f41..c1850aefe54e 100644 >>> --- a/arch/arm64/include/asm/rsi_cmds.h >>> +++ b/arch/arm64/include/asm/rsi_cmds.h >>> @@ -10,6 +10,9 @@ >>> >>> #include >>> >>> +#define GRANULE_SHIFT 12 >>> +#define GRANULE_SIZE (_AC(1, UL) << GRANULE_SHIFT) >> >> The name is too generic and it goes into a header file. Also maybe move >> it to rsi.h, and use it for other definitions like rsi_config struct >> size and alignment. >> > > The realm config structure although it 'happens to be' granule sized > isn't really required to be - so I think it would be a bit confusing to > specify that. The struct realm_config must be aligned to GRANULE_SIZE and the argument must be as such aligned. > > There are only two other interfaces that require this: > * RSI_IPA_STATE_GET - completely unused so far > * RSI_ATTESTATION_TOKEN_CONTINUE - the buffer has to be contained with > a granule, so it affects the maximum length per operation. > > I'll rename to RSI_GRANULE_{SHIFT,SIZE}, but I'm not sure it really That looks good to me. Suzuki > belongs in rsi.h because none of that functionality cares about the > granule size (indeed the driver in the following patch doesn't include > rsi.h). > > Thanks, > Steve