Skip to content

Commit 5603ffe

Browse files
Merge pull request #121 from NVIDIA/release/v2.6.3
Blackwell MPT changes
2 parents 11d8c96 + e1741a6 commit 5603ffe

33 files changed

+534
-1724
lines changed

CONTRIBUTE.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Contributing to NVTrust
2+
3+
Thank you for your interest in contributing to NVTrust! We welcome contributions from the community and are grateful for your support. Please take a moment to review this guide to understand how you can contribute to the project.
4+
5+
## How to Contribute
6+
7+
### Reporting Issues
8+
9+
If you encounter any bugs, have feature requests, or have questions, please open an issue on GitHub. When reporting issues, please provide as much detail as possible to help us understand and resolve the problem quickly.
10+
11+
1. Go to the [Issues](https://github.com/NVIDIA/nvtrust/issues) page.
12+
2. Click on the "New Issue" button.
13+
3. Provide a clear and descriptive title.
14+
4. Describe the issue or feature request in detail, including steps to reproduce the issue if applicable.
15+
16+
### Submitting Pull Requests
17+
18+
We welcome pull requests for bug fixes, improvements, and new features. To submit a pull request:
19+
20+
1. Fork the repository on GitHub.
21+
2. Clone your fork to your local machine.
22+
3. Create a new branch for your changes:
23+
```bash
24+
git checkout -b my-feature-branch
25+
```
26+
4. Make your changes and commit them with clear and concise messages.
27+
5. Push your changes to your forked repository:
28+
```bash
29+
git push origin my-feature-branch
30+
```
31+
6. Open a pull request on the original repository. Provide a clear description of your changes and the problem they solve.
32+
33+
### Coding Guidelines
34+
35+
To ensure a smooth and consistent codebase, please follow these guidelines:
36+
37+
- Follow the existing code style.
38+
- Write clear, concise commit messages.
39+
- Include comments where necessary to explain the intent of the code.
40+
- Ensure your changes do not introduce new issues by running existing tests and adding new tests as needed.
41+
42+
### Code of Conduct
43+
44+
To ensure a positive and inclusive community, we adhere to the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/). By participating in this project, you agree to abide by its terms.
45+
46+
## Getting Started
47+
48+
To get started with development:
49+
50+
1. Clone the repository:
51+
```bash
52+
git clone https://github.com/NVIDIA/nvtrust.git
53+
```
54+
2. Navigate to the project directory:
55+
```bash
56+
cd nvtrust
57+
```
58+
3. Install the required dependencies (if applicable).
59+
60+
### Signing Your Work
61+
62+
* We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
63+
64+
* Any contribution which contains commits that are not Signed-Off will not be accepted.
65+
66+
* To sign off on a commit you simply use the `--signoff` (or `-s`) option when committing your changes:
67+
```bash
68+
$ git commit -s -m "Add cool feature."
69+
```
70+
This will append the following to your commit message:
71+
```
72+
Signed-off-by: Your Name <your@email.com>
73+
```
74+
75+
* Full text of the DCO:
76+
77+
```
78+
Developer Certificate of Origin
79+
Version 1.1
80+
81+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
82+
1 Letterman Drive
83+
Suite D4700
84+
San Francisco, CA, 94129
85+
86+
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
87+
```
88+
89+
```
90+
Developer's Certificate of Origin 1.1
91+
92+
By making a contribution to this project, I certify that:
93+
94+
(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
95+
96+
(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
97+
98+
(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
99+
100+
(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
101+
```
102+
103+
## Contact
104+
105+
If you have any questions or need further assistance, feel free to reach out by opening an issue or contacting the maintainers.
106+
107+
Thank you for contributing to NVTrust!
108+
109+
---

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ NVIDIA is at the forefront of confidential computing, collaborating with CPU par
2020

