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 DA545374E4E for ; Mon, 18 May 2026 15:17:35 +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=1779117458; cv=none; b=RWUfqAhnShLijkHWUIbxZrIQJmpxJ9ADs/9odKgel4QRBv/8kEEKQrns+KuLb3MAyAhclqDT03FEje0UlBmXhBdttrooi5T86L2rm2L/fxKwqju+AN+RMASEIZ+9OKvkCuFuFA+D6d1qpWUWyONjLbDL/1ZOopP1FRz4PnuMFZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779117458; c=relaxed/simple; bh=XmotWqTzaBwjT4mG51oc8AMNQBgqW8+YP3N76ZYRhs0=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=W1FjFd57P3qEOKzaCnaUecqkiw8ReS7PgvGyl+1U7NiqvsXGKBYUIx5xg7ZlFvKqycx9ctZMJNSnAfMGQtMKFIS0dGiHuqD8AtlYBNGDoqC/qb6EZmyIREhq+/pkzy12IazqnOZPNFFF1dvECVzW/xhT5AuWMriAaHcFwKg7YLU= 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=LUw+QQDV; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Zol8llln; 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="LUw+QQDV"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Zol8llln" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779117455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EUOqhEXYSCFrJQVtrLFbBts5i90fpDqStr0HkixbP94=; b=LUw+QQDVn5lkfziwTkU+M1N/Gl/BqgHqiD+p1LeWrgnZESGqgo7jLK6e+Zw3YBxnrHWrSu 651O6+ZDdwowBon3sZbL+/BrsNdeK6BzUI8/r/Q+zvijZCiBqad+AApgRlEop0l0/2gSTG 8Wc7yYhgswyZS5VgPu3AAHd4opfyfs4= 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-486-8AAtVwqgMAiod5U6IW93hQ-1; Mon, 18 May 2026 11:17:33 -0400 X-MC-Unique: 8AAtVwqgMAiod5U6IW93hQ-1 X-Mimecast-MFC-AGG-ID: 8AAtVwqgMAiod5U6IW93hQ_1779117453 Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-836cfd84728so1164164b3a.0 for ; Mon, 18 May 2026 08:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1779117452; x=1779722252; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=EUOqhEXYSCFrJQVtrLFbBts5i90fpDqStr0HkixbP94=; b=Zol8lllnOQz8DGhbEC5d6NptEFwEIs1UCfbmRIlRNEWz1JGVopE6VidyrQIpV500T3 IrBZdRG8WswoMLO8wwRn//GHKq7vhK/3+v9aFAjql8NUm6Ipv0AelEVpRX3Id+x8XPca paf5M+mL835wL9s2FZ7JSRowx2drR43rAMPQOzi/SPDCE+6Qjs9Qyo0In33df/I4l2lG YWnfDiq2krttrr2qPNZVXxi8F+7IsduQ2smsP4ihGcMOxhgHvhZSbfE48dOeK8zQNeO/ JqCHI/rGMZRiC0v2Mm8OTYysI+eh4KnCi/bATRW9eAMaP+bhFMbctwo/VcB5SLaCdscc ZUTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779117452; x=1779722252; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EUOqhEXYSCFrJQVtrLFbBts5i90fpDqStr0HkixbP94=; b=FxweZoMy+v8wDM0eznS2mxWRCda3KC3Wx/npiugJu77QXku+Ktlmbekw8iNRUS19xm vzUJvgqx/HB3l2Wc85EL6Nd0rc6Q5RKprCSUeiz6FYfQnqz+WExPs8oWwwzWVG64WKfn mahXccrmVq2ibkoeeuHGL+uDu974rA14T9bZOxX138nX8ncOajXFUQ7+a0Jzi10bXcW/ zK+Bp2won+qV6myhaTJgGWuchkfPUCt4DEttEoFDFgR9YlReCliwmrV+mwhqo1tqdquH zjjF+T0ZxahbR3qb4dQ5g3ADcWOwcRvdG9GcfWUwfCSB1qut5B76Z7qTh1I9XZhK3/uI A0ow== X-Gm-Message-State: AOJu0YzTyOJ1fXi8LrJL/ua9IgZXOwhgHIPHTV+KtI+OL/VBzZS+SA2T 6FioYi45k8kJv9qpoFGZvU1fHnBNhE4FBFRzO/B/0DnLfbmUhII3TAZ4FG9THp3N0G5YfWj3iq2 Iu9p4atqZCS1l1eRrdPse5zTdyaXi7R+cjkgyeIqeOr1qhFFuDGIz8FxUVlhQsnZFV5adOejzfx vdpPjDDKyEth10taaSd6CAtt4zud2fhMflghaIIB81kG/PWAe2 X-Gm-Gg: Acq92OFyPgMc9KSrvo7WYVPGJUxTXL6U2aeF1mkWIrwx1pTC/GsbCGutKaotNpDo1bc CaElYmgZPAJn5FHDLpiIYTl42NcS9pGKZNnjiUTITh58CgRPi2ayAqWGzRVtnMpUubiqJ+ysd6/ 8+wvqS3fwPoX857QBCkgTToXtIrOfa+iTFkBk7AdhSIhiJtAyOT0fSJ5QlKZm0Tu5Z6nP98RN4p +0YhZUw3yiqWZzMYGo0J9vnkSJlNCC3aKdwSmG6hjn2wtWPyKsofe4o5aXzv0sSLdbR0rUBMmZx xoPjIhldzR148uVNbaPXxglRet5qSCtW15IwoTHST2/dICo56z1rIcW7QGGF9itOqvf2KQraTJV o+n3GurJwegMXf67lNVYBHGBhmuSZsFYZUpo+egGKusgcJxVZqGcACOqPrkQ+78NKB+Y03v0SgQ == X-Received: by 2002:a05:6a00:1406:b0:837:42a6:58a2 with SMTP id d2e1a72fcca58-83f18ef9d1fmr16583395b3a.35.1779117452054; Mon, 18 May 2026 08:17:32 -0700 (PDT) X-Received: by 2002:a05:6a00:1406:b0:837:42a6:58a2 with SMTP id d2e1a72fcca58-83f18ef9d1fmr16583337b3a.35.1779117451185; Mon, 18 May 2026 08:17:31 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2026 08:17:30 -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 0/6] tpm_crb: Add command and response buffer chunking support Date: Mon, 18 May 2026 20:47:18 +0530 Message-ID: <20260518151724.730443-1-armenon@redhat.com> X-Mailer: git-send-email 2.54.0 Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The new version of TCG TPM v185 [1] supports sending data/commands in chunks for the CRB (Command Response Buffer) interface. This is in line with the initiative to support PQC algorithms. This series implements the logic to send and receive larger TPM cmd/rsp between the linux guest and the TPM backend in chunks. Currently, the TPM CRB driver is limited by the physical size of the MMIO window. When userspace attempts to send a payload that exceeds this size, the driver rejects it. This series introduces chunking support. The driver now checks the CRB interface capability for CRB_INTF_CAP_CRB_CHUNK. If supported by the backend, the driver will slice oversized commands into MMIO-sized chunks, signalling the backend via CRB_START_NEXT_CHUNK, and finalizing with CRB_START_INVOKE. Responses are also read back in a similar chunked manner. If the backend does not support chunking, the driver retains its legacy behaviour and enforces the standard size limits. This feature also requires the QEMU to interpret the data in chunks and forward it to the TPM backend and subsequently dispatch the TPM response in chunks back to the linux guest. This is implemented in [2] This series depends on Jarkko's unmerged patch from the mailing list: [PATCH v9 11/11] tpm-buf: Implement managed allocations. Depends-on: The whole series applied on top of for-next-tpm branch (with prerequisite) can be found here: https://github.com/armenon-rh/linux/tree/tpm-crb-linux [1] https://trustedcomputinggroup.org/wp-content/uploads/PC-Client-Specific-Platform-TPM-Profile-for-TPM-2p0-v1p07_Pub.pdf [2] https://lore.kernel.org/qemu-devel/20260506075813.120781-1-armenon@redhat.com/ v3 -- - Split patch 2, so that the code is cleaner. - Re-order the buffer size adjustment patch. - Rename crb_trigger_tpm to tpm_crb_start. - Add dispatching logic in send and recv functions. Chunking is separated from no-chunking for clarity. - Increase TPM_BUFSIZE in the common file include/linux/tpm.h following, [PATCH v9 11/11] tpm-buf: Implement managed allocations https://lore.kernel.org/linux-integrity/20260125192526.782202-12-jarkko@kernel.org/ v2 -- - Add size checks before copying memory. - Update TPM_BUFSIZE to 8KB. - Commit messages updated to indicate motivation and logic of the change. Arun Menon (6): tpm_crb: Add register definitions of TPM CRB chunking fields tpm_crb: Split start method into a separate header tpm_crb: Add start_cmd parameter to tpm_crb_start wrapper tpm: tis_i2c: Use local 4KB buffer to limit memory usage tpm: Increase TPM_BUFSIZE to 8kB for chunking support tpm_crb: Implement command and response chunking logic drivers/char/tpm/tpm_crb.c | 257 +++++++++++++++++++++++++-------- drivers/char/tpm/tpm_tis_i2c.c | 6 +- include/linux/tpm.h | 2 +- 3 files changed, 204 insertions(+), 61 deletions(-) -- 2.54.0