Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp410536lqd; Wed, 24 Apr 2024 06:19:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6SHxTIsyo6LZkaQBjHl5YdNGMA2OHOO146CCZ7UKEjPESVMSybDjf6tLp0AeZcHb8aHvkq9vy/u2aT+P5lMqOJ9l1wj41YbuvXMCX+Q== X-Google-Smtp-Source: AGHT+IH9BFNmaeD6eToQPFizVEstTAsLTdxBkWzZAxWMgQ7YaKnNPwg+Rxm/OX94RlldFmx/bJQg X-Received: by 2002:a05:6a00:b41:b0:6e7:3223:4556 with SMTP id p1-20020a056a000b4100b006e732234556mr3196463pfo.32.1713964790549; Wed, 24 Apr 2024 06:19:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713964790; cv=pass; d=google.com; s=arc-20160816; b=SmZynD8Tba6cVS+LoEBhP1Bn4PLdLkrtX+3jy1XUXHUT24kg0BbLSd1HY96vYxhBIe AySSD5wWHTbjEjad6np/EgXQas9PpcEaYu9nMDPSJQVodF9lGZhYTCC6atgudkIOS1x7 wMOq4qEb2Z0jcv8Vt3eMQu0jIegVd6DPSJRnLJZjY16zBJDC28nOV1CLiKJOSIl3BLeW z0iqpKTz1tuBD5pUhRuaCyGgoEnZ7tXEoiEf1Z9XkD9im5/w+4yZ8K4NMJ0CpwyCyZy2 pYuBrBe2aAOamlnpYdAxM44Wq7Gar7g6zcfkRd/NCsUClMYZXHTJgfUS4xUkMdZPPykj B8mg== 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=3gkrzcL+bQJLSmJP+aial4ipGA5IQokGrTpYMGlW2j4=; fh=OI0WAz7NXBlFeTGG0os1uar7EYx38cujfJMOsIZWiZ4=; b=k2GNX0uEtGkW4KYNJqH+LixRo5/jXELRcvviweIik2au1jtZXaEbloYYRczIaf6yrt pOl9R1iMaC60Mf+1HOLOGnF8BqQ9sfpGEnvIzh1KnOSITsOUaV0D0I2NRQpIrsH5FvZx OL92GfER966APnLz5vx3FG6SoeLnwpPJ/bYAjjkcA7W8vsotaoa2QGKLWJD0bpPdclB9 DeE/jZ3vJFO6ZjVxKQcCxywjFx0EhfynJdMOUzU00aEi/PT+thMR5LL3aU2MZfmRRoc9 SLpeJfllYAJMLu+Z34f4g0O9WcUskHIjqt8cjpVtzpP0rLFdJyORuv0HQRcIK1H7G3IQ qmyQ==; 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-156945-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156945-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a62-20020a639041000000b005fd8d05cc4asi6418186pge.881.2024.04.24.06.19.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 06:19:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156945-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::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-156945-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156945-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 24BF128376A for ; Wed, 24 Apr 2024 13:19:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DABCF15CD66; Wed, 24 Apr 2024 13:19:38 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D1A515B546; Wed, 24 Apr 2024 13:19:35 +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=1713964778; cv=none; b=B0dQrL9uwM7BwBtbqJuaGU0O5QvjEdWxJRrgsWdWJFjKJfNoOA1GaYH+e27mVLf0WY0jKhLoLb77IoWdNTbFGzzwrrztF72lVd/jjYziU1M2NO1HNnniJ3yYVeIIWSt+W51Ogn5+mkZd7bkNCr1SvIYIp48DRXKov+rea254YTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713964778; c=relaxed/simple; bh=ra/7jHys5HrzBtDMjN1d+lExD93krBdyqnbBb71Q7v4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DwUwc3Fc0TB1TWjXIhHO7n4N6dhkruuZrxKc0cXsOHXQzMT7kjJ4RvMpNfUc4ruaQx/eloxiVnJS3hXKT1OopH6Pwn3A20iqtwYrUtkCEDIiBMiYILXpjuBfmkCoHJDCSoCh+Oy/5SW58TL6xMlDlBVFiZmshbBSit0cbxWT2jk= 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 438422F; Wed, 24 Apr 2024 06:20:02 -0700 (PDT) Received: from [10.57.86.198] (unknown [10.57.86.198]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2932E3F64C; Wed, 24 Apr 2024 06:19:32 -0700 (PDT) Message-ID: <87ac462c-c453-4f3a-9b0e-5542727578aa@arm.com> Date: Wed, 24 Apr 2024 14:19:30 +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 14/14] virt: arm-cca-guest: TSM_REPORT support for realms Content-Language: en-GB To: Steven Price , kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Sami Mujawar , 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 References: <20240412084056.1733704-1-steven.price@arm.com> <20240412084213.1733764-1-steven.price@arm.com> <20240412084213.1733764-15-steven.price@arm.com> From: Suzuki K Poulose In-Reply-To: <20240412084213.1733764-15-steven.price@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/04/2024 09:42, Steven Price wrote: > From: Sami Mujawar > > Introduce an arm-cca-guest driver that registers with > the configfs-tsm module to provide user interfaces for > retrieving an attestation token. > > When a new report is requested the arm-cca-guest driver > invokes the appropriate RSI interfaces to query an > attestation token. > > The steps to retrieve an attestation token are as follows: > 1. Mount the configfs filesystem if not already mounted > mount -t configfs none /sys/kernel/config > 2. Generate an attestation token > report=/sys/kernel/config/tsm/report/report0 > mkdir $report > dd if=/dev/urandom bs=64 count=1 > $report/inblob > hexdump -C $report/outblob > rmdir $report > > Signed-off-by: Sami Mujawar > Signed-off-by: Suzuki K Poulose > Signed-off-by: Steven Price > --- > drivers/virt/coco/Kconfig | 2 + > drivers/virt/coco/Makefile | 1 + > drivers/virt/coco/arm-cca-guest/Kconfig | 11 + > drivers/virt/coco/arm-cca-guest/Makefile | 2 + > .../virt/coco/arm-cca-guest/arm-cca-guest.c | 208 ++++++++++++++++++ > 5 files changed, 224 insertions(+) > create mode 100644 drivers/virt/coco/arm-cca-guest/Kconfig > create mode 100644 drivers/virt/coco/arm-cca-guest/Makefile > create mode 100644 drivers/virt/coco/arm-cca-guest/arm-cca-guest.c > > diff --git a/drivers/virt/coco/Kconfig b/drivers/virt/coco/Kconfig > index 87d142c1f932..4fb69804b622 100644 > --- a/drivers/virt/coco/Kconfig > +++ b/drivers/virt/coco/Kconfig > @@ -12,3 +12,5 @@ source "drivers/virt/coco/efi_secret/Kconfig" > source "drivers/virt/coco/sev-guest/Kconfig" > > source "drivers/virt/coco/tdx-guest/Kconfig" > + > +source "drivers/virt/coco/arm-cca-guest/Kconfig" > diff --git a/drivers/virt/coco/Makefile b/drivers/virt/coco/Makefile > index 18c1aba5edb7..a6228a1bf992 100644 > --- a/drivers/virt/coco/Makefile > +++ b/drivers/virt/coco/Makefile > @@ -6,3 +6,4 @@ obj-$(CONFIG_TSM_REPORTS) += tsm.o > obj-$(CONFIG_EFI_SECRET) += efi_secret/ > obj-$(CONFIG_SEV_GUEST) += sev-guest/ > obj-$(CONFIG_INTEL_TDX_GUEST) += tdx-guest/ > +obj-$(CONFIG_ARM_CCA_GUEST) += arm-cca-guest/ > diff --git a/drivers/virt/coco/arm-cca-guest/Kconfig b/drivers/virt/coco/arm-cca-guest/Kconfig > new file mode 100644 > index 000000000000..c4039c10dce2 > --- /dev/null > +++ b/drivers/virt/coco/arm-cca-guest/Kconfig > @@ -0,0 +1,11 @@ > +config ARM_CCA_GUEST > + tristate "Arm CCA Guest driver" > + depends on ARM64 > + default m > + select TSM_REPORTS > + help > + The driver provides userspace interface to request and > + attestation report from the Realm Management Monitor(RMM). > + > + If you choose 'M' here, this module will be called > + realm-guest. This needs to be updated to arm-cca-guest. Suzuki