Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp438448lqp; Wed, 22 May 2024 08:53:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5gThdsmk81hCSCMsiJ/10RUEl65c11O8J1Uc5KtnK3kNWe2He4IInSz+8q5z8wezywZbgof9k2022BtmGMAdRY8UbCn7mH66IlM62zA== X-Google-Smtp-Source: AGHT+IGqmOzoGlmchOBMzl3DLAu7Q7guu6cicWvZwOWdGNgNy0DcVMumSf9Xl1XnW88BxvuQc1jI X-Received: by 2002:a05:620a:2f9:b0:792:b952:eace with SMTP id af79cd13be357-79498f46259mr422554185a.17.1716393194579; Wed, 22 May 2024 08:53:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716393194; cv=pass; d=google.com; s=arc-20160816; b=c7onmf5h61SGO36eHdl80PaElOR3bLL5HJ5KzMDpfx02PXVJr6TVxWDsGbiCDHe/2h S7mC53ADES/ePvJNvmCAJs7mW1ONR0ivbZQWsGI+aG0T2grLvWxTzv6J95puzjwGs66F SiNH0Ldscg3sHa/HwKW7HMCcYfl3ig32lCB+Nfd9TBL93MYP2FYoKdHsgg/3KgbzQY02 pMyR+PZg8DSQRPHGxmXYTWcmXdVIBVjjy/LWPgTph+c4s7dqpSOS8oaGKxzC0H/0DwLu 3JSd4bVrJNbmZzWuP/nDFmUCRbnfOiyU/fXchjZCcKFpO6aZhB7HOPI0OrrNaamZH4x3 6/qA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=Vv8f27Pc3P4xiZi1MvZ73qYAW1hdKhz3BR+CazlebsA=; fh=rivaxX1H5Nct9mYaj37CyBIYE73xYwVeosOzp7vbxek=; b=V/zURkOEZqRMvUlqrubC2CvKFt6FgftXoDEbZ/ssDDTIX6xF47EDfoK0AcONgrKNxA YdqC4U81hHdYHH2JfYpF/j7nDYUWsISvfOF63w8f5Dda1TkWppKJXkQdVoBiftYqVp7o TyqVlKMbCZp2yRrjE5aE2dpRbQlBo9tM9AnYKIkGj77WIugtBJlaUBsHq53lm0n6BwUR SqiIzLMcarVwtm6cQtDxSQremCf7o/etsVIq5nSbWPTYykJdP9VzAt3TQ2MC/0RbrHzi XOCiR61M8YozSTJDFFlzxs6UXooO4rb4/x1p3rCI9P3MbKU6OAeGCyJsWFYhNIBWZWDi u6Eg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-186463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186463-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf38dcaasi3035930385a.772.2024.05.22.08.53.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 08:53:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-186463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186463-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5001F1C20BBD for ; Wed, 22 May 2024 15:53:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3239314198A; Wed, 22 May 2024 15:52:52 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC0F0140E4D; Wed, 22 May 2024 15:52:49 +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=1716393171; cv=none; b=nfzJWQh7ncw6xL2x+Ez1KUyqr3LGXD1GlAsaCKHtDuxcyrBHtLsL8iOIrnYKa1sUiaAjIxT9EzZf2EBxu/Qt5BEeqdoBf6v4ijqBfriu+K+dl1s3UadN4D2k0bjzaHxJ9jYF94zMZEPmobT7+Us/LqW/SyVDBP5b3zhq8dHIkLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716393171; c=relaxed/simple; bh=FNUKhCgH3p/nE748aRJauYt6enORN/xUcsNBXPvhy6k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=s3ZqqC2DS5HVIO10SpkNlMVkxMnzZYlu9L0HGg1odLmy7kIq2Qx2dMCvqhLcw7KwqM9I0gholEfQ9sETh50wQEC67pNrYCWHHWXy5jVF3gVKQ4x9hBe62R0L9SKRtHpg9gZKjdMFpRIDaqPjEuglytwqrXMVfpR+o+vJ1uQGcYs= 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 2005DDA7; Wed, 22 May 2024 08:53:13 -0700 (PDT) Received: from [10.57.35.73] (unknown [10.57.35.73]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 750243F766; Wed, 22 May 2024 08:52:45 -0700 (PDT) Message-ID: Date: Wed, 22 May 2024 16:52:47 +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 v2 13/14] arm64: rsi: Interfaces to query attestation token To: Catalin Marinas Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Sami Mujawar , Marc Zyngier , 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 References: <20240412084213.1733764-1-steven.price@arm.com> <20240412084213.1733764-14-steven.price@arm.com> From: Steven Price Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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. 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 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