2121
For more information, including documentation, white papers, and videos regarding the Hopper Confidential Computing story, please visit [NVIDIA docs](https://docs.nvidia.com/confidential-computing/index.html).
2222

23+
## Contributing
24+
25+
We welcome contributions from the community. Please refer to our [CONTRIBUTE.md](CONTRIBUTE.md) file for guidelines on how to contribute to this project.
26+
2327
## License
2428

2529
This repository is licensed under Apache License v2.0 except where otherwise noted.
2630

2731
## Support
2832

29-
For issues or questions, please [file a bug](https://github.com/NVIDIA/nvtrust/issues). For additional support, contact us at [attestation-support@nvidia.com](mailto:attestation-support@nvidia.com)
33+
For issues or questions, please [file a bug](https://github.com/NVIDIA/nvtrust/issues). For additional support, contact us at [attestation-support@nvidia.com](mailto:attestation-support@nvidia.com)

guest_tools/attestation_sdk/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "nv-attestation-sdk"
3-
version = "2.6.2"
3+
version = "2.6.3"
44
description = "The Attestation SDK provides developers with a easy to use APIs for implementing attestation capabilities into their applications."
55
authors = ["Karthik Jayaraman <kjayaraman@nvidia.com>"]
66
readme = "README.md"
@@ -22,7 +22,7 @@ xmlschema = "==2.2.3"
2222
pyOpenSSL = "==24.2.1"
2323
PyJWT = "==2.7.0"
2424
nvidia-ml-py = ">=12.535.77"
25-
nv-local-gpu-verifier = "2.6.2"
25+
nv-local-gpu-verifier = "2.6.3"
2626
build = ">=0.7.0"
2727
twine = ">=3.7.1"
2828
pylint = ">=2.9.6"

guest_tools/gpu_verifiers/local_gpu_verifier/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "nv-local-gpu-verifier"
3-
version = "2.6.2"
3+
version = "2.6.3"
44
description = "A Python-based tool that validates GPU measurements by comparing GPU runtime measurements with authenticated golden measurements"
55
authors = [
66
{name = "NVIDIA"}

guest_tools/gpu_verifiers/local_gpu_verifier/src/verifier/attestation/spdm_msrt_resp_msg.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
MeasurementSpecificationError,
3535
ParsingError,
3636
)
37+
from verifier.config import BaseSettings
3738

3839

3940
class DmtfMeasurement:
@@ -361,6 +362,20 @@ def parse_switch_pdis(self, binary_data):
361362
self.OpaqueDataField["OPAQUE_FIELD_ID_SWITCH_PDI"].append(pdi)
362363
byte_index = byte_index + self.FieldSize['PdiDataSize']
363364

365+
def parse_feature_flag(self, binary_data):
366+
""" Parses the raw feature flag data and maps it to appropriate feature
367+
368+
Args:
369+
binary_data (bytes): the raw feature flag data
370+
"""
371+
feature_flag_map = {
372+
0 : "SPT",
373+
1 : "MPT",
374+
2 : "PPCIE"
375+
}
376+
value = int(read_field_as_little_endian(binary_data), 16)
377+
self.OpaqueDataField["OPAQUE_FIELD_ID_FEATURE_FLAG"] = feature_flag_map[value]
378+
364379
def parse_chip_info(self, binary_data):
365380
""" Parses the raw chip info data and extract the underlying chip name
366381
@@ -370,6 +385,16 @@ def parse_chip_info(self, binary_data):
370385
chip_info = binary_data.decode('utf-8').split('\x00')[0]
371386
self.OpaqueDataField["OPAQUE_FIELD_ID_CHIP_INFO"] = chip_info
372387

388+
def parse_opaque_data_version(self, binary_data):
389+
""" Parses the raw opaque data version data and extract the version number
390+
391+
Args:
392+
binary_data (bytes): the raw opaque data version data
393+
"""
394+
395+
value = int(read_field_as_little_endian(binary_data), 16)
396+
BaseSettings.CURRENT_OPAQUE_DATA_VERSION = value
397+
self.OpaqueDataField["OPAQUE_FIELD_ID_OPAQUE_DATA_VERSION"] = value
373398

374399
def parse(self, binary_data):
375400
""" Parses the raw OpaqueData field of the SPDM GET_MEASUREMENT response message.
@@ -380,9 +405,11 @@ def parse(self, binary_data):
380405
byte_index = 0
381406

382407
opaque_field_to_function_map = {
383-
"OPAQUE_FIELD_ID_MSRSCNT": self.parse_measurement_count,
384-
"OPAQUE_FIELD_ID_SWITCH_PDI": self.parse_switch_pdis,
385-
"OPAQUE_FIELD_ID_CHIP_INFO": self.parse_chip_info
408+
"OPAQUE_FIELD_ID_MSRSCNT" : self.parse_measurement_count,
409+
"OPAQUE_FIELD_ID_SWITCH_PDI" : self.parse_switch_pdis,
410+
"OPAQUE_FIELD_ID_FEATURE_FLAG" : self.parse_feature_flag,
411+
"OPAQUE_FIELD_ID_CHIP_INFO" : self.parse_chip_info,
412+
"OPAQUE_FIELD_ID_OPAQUE_DATA_VERSION" : self.parse_opaque_data_version
386413
}
387414

388415
while byte_index < len(binary_data):

guest_tools/gpu_verifiers/local_gpu_verifier/src/verifier/cc_admin.py

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
# SPDX-License-Identifier: BSD-3-Clause
44
#
55
# Redistribution and use in source and binary forms, with or without
@@ -311,7 +311,8 @@ def attest(arguments_as_dictionary, nonce, gpu_evidence_list):
311311
overall_status = False
312312
gpu_claims_list = []
313313
att_report_nonce_hex = CcAdminUtils.validate_and_extract_nonce(nonce)
314-
314+
any_gpu_in_MPT_mode = False
315+
any_gpu_in_SPT_mode = False
315316

316317
try:
317318
BaseSettings.allow_hold_cert = arguments_as_dictionary['allow_hold_cert']
@@ -451,20 +452,26 @@ def attest(arguments_as_dictionary, nonce, gpu_evidence_list):
451452
if not arguments_as_dictionary['test_no_gpu']:
452453
info_log.info("\t\t\tFetching the driver RIM from the RIM service.")
453454
try:
454-
chip = attestation_report_obj.get_response_message().get_opaque_data().get_data(
455-
"OPAQUE_FIELD_ID_CHIP_INFO")
455+
# As OPAQUE_FIELD_ID_CHIP_INFO is supported from Blackwell+ chips,
456+
# assigning the chip name to be GH100 directly
457+
# For Blackwell+ chips, we derive it from the opaque data field
458+
if settings.GPU_ARCH_NAME == "HOPPER":
459+
chip = "GH100"
460+
else:
461+
chip = attestation_report_obj.get_response_message().get_opaque_data().get_data("OPAQUE_FIELD_ID_CHIP_INFO")
456462
driver_rim_file_id = CcAdminUtils.get_driver_rim_file_id(driver_version, settings, chip)
457463

458464
driver_rim_content = function_wrapper_with_timeout([CcAdminUtils.fetch_rim_file,
459-
driver_rim_file_id,
460-
'fetch_rim_file'],
461-
BaseSettings.MAX_NETWORK_TIME_DELAY)
465+
driver_rim_file_id,
466+
'fetch_rim_file'],
467+
BaseSettings.MAX_NETWORK_TIME_DELAY)
462468

463469
driver_rim = RIM(rim_name='driver', settings=settings, content=driver_rim_content)
464470
except Exception as error:
465471
info_log.error("Error occurred while fetching the driver RIM from the "
466472
"RIM service due to %s", error)
467473
raise RIMFetchError(f'Unable to fetch driver RIM from RIM service: {driver_rim_file_id}')
474+
468475
else:
469476
info_log.info("\t\t\tUsing the local driver rim file : " + settings.DRIVER_RIM_PATH)
470477
driver_rim = RIM(rim_name='driver', settings=settings, rim_path=settings.DRIVER_RIM_PATH)
@@ -486,6 +493,15 @@ def attest(arguments_as_dictionary, nonce, gpu_evidence_list):
486493
event_log.error("\t\t\tDriver RIM verification failed.")
487494
raise RIMVerificationFailureError("\t\t\tDriver RIM verification failed.\n\t\t\tQuitting now.")
488495

496+
# OPAQUE_DATA_VERSION 1 indicates the first version of the Feature Flag present in the OpaqueData field.
497+
if BaseSettings.CURRENT_OPAQUE_DATA_VERSION >= BaseSettings.MIN_OPAQUE_DATA_VERSION_TO_SUPPORT_FEATURE_FLAG:
498+
feature_flag = attestation_report_obj.get_response_message().get_opaque_data().get_data(
499+
"OPAQUE_FIELD_ID_FEATURE_FLAG")
500+
if feature_flag == "MPT":
501+
any_gpu_in_MPT_mode = True
502+
elif feature_flag == "SPT":
503+
any_gpu_in_SPT_mode = True
504+
489505
# performing the schema validation and signature verification of the vbios RIM.
490506
info_log.info("\t\tAuthenticating VBIOS RIM.")
491507
vbios_rim_path = settings.VBIOS_RIM_PATH
@@ -564,6 +580,12 @@ def attest(arguments_as_dictionary, nonce, gpu_evidence_list):
564580
# set current gpu_claims
565581
gpu_claims_list.append(ClaimsUtils.get_current_gpu_claims(settings, gpu_info_obj.get_uuid()))
566582

583+
# If any GPU is in MPT mode, then all GPUs should be in MPT mode.
584+
if any_gpu_in_MPT_mode and any_gpu_in_SPT_mode:
585+
overall_status = False
586+
event_log.error("Detected GPUs in both MPT and SPT modes. This configuration is not allowed.")
587+
588+
567589
except Exception as error:
568590
info_log.error(error)
569591
event_log.exception("GPU Attestation failed")

guest_tools/gpu_verifiers/local_gpu_verifier/src/verifier/config.py

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
# SPDX-License-Identifier: BSD-3-Clause
44
#
55
# Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,7 @@
5252
fhandler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s: %(message)s", '%m-%d-%Y %H:%M:%S'))
5353
event_log.addHandler(fhandler)
5454

55+
event_log.info(f'Verifier version: {__version__}')
5556
event_log.debug("----------STARTING----------")
5657

5758

@@ -92,6 +93,44 @@ class Status(Enum):
9293
RIM_ROOT_CERT = os.path.join(ROOT_CERT_DIR, 'verifier_RIM_root.pem')
9394
DEVICE_ROOT_CERT = os.path.join(ROOT_CERT_DIR, 'verifier_device_root.pem')
9495

96+
EXECUTION_SEQUENCE_INDEX = {
97+
'GPU_AVAILABILITY' : 0,
98+
'ATTESTATION_REPORT_AVAILABILITY' : 1,
99+
'GPU_INFO_FETCH' : 2,
100+
'CORRECT_GPU_ARCH' : 3,
101+
'ATTESTATION_REPORT_MSR_AVAILABILITY' : 4,
102+
'ATTESTATION_REPORT_PARSED' : 5,
103+
'ROOT_CERT_AVAILABILITY' : 6,
104+
'GPU_CERT_CHAIN_VERIFIED' : 7,
105+
'GPU_CERT_OCSP_CERT_CHAIN_VERIFICATION' : 8,
106+
'GPU_CERT_OCSP_SIGNATURE_VERIFICATION' : 9,
107+
'GPU_CERT_OCSP_NONCE_MATCH' : 10,
108+
'GPU_CERT_CHECK_COMPLETE' : 11,
109+
'NONCE_MATCH' : 12,
110+
'ATTESTATION_REPORT_DRV_VERSION_MATCH' : 13,
111+
'ATTESTATION_REPORT_VBIOS_VERSION_MATCH' : 14,
112+
'ATTESTATION_REPORT_VERIFICATION' : 15,
113+
'DRIVER_RIM_FETCH' : 16,
114+
'DRIVER_RIM_MEASUREMENT_AVAILABILITY' : 17,
115+
'DRIVER_RIM_SCHEMA_VALIDATION' : 18,
116+
'DRIVER_RIM_VERSION_MATCH' : 19,
117+
'DRIVER_RIM_CERT_EXTRACT' : 20,
118+
'DRIVER_RIM_SIGNATURE_VERIFICATION' : 21,
119+
'VBIOS_RIM_FETCH' : 22,
120+
'VBIOS_RIM_MEASUREMENT_AVAILABILITY' : 23,
121+
'VBIOS_RIM_SCHEMA_VALIDATION' : 24,
122+
'VBIOS_RIM_VERSION_MATCH' : 25,
123+
'VBIOS_RIM_CERT_EXTRACT' : 26,
124+
'VBIOS_RIM_SIGNATURE_VERIFICATION' : 27,
125+
'DRV_VBIOS_MSR_INDEX_CONFLICT' : 28,
126+
'MEASUREMENT_MATCH' : 29,
127+
}
128+
129+
CURRENT_OPAQUE_DATA_VERSION = 0
130+
LATEST_OPAQUE_DATA_VERSION = 1
131+
MIN_OPAQUE_DATA_VERSION_TO_SUPPORT_FEATURE_FLAG = 1
132+
MIN_OPAQUE_DATA_VERSION_TO_SUPPORT_CHIP_INFO = 1
133+
95134
@classmethod
96135
def set_ocsp_url(cls, url):
97136
if not isinstance(url, str):

guest_tools/gpu_verifiers/local_gpu_verifier/src/verifier/nvml/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def is_ppcie_mode_enabled():
147147
settings = NvmlSystemConfComputeSettings()
148148
state = function_wrapper_with_timeout([nvmlSystemGetConfComputeSettings, ctypes.byref(settings),
149149
"nvmlSystemGetConfComputeSettings"], BaseSettings.MAX_NVML_TIME_DELAY)
150-
return settings.multiGpuMode != 0
150+
return settings.multiGpuMode == 1
151151

152152
@staticmethod
153153
def is_cc_dev_mode():

guest_tools/ppcie-verifier/LICENSE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Python copyright:
8686
Open Source Software Licensed Under the MIT License:
8787
----------------------------------------------------
8888

89-
black, build, poetry, pytest, timeout-decorator, tomlkit, urllib3, wheel and setuptools are MIT licensed Python packages used in this project.
89+
black, build, poetry, pytest, timeout-decorator, tomlkit, urllib3, wheel, pytest-cov and setuptools are MIT licensed Python packages used in this project.
9090

9191

9292
black:
@@ -113,6 +113,8 @@ urllib3:
113113
wheel:
114114
Copyright (c) 2012 Daniel Holth <dholth@fastmail.fm> and contributors
115115

116+
pytest-cov:
117+
Copyright (c) 2010 Holger Krekel and others
116118

117119
Permission is hereby granted, free of charge, to any person obtaining a copy
118120
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)