Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp569896lqh; Fri, 31 May 2024 09:32:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXUz+4KYwIxKxKev9lAqlszyNhX8vu5pujMcjC1Ds6iHGVLwwrEiXdX1Zo3y6GFy0DhgiJhzA3CqxpXzztAuA/EPG+brFLXwkjURPIW+A== X-Google-Smtp-Source: AGHT+IHvaYzeBe4/Ijj/Kb7FSAGJuN+Slf7rsKFjRyQfdjFigtzNtgMrnZ8HBa4Lla+LDgLgsgyj X-Received: by 2002:a05:6a00:178a:b0:6ea:f444:341b with SMTP id d2e1a72fcca58-702477bd96amr2963166b3a.1.1717173178733; Fri, 31 May 2024 09:32:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717173178; cv=pass; d=google.com; s=arc-20160816; b=aG+9v/JoYCfxV6PuzWNDHKhW/TvbLv4puIUtH+MOJWE1I3bMKZ6tl4XKxJShfxBTVD 0Dehd/JrG64sWPN8R4TH3V+B8YLtSKMqzKUJl5ivTAksCys5ZZi+N35vWQkiTUKmexDR V4RFjtGNQ3/7fERqJlugeBUAOPQzb5TiMw0cRgnNkW/3ag1LV4n+vWwc+9LKFiIroPmv gQicZ+kXbLtKrtW8BeUE1e7hOf4gxkPWXxJFkQdIkuhO/OYHo3syHSF9dpgII6F7X7mh mWVNbqmfjydmuGS6iDz1LxWVPm8GC8juWdgBrkmv4d8Yvylcm+Nqk/lyDqGnTjmfuzZK IbUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=D8q4ihAG/G0zsUnuznKuzFGSUfICGol0G9GGe2gg3uY=; fh=97G1/tOCqDt+ERV7sZDEdH9lmW+TBz/x0Pl3WFQfeBo=; b=ZUAROeujpIsMYMnjIyFutiAmYpFJk5icwNSDVajIlmbzRTF5nYs4k7bZGB39a5GZAK GPs1A6hEKTjnyY6a1OlrVmFvWO0zQ9vCKHqHSBw7HC7eEcyAKK5pwVqHvpfHpI2VWsUU 7s6dQ30LNkHq6iCAVl/xRLOwOdBHk0pEzq8UIetl7fcceLcZcRVsK4LiTOW3DnT/wQ1u VwfCflzRPbh6OPMvj/lPXKoIh0y4VJGOB3Y0Uf5weP/T1DAFovX4AqB4zNEvYErV+HPv 5m4xa6hpv4B6TcK/Rat6f7hsFU0xqI2CYUoCBS8wMZsWDpA4rYD/0xyQnkQHKViPcDUW OKlA==; 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-197151-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c42788826csi1525703a12.622.2024.05.31.09.32.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 09:32:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197151-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-197151-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197151-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AFC3528DC30 for ; Fri, 31 May 2024 16:29:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8951915B99F; Fri, 31 May 2024 16:29:31 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA8DA158DD3; 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-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 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