GithubHelp home page GithubHelp logo

NV_MEMORY_SIZE about ms-tpm-20-ref HOT 2 CLOSED

microsoft avatar microsoft commented on July 4, 2024
NV_MEMORY_SIZE

from ms-tpm-20-ref.

Comments (2)

railabouni avatar railabouni commented on July 4, 2024 1

Thank you for the detailed response @BradL-Msft! greatly appreciated :)

from ms-tpm-20-ref.

bradlitterell avatar bradlitterell commented on July 4, 2024

TL;DR; 16kB was a convenient size for the reference code to use for example.

Long Answer:
The Reference code handling of NV data is very implementation specific. A separate implementation could choose to do things differently. Thus NV_MEMORY_SIZE is also implementation specific. Specifically, the reference code stores all NV data within this single large NV area, though that isn't required. For example, a specific implementation could store different index types in separate storage, subject to the minimums for other capabilities. E.g. TPM_PT_NV_COUNTERS_MAX has a minimum of 6 counters in the PC Platform spec, but a non-PC TPM could do something yet different. And even a PC implementation could create a new NV_COUNTER_MEMORY_SIZE definition of physical space solely for counters. It's not required that a TPM use the reference code in its implementation, so an implementation could store those counters in a separate NV region if it chose to.

Since the reference code stores everything within the same 16kB region reflected in NV_MEMORY_SIZE, there is a lot of additional "overhead" beyond the data called out in Section 4.5.1 Table 4. See 4.5.1 "Note: The sizes indicated in the table are the maximum size of the data area only and do not address the overhead. TPM vendors need to account for the overhead." In particular, Table 4 doesn't account for the various global data objects in the reference code, or does it account for TPM_PT_HR_PERSISTENT_MIN. These require a fair-sized block of NV space. Note also that the actual number of bytes required to support TPM_PT_HR_PERSISTENT_MIN == 7 (Section 4.1 Table 1) depends on the list of enabled algorithms. E.g. enabling RSA4k vs RSA2k will increase the number of required bytes for the same number of persistent objects. This is why the PC Platform spec doesn't specify bytes directly, but rather defines requirements in terms of capabilities.

Thus, an implementation can tweak NV_MEMORY_SIZE to fit its needs or do something differently. 16KB is a reasonable size for a minimal implementation using the reference code's NV storage strategy (everything in a big bucket), consistent with the PC platform spec while leaving a reasonable amount of space available for application use.

The official requirements for any given implementation are based on the specific requirements in the platform specs, which based on enabled options will result in an implementation-specific byte count.

from ms-tpm-20-ref.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.