From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A405375F81 for ; Mon, 18 May 2026 15:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779117462; cv=none; b=Ida843a1aswnfqQ3VR6HZc51ZzqrhoGCu1deEejQgkAnSjr3PqZAAqnoWY5eY9SrQBr1byFmvNsXyYnZzv1ReWF8hqrjkM0AqNm82exhwL8EIAdKJBQgUFSJUC+UOCA1X+q4hDgS51AerR1C2AVh3oeItke3ceI618am/UjXDDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779117462; c=relaxed/simple; bh=X6H9YMI/G5UD7SgY0WhWwEquiNvZiLCynZ0Ng09icf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cAHZNcPs4bBOco/5Q3b5iBvG5Hkpy+V7JprGvQ4TnRVO/U8GbuhltdzkhLBPNs3CMx6744OZY2ynlG0gbVAmdfueNiSR4RCJRK2VOkNylTCDPCRNohRSJzECy1ibQGUu/XNXbGjl8KKdq1rpyoMxWRJzqvGNMIXXp1q8FoaLr4Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Xnbh+kV8; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=oJ/toitM; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Xnbh+kV8"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="oJ/toitM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779117459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jtzC8GOmAvHT3XfNpHE4tG+IxT92XswAdGYofHiX++Q=; b=Xnbh+kV8IpLdPr8QStOHpyllC8mAfj5ZOLYWBnfvBudPgxMe7kbougBeYXkO5HxXTLjOGz VeW/2uzI3TCfc9VQZeU6B6rz9pgysdFHtHeUuWpwxeHdIKEspcRQfvY2+7CijtOt/EHQb2 LJcPNY3p3m5gdR56xxZW0GoX7s9cQR0= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-hWgdhRiNN-SAHePJL2MFsA-1; Mon, 18 May 2026 11:17:38 -0400 X-MC-Unique: hWgdhRiNN-SAHePJL2MFsA-1 X-Mimecast-MFC-AGG-ID: hWgdhRiNN-SAHePJL2MFsA_1779117457 Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-82fa6c3a77cso1335044b3a.3 for ; Mon, 18 May 2026 08:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1779117456; x=1779722256; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jtzC8GOmAvHT3XfNpHE4tG+IxT92XswAdGYofHiX++Q=; b=oJ/toitMClugy/eelXYgGKrBfPskR2J5S08VH4f4H75GaH2w0eiwDreTSSsHn6XK7F rt2kIo05CUlhu0j0MF4xFdyW+O3Wq4uxkf5YMgvuISOl7zVvnlIhXqUbXsGgXcZbM6vy EgJkx8dk0DnpZgFnnorWAlHJA6TNgE2PLrkfvCyiqri7lhdmwLE9jgiNST6gl5uR87gv ulozZ3oOBD+gIU9VVfpJXBByXOkPYafbZTVV9o8sHv2nV9QqIdSFT9oPBplD9O8Om2MK AGxvvEou2B43fal7Opu11B47egANWPa2nKwz84PHm309NLUo5L4Dd0stX3B1XdPWI4vb bQRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779117456; x=1779722256; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jtzC8GOmAvHT3XfNpHE4tG+IxT92XswAdGYofHiX++Q=; b=YkvWsFVVLhEkkoeUdi4BCLt5qs/9sIaokLLyyMbDY0uk5bnoa6P9EzFM7FPHuX6zGa l53aqO0W8tQNyalu5Jy8Tls0ZsIS5FCjUOlrpPPAlP1DVecW3/ile6oltfmEhuitSJ0g 3GpPq75zJDsAq37yrh+wJR3XqGgqSONHMuqhwH4sOr/OSt7zh0aBtla1BVe0fgqO4bTN dSg1ISougSGSoDc4DT2QyiNhIOGek2CWrvhqO1d65LTByOrz8qseG5SguZdB0WahlwZx LlOa4ZmajMnpMwApS2hmKaPc+2YY2j6/P+1YXk7GBvANz7jc+TuWp7roXqT14HE3HVWQ xmuA== X-Gm-Message-State: AOJu0YzJFWaiBSdloJiQdcH3FFWfctmToxxCEeBA/QH8+o4nvylhGjEy +VFjZWbRrUg6VEWnD3AzlKz3+NTlx9ik37A04DByAhPRiwiQoP5KQbgP2eet36joPMa2Q3jwKM/ IsI5UpiKQpTdCJAw2fJYbWvQImziiiBZBIZH9yhBsp7QTJqDrKdOWs2oOtS6S8KTsCKQjFOt5L1 05DVA8s7l8XCZoUg2MV7kU9EsxFafpwb2j8tgfMreH9/I6AvaA X-Gm-Gg: Acq92OHzABXd1u+mlF5y0P7N/bniZg+ujXenSuV37IYkQggvCdubPjBfOLMRd7H21sT GuaPm//pLb11+eFP3ordD1IhdcDuSEDkYFTxsHOE600Iz6g7lasCuDA3RMfJ/XDhyko6NzCCPoP XhduiDJD1oZxPmyWmZymKoyanRctyaZjSmZW5XBpV5av0+pup4XMXzbNTFWzHUxC2+Z36SCuKlu /ldyAWQVuaqeP4Va4IsC4DMvSKWhmwF7Hr1YHD7erFtTGZhyocNfRLF0MyQFdpI87STe7Z1RArK X6x9Z2iRHoJoPAAlCAmhG/VgqRfTuqVzjPmuwHkdIxjZSn5k1jgAsRC84IuyoQkd4u9i7Q1myOA jTFvUsVMpuLELniIhk9bfKa7WV+Y9kG0rYbS51pPmJ0Y2FC/zxulfr8Tsl/g9VRctgOZflvYA6A == X-Received: by 2002:a05:6a00:3907:b0:82d:556b:7a01 with SMTP id d2e1a72fcca58-83f33c25b5bmr16219911b3a.16.1779117456439; Mon, 18 May 2026 08:17:36 -0700 (PDT) X-Received: by 2002:a05:6a00:3907:b0:82d:556b:7a01 with SMTP id d2e1a72fcca58-83f33c25b5bmr16219874b3a.16.1779117455840; Mon, 18 May 2026 08:17:35 -0700 (PDT) Received: from fedora.armenon-thinkpadp16vgen1.bengluru.csb ([49.36.104.172]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83f197815cesm18181153b3a.24.2026.05.18.08.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2026 08:17:35 -0700 (PDT) From: Arun Menon To: linux-kernel@vger.kernel.org Cc: Jarkko Sakkinen , linux-integrity@vger.kernel.org, Jason Gunthorpe , Peter Huewe , Arun Menon Subject: [PATCH v3 1/6] tpm_crb: Add register definitions of TPM CRB chunking fields Date: Mon, 18 May 2026 20:47:19 +0530 Message-ID: <20260518151724.730443-2-armenon@redhat.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260518151724.730443-1-armenon@redhat.com> References: <20260518151724.730443-1-armenon@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arun Menon Post-quantum cryptographic (PQC) algorithms can require buffer sizes that exceed the physical capacity of the TPM's Command/Response Buffer (CRB). To support these larger payloads, the TPM 2.0 CRB specification [1] allows for data chunking when the physical MMIO window is smaller than the required buffer size. To support this protocol, the TPM driver must be able to detect the chunking capability, and signal the backend using specific start method flags, also known as the control area start register bits. As per sections 6.4.2.2 and 6.5.3.9 of the specification document [1] Add 2 new bit flags to the existing enum crb_start and add the capability bit. - CRB_INTF_CAP_CRB_CHUNK: A capability bit used to detect if the backend supports chunking. - CRB_START_NEXT_CHUNK: A control bit to signal the TPM to consume the current command buffer, or to get the next chunk from the response buffer. - CRB_START_RESP_RETRY: A control bit to signal retransmission of a response buffer. [1] https://trustedcomputinggroup.org/wp-content/uploads/PC-Client-Specific-Platform-TPM-Profile-for-TPM-2p0-v1p07_rc1_121225.pdf Signed-off-by: Arun Menon Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_crb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index ceb4100ba400..d76f9e30f036 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c @@ -57,12 +57,18 @@ enum crb_ctrl_sts { enum crb_start { CRB_START_INVOKE = BIT(0), + CRB_START_RESP_RETRY = BIT(1), + CRB_START_NEXT_CHUNK = BIT(2), }; enum crb_cancel { CRB_CANCEL_INVOKE = BIT(0), }; +enum crb_intf { + CRB_INTF_CAP_CRB_CHUNK = BIT(10), +}; + struct crb_regs_head { u32 loc_state; u32 reserved1; -- 2.54.0