From: Stefan Berger <stefanb@linux.ibm.com>
To: Arun Menon <armenon@redhat.com>
Cc: qemu-devel@nongnu.org, "Ani Sinha" <anisinha@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
marcandre.lureau@redhat.com, "Fabiano Rosas" <farosas@suse.de>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Yanan Wang" <wangyanan55@huawei.com>
Subject: Re: [RFC v2 7/7] hw/tpm: Increase TPM TIS max buffer size to 8192
Date: Wed, 1 Apr 2026 10:05:19 -0400 [thread overview]
Message-ID: <2a137ad7-1033-446c-895d-0f91b3acba23@linux.ibm.com> (raw)
In-Reply-To: <90bb955a-c951-4bf0-a77f-084096f12423@linux.ibm.com>
On 4/1/26 9:43 AM, Stefan Berger wrote:
>
>
> On 4/1/26 1:44 AM, Arun Menon wrote:
>> Hi Stefan,
>>
>> Thank you for looking into this and providing with the additional
>> patches to handle TIS interface.
>>
>> On Tue, Mar 31, 2026 at 03:31:43PM -0400, Stefan Berger wrote:
>>>
>>>
>>> On 3/20/26 2:57 PM, Stefan Berger wrote:
>>>>
>>>>
>>>> On 3/19/26 9:53 AM, Arun Menon wrote:
>>>>> - Double the size from 4096 to 8192 so that we can have bigger buffer
>>>>> enabling support for PQC algorithms in the TPM TIS interface.
>>>>> - v185 of TCG TPM rolls out PQC algorithm support. [1]
>>>>>
>>>>> [1] section 46 https://members.trustedcomputinggroup.org/wg/TCG/
>>>>> document/previewpdf/45151
>>>>>
>>>>> Signed-off-by: Arun Menon <armenon@redhat.com>
>>>>> ---
>>>>> hw/tpm/tpm_tis.h | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/hw/tpm/tpm_tis.h b/hw/tpm/tpm_tis.h
>>>>> index 184632ff66..0df35d5a54 100644
>>>>> --- a/hw/tpm/tpm_tis.h
>>>>> +++ b/hw/tpm/tpm_tis.h
>>>>> @@ -33,7 +33,7 @@
>>>>> #define TPM_TIS_IS_VALID_LOCTY(x) ((x) < TPM_TIS_NUM_LOCALITIES)
>>>>> -#define TPM_TIS_BUFFER_MAX 4096
>>>>> +#define TPM_TIS_BUFFER_MAX 8192
>>>>
>>>> Unfortunately TIS uses a fixed-size buffer that would now become
>>>> bigger:
>>>>
>>>> typedef struct TPMState {
>>>> MemoryRegion mmio;
>>>>
>>>> unsigned char buffer[TPM_TIS_BUFFER_MAX]; <-- now 8192;
>>>> before 4096
>>>>
>>>>
>>>> static const VMStateDescription vmstate_tpm_tis_isa = {
>>>> .name = "tpm-tis",
>>>> .version_id = 0,
>>>> .pre_save = tpm_tis_pre_save_isa,
>>>> .fields = (const VMStateField[]) {
>>>> VMSTATE_BUFFER(state.buffer, TPMStateISA), <-- now 8192;
>>>> before 4096
>>>
>>> This will have to become VMSTATE_PARTIAL_BUFFER and the rest is saved
>>> with
>>> VMSTATE_BUFFER_START_MIDDLE if necessary.
>>>
>>>> VMSTATE_UINT16(state.rw_offset, TPMStateISA),
>>>>
>>>> Problem would be if an older version of the TIS (with size 4096) then
>>>> receives this 8192 buffer, we would (probably) get a buffer overflow.
>>>
>>> I created 2 more patches for the TIS. It's now also in my branch here:
>>>
>>> https://github.com/stefanberger/qemu-tpm/commits/crb-chunking/
>>
>> Looks good to me.
>>
>>>
>>> Both TIS and CRB can now transfer >4096 bytes packets.
>>>
>>>>
>>>>
>>>>
>>>>> typedef enum {
>>>>> TPM_TIS_STATE_IDLE = 0,
>>>>
>>>>
>>>
>>
>> Is it okay if I incorporate your commits, including the tests and
>> profile enabling support into my next revision of this series?
>
> Yes, that's okay. Unfortunately the test will not work for most people
> right now. The default-v2 profile is available via swtpm in git master
> but it doesn't support ML-DSA since libtpms code with PQC is not public,
> yet...
I added a 2nd search criterion for the profile content to check whether
'ml-dsa' is supported. Fixed the style mistakes. Pushed. You can take
them from there now.
>
>>
>>
>>
>> Regards,
>> Arun Menon
>>
>
>
prev parent reply other threads:[~2026-04-01 14:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 13:53 [RFC v2 0/7] hw/tpm: CRB chunking capability to handle PQC Arun Menon
2026-03-19 13:53 ` [RFC v2 1/7] hw/tpm: Add TPM CRB chunking fields Arun Menon
2026-03-19 13:53 ` [RFC v2 2/7] hw/tpm: Refactor CRB_CTRL_START register access Arun Menon
2026-03-19 13:53 ` [RFC v2 3/7] hw/tpm: Add internal buffer state for chunking Arun Menon
2026-03-26 11:27 ` marcandre.lureau
2026-03-19 13:53 ` [RFC v2 4/7] hw/tpm: Implement TPM CRB chunking logic Arun Menon
2026-03-26 11:27 ` marcandre.lureau
2026-03-31 17:07 ` Arun Menon
2026-03-19 13:53 ` [RFC v2 5/7] test/qtest: Add test for tpm crb chunking Arun Menon
2026-03-26 11:27 ` marcandre.lureau
2026-03-26 11:32 ` Marc-André Lureau
2026-03-27 22:10 ` Stefan Berger
2026-03-19 13:53 ` [RFC v2 6/7] hw/tpm: Add support for VM migration with TPM CRB chunking Arun Menon
2026-03-26 11:27 ` marcandre.lureau
2026-04-02 15:22 ` Arun Menon
2026-03-19 13:53 ` [RFC v2 7/7] hw/tpm: Increase TPM TIS max buffer size to 8192 Arun Menon
2026-03-20 18:57 ` Stefan Berger
2026-03-31 19:31 ` Stefan Berger
2026-04-01 5:44 ` Arun Menon
2026-04-01 13:43 ` Stefan Berger
2026-04-01 14:05 ` Stefan Berger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a137ad7-1033-446c-895d-0f91b3acba23@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=anisinha@redhat.com \
--cc=armenon@redhat.com \
--cc=farosas@suse.de \
--cc=imammedo@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
--cc=wangyanan55@huawei.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.