Vengineerの戯言

人生は短いけど、長いです。人生を楽しみましょう!

NVIDIAがGPUのKernel Modulesを公開したので、ソースコード解析をしてみる(その4)

はじめに

NVIDIAGPUのKernel Modulesを公開したので、ソースコード解析をしてみる、(その4)

NVIDIA Falcon Security というドキュメントがあります。Falconは Security 、Maxwell から始まったようです。

今回は、sec2

www.microsoft.com

SEC2って、何?という、上記の記事の中にあったので説明のために下記に引用します。

In confidential mode, the GPU can be paired with any external entity, such as a TEE on the host CPU. To enable this pairing, the GPU includes a hardware root-of-trust (HRoT). NVIDIA provisions the HRoT with a unique identity and a corresponding certificate created during manufacturing. The HRoT also implements authenticated and measured boot by measuring the firmware of the GPU as well as that of other microcontrollers on the GPU, including a security microcontroller called SEC2. SEC2, in turn, can generate attestation reports that include these measurements and that are signed by a fresh attestation key, which is endorsed by the unique device key. These reports can be used by any external entity to verify that the GPU is in confidential mode and running last known good firmware.

When the NVIDIA GPU driver in the CPU TEE loads, it checks whether the GPU is in confidential mode. If so, the driver requests an attestation report and checks that the GPU is a genuine NVIDIA GPU running known good firmware. Once confirmed, the driver establishes a secure channel with the SEC2 microcontroller on the GPU using the Security Protocol and Data Model (SPDM)-backed Diffie-Hellman-based key exchange protocol to establish a fresh session key. When that exchange completes, both the GPU driver and SEC2 hold the same symmetric session key. 

The GPU driver uses the shared session key to encrypt all subsequent data transfers to and from the GPU. Because pages allocated to the CPU TEE are encrypted in memory and not readable by the GPU DMA engines, the GPU driver allocates pages outside the CPU TEE and writes encrypted data to those pages. On the GPU side, the SEC2 microcontroller is responsible for decrypting the encrypted data transferred from the CPU and copying it to the protected region. Once the data is in high bandwidth memory (HBM) in cleartext, the GPU kernels can freely use it for computation.

ソースコードは、ここ

sec2 のソースコードは、ここです。

github.com

faucon: NVIDIA Falcon Microprocessor Suite

faucon: NVIDIA Falcon Microprocessor Suite なるものもありました。

github.com

おわりに

明日は、NVLink について調べます。