How to delete the TPM NV index in UEFI?


Hi everyone,
I want to find a way to delete the TPM NV index that I was provisioned before. I have found a function Tpm2NvUndefineSpaceSpecial() on EDK2 open source but I still don't know how to execute it.
This function has two arguments: IndexAuthSession and PlatAuthSession, they are optional, but when I set them to NULL, the received result is Device Error.
I have found this function in
I would like how to execute this function to delete the TPM NV index.

Dang Luu


Hi Dang Luu,

I think you can check the TPM specification in the section NV Index Deletion 37.2.3 ( Maybe, you can use the function TPM2_NV_UndefineSpace instead of TPM2_NV_UndefineSpaceSpecial().

Could you please share with us how you define the NV index? Because, depending on the parameters used, this can impact the way of undefining.

Best Regards,
Renan Moraes


Hi Renan Moraes,

After doing some research, I found that undefining the NV index is necessary so I no longer use this function.
Thank you for your help.

Best Regards,
Dang Luu.