Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
add CCC
Browse files Browse the repository at this point in the history
Signed-off-by: Jianliang Shen <[email protected]>
  • Loading branch information
Jianliang Shen committed Jul 18, 2024
1 parent 7ed50b1 commit c298ae9
Show file tree
Hide file tree
Showing 17 changed files with 127 additions and 27 deletions.
27 changes: 7 additions & 20 deletions source/_posts/GPU/Arch.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,7 @@ CUDA Core 专门处理图形工作负载,Tensor Core 更擅长处理数字工

### Fermi 架构

<!-- [Fermi架构白皮书](https://www.nvidia.com/content/PDF/fermi_white_papers/NVIDIA_Fermi_Compute_Architecture_Whitepaper.pdf) -->

<iframe src="https://www.nvidia.com/content/PDF/fermi_white_papers/NVIDIA_Fermi_Compute_Architecture_Whitepaper.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>
<iframe src="/pdf/NVIDIA_Fermi_Compute_Architecture_Whitepaper.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

Fermi 是 Nvidia 在 2010 年发布的架构,引入了很多今天也仍然不过时的概念。英伟达第一个采用 GPU-Direct 技术的 GPU 架构,它拥有 32 个 SM(流多处理器)和 16 个 PolyMorph Engine 阵列。该架构采用了 4 颗芯片的模块化设计,拥有 32 个光栅化处理单元和 16 个纹理单元,搭配 GDDR5 显存。

Expand Down Expand Up @@ -268,8 +266,6 @@ SM 内还有 16 个 LD/ST 单元,也就是 Load/Store 单元,支持 16 个

[2014 Maxwell架构白皮书](https://developer.nvidia.com/maxwell-compute-architecture)

<!-- <iframe src="https://developer.nvidia.com/maxwell-compute-architecture" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe> -->

![](/img/post_pics/gpu/arch/12.png)

Maxwell的 SM 开始做减法了,每个 SM(SMM)中包含:
Expand Down Expand Up @@ -328,9 +324,7 @@ Tesla微观架构总览图如上。下面将阐述它的特性和概念:

### Volta 架构

<!-- [Volta白皮书](https://images.nvidia.cn/content/volta-architecture/pdf/volta-architecture-whitepaper.pdf) -->

<iframe src="https://images.nvidia.cn/content/volta-architecture/pdf/volta-architecture-whitepaper.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>
<iframe src="/pdf/volta-architecture-whitepaper.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

![](/img/post_pics/gpu/arch/14.png)

Expand All @@ -343,9 +337,7 @@ Tesla微观架构总览图如上。下面将阐述它的特性和概念:

### Turing架构

<!-- [2018Turing架构白皮书](https://www.nvidia.com/content/dam/en-zz/Solutions/design-visualization/technologies/turing-architecture/NVIDIA-Turing-Architecture-Whitepaper.pdf) -->

<iframe src="https://www.nvidia.com/content/dam/en-zz/Solutions/design-visualization/technologies/turing-architecture/NVIDIA-Turing-Architecture-Whitepaper.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>
<iframe src="/pdf/NVIDIA-Turing-Architecture-Whitepaper.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

![](/img/post_pics/gpu/arch/15.png)

Expand All @@ -363,9 +355,7 @@ Turing架构采用全新SM设计,每个TPC均包含两个SM,每个SM共有64

### Ampere 架构

<!-- [Ampere架构白皮书](https://images.nvidia.cn/aem-dam/en-zz/Solutions/data-center/nvidia-ampere-architecture-whitepaper.pdf) -->

<iframe src="https://images.nvidia.cn/aem-dam/en-zz/Solutions/data-center/nvidia-ampere-architecture-whitepaper.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>
<iframe src="/pdf/nvidia-ampere-architecture-whitepaper.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

代表产品为 GeForce RTX 30 系列。该架构继续优化并行计算能力,并引入了更先进的 GDDR6X 内存技术,大幅提高了内存带宽和性能。相比 Turing 架构,Ampere 架构中的 SM 在 Turing 基础上增加了一倍的 FP32 运算单元,这使得每个 SM 的 FP32 运算单元数量提高了一倍,同时吞吐量也就变为了一倍。此外,安培架构还改进了着色器性能和张量核(Tensor Cores),进一步加速深度学习和人工智能任务的处理速度。

Expand Down Expand Up @@ -397,10 +387,7 @@ NVIDIA A100基于7nm Ampere GA100 GPU,具有6912 CUDA内核和432 Tensor Core

![](/img/post_pics/gpu/arch/18.png)

[Hopper架构白皮书](https://resources.nvidia.com/en-us-tensor-core?ncid=no-ncid)
<!-- [Hopper中文架构白皮书](https://resources.nvidia.com/cn-hopper-architecture?ncid=no-ncid) -->

<iframe src="https://resources.nvidia.com/cn-hopper-architecture?ncid=no-ncid" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>
<iframe src="/pdf/NVIDIA-H100-GPU-Architecture-Whitepaper-zhCN.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

作为面向专业计算的GPU,H100采用HBM3高带宽显存,NVIDIA将六颗HBM3高带宽显存堆栈在核心两侧。核心内建5120-bit的HBM3显存位宽,英伟达可配置最高80GB显存,SXM5版(HBM3显存)带宽更是达到3TB/s,PCIe版本(HBM2e)则是2TB/s。

Expand All @@ -413,6 +400,6 @@ H100的主机接口同样迎来升级,SXM外形的PCB板配备新一代NVLink
### Blackwell 架构

[Blackwell 架构](https://www.nvidia.cn/data-center/technologies/blackwell-architecture/)
<!-- [白皮书](https://resources.nvidia.com/en-us-blackwell-architecture?ncid=no-ncid) -->
[白皮书](https://resources.nvidia.com/en-us-blackwell-architecture?ncid=no-ncid)

<iframe src="https://resources.nvidia.com/en-us-blackwell-architecture?ncid=no-ncid" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>
<iframe src="/pdf/NVIDIA-Blackwell-Architecture-Technical-Overview.pdf" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>
19 changes: 14 additions & 5 deletions source/_posts/GPU/Computing-Startup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories:
- GPU
---

人类无法预知未来,但可以亡羊补牢。
GPU, Compute and AI.

<!-- more -->

Expand Down Expand Up @@ -48,16 +48,25 @@ categories:
| [Pytorch Examples](https://github.com/pytorch/examples)| 围绕 pytorch 的视觉、文本、强化学习等方面的一组示例。 |
| [Pytorch 源码仓库](https://github.com/pytorch/pytorch)| 具有强大 GPU 加速的 Python 张量和动态神经网络。 |

<iframe src="https://pytorch.org/tutorials/beginner/basics/intro.html" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

### Cuda

[CUDA 官方文档](https://docs.nvidia.com/cuda/)
[CUDA Runtime API](https://docs.nvidia.com/cuda/cuda-runtime-api/index.html)
[CUDA Samples](https://github.com/NVIDIA/cuda-samples)

<details>
<summary>点击查看CUDA文档</summary>

<iframe src="https://docs.nvidia.com/cuda/" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

[CUDA Runtime API](https://docs.nvidia.com/cuda/cuda-runtime-api/index.html)
[CUDA Samples](https://github.com/NVIDIA/cuda-samples)
</details>

<details>
<summary>点击查看PyTorch文档</summary>

<iframe src="https://pytorch.org/tutorials/beginner/basics/intro.html" width="100%" height="800" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

</details>

### Jetson 嵌入式AI

Expand Down
2 changes: 1 addition & 1 deletion source/_posts/GPU/SDMA-3D-copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GPU MEM3DCPY是怎么实现的。
## 定义


这个操作主要依靠 SDAMA Linear Sub-Window Copy。该命令用于在两个具有不同大小和起始点(应该是相同元素大小)的表面之间执行子窗口复制。
这个操作主要依靠 SDMA Linear Sub-Window Copy。该命令用于在两个具有不同大小和起始点(应该是相同元素大小)的表面之间执行子窗口复制。

![](/img/post_pics/gpu/sdma/0.png)
![](/img/post_pics/gpu/sdma/0-1.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ categories:

原文:[Information security techniques-General framework for confidential computing](https://www.tc260.org.cn/file/2023-04-28/e9d12373-73ee-47e9-9ca0-8bddd02f27f0.pdf)

<details>
<summary>点击查看PDF</summary>

<iframe src="https://www.tc260.org.cn/file/2023-04-28/e9d12373-73ee-47e9-9ca0-8bddd02f27f0.pdf" width="100%" height="1000" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

</details>

## 目录

- [目录](#目录)
Expand Down
99 changes: 99 additions & 0 deletions source/_posts/Security/Confidential-Computing-Consortium.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
layout: post
title: 机密计算联盟 CCC
index_img: /img/post_pics/cc/ccc1.png
date: 2024-07-18 20:18:02
tags:
- Compute
categories:
- 安全
---

Confidential Computing Consortium (CCC).

<!-- more -->

# 目录

- [目录](#目录)
- [机密计算的常用术语](#机密计算的常用术语)
- [简介](#简介)
- [包装模型术语](#包装模型术语)
- [隔离方法](#隔离方法)
- [A-Technical-Analysis-of-Confidential-Computing](#a-technical-analysis-of-confidential-computing)

# 机密计算的常用术语

<details>
<summary>点击查看PDF</summary>

<iframe src="/pdf/Common-Terminology-for-Confidential-Computing.pdf" width="100%" height="1000" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

</details>

## 简介

随着越来越多的公司和开源项目开始使用类似的术语来描述基于硬件的、经过验证的可信执行环境 (TEE) 的类似范例,供应商使用一致的术语来描述这些新功能在不同功能域中的应用方式将变得越来越重要。

机密计算联盟已将机密计算定义为“通过在基于硬件的、经过验证的可信执行环境中执行计算来保护正在使用的数据”,并确定了可信执行环境的三个主要属性:数据完整性、数据机密性和代码完整性。如“机密计算:基于硬件的应用程序和数据可信执行”中所述,可能存在四个附加属性(代码机密性、可编程性、可恢复性和可验证性),但只有可验证性才是将计算环境归类为机密计算的严格必要条件。

本文将术语“机密”的其他应用定义为描述性前缀,例如“机密容器”、“机密虚拟机”等。此类术语已开始出现在营销材料和商业产品以及相关开源项目中。本文重点介绍机密计算和相关的“机密 xxx”术语,以提供描述将机密计算添加到计算机架构的影响时的通用词汇表。目标是充分描述隔离计算工作负载所引入的不同潜在架构变化,以便正确评估保护完整应用程序及其数据的影响。内存隔离是机密计算引入的新元素之一。能够保护正在运行的应用程序会显著改变计算机安全的方法。网络攻击通常始于对内存内容的破坏(提取数据或修改内存状态以启用执行)。因此,有效的内存隔离能力早已被认为是最佳的潜在缓解措施。但保护正在使用的数据只是应用程序安全性的一部分。需要一种综合解决方案,利用机密计算和静态和动态保护来全面保护敏感工作负载及其数据,无论它们流向何处。

例如,在云计算中,保护使用中的数据成为一项基本要求,以使客户能够在云供应商提供的基础设施上运行时控制保护应用程序及其数据。所有云都支持建立在一定信任程度上的共享责任模型。机密计算允许以更强的方式分离责任和隔离资源。


## 包装模型术语

本文档定义了以下术语:

- 机密库:在基于硬件的、经过认证的 TEE 内执行的库(例如“enclave”),这样它就不会受到其他此类库和 TEE 中任何托管环境的影响,并且可以由 TEE 外部的应用程序使用。
- 机密进程:在基于硬件的、经过认证的 TEE 内执行的进程(例如“受信任的应用程序”),这样它就不会受到其他机密进程和 TEE 中任何托管环境的影响。
- 机密容器:由 OCI 容器运行时启动的符合开放容器计划 (OCI) 的容器映像的入口点进程,这样该进程在基于硬件的 TEE 内执行,并且不会受到其他机密容器和 TEE 中任何托管环境的影响。
- 机密 VM:在基于硬件的、经过认证的 TEE 内执行的虚拟机,通过这种方式,整个 VM 映像内的代码和数据受到保护,不受虚拟机管理程序和主机操作系统以及其他机密 VM 和 TEE 中的任何托管环境的影响。

在上述定义中,托管环境可能包括在 TEE 内运行但在多个机密库、进程、容器或 VM 之间共享的部分。在这种情况下,使用术语“机密”意味着额外的隔离层,通过该隔离层,机密代码和数据即使在托管机密代码和数据的整体 TEE 实例内的共享环境中也受到保护。例如,可能使用嵌套隔离边界。

当代码的机密部分是较大包的一部分时,例如包含在整体 VM 映像内的机密库,我们使用介词“with”,如“带有机密库的 VM”,而不是“机密 VM”,后者要求整个 VM 映像在 TEE 内执行。

当代码的机密部分包含多个可以单独安装但它们之间没有安全隔离的包时,我们使用介词“in”,如“机密虚拟机中的进程”。

## 隔离方法

上述封装术语将由与 TEE 的硬件和固件协同运行的软件提供。这种组合将提供数据机密性、数据完整性和/或代码完整性保护的混合。数据机密性是在运行时通过隔离处理器(无论是 CPU 还是其他处理单元,如 GPU)内的特定 TEE 上下文(可能在 RAM 内)提供的。有多种方法可以提供使用中数据保护。限制 CPU 对 TEE 数据的可寻址性/可访问性的三种技术示例包括:

- 访问控制验证:对内存区域的访问仅限于某些进程/上下文。
- 地址转换:内存的分段区域根本无法从 TEE 边界之外直接寻址。
- 分页控制:非 TEE 进程不会与 TEE 数据同时在 CPU 内活动。

当然,CPU 并不是唯一可以看到 TEE 数据的地方。此类数据通常也存储在 RAM 中。当在 RAM 中时,可能会尝试对 TEE 数据进行旁道攻击。可以通过加密 RAM 中的 TEE 数据等方式保护 RAM 免受此类攻击。

处理器供应商通常会捆绑多种隔离方法来保护其实现。提供机密计算功能的软件就是在这些捆绑包的基础上进行分层的。

![](/img/post_pics/cc/ccc2.png)

但是,根据这些隔离方法,实际上集成和交付了哪些软件层?软件层的打包取决于代码是为软件开发人员、系统集成商还是系统管理员准备的。在系统管理员实际安装代码之前,很可能会出现许多嵌套的打包应用层。考虑到这一点,下面的栏目列出了九个示例,说明软件层如何实际打包以供软件供应链下游参与者使用。在这些示例中,仅突出显示了 NIST 800-12 Rev.1 定义的可信计算基 (TCB) 的软件元素。未显示 TCB 的其他元素(例如固件和硬件)。

![](/img/post_pics/cc/ccc3.png)

如图所示,这九种实施方案中的每一个都可以映射到上述四个打包术语之一。红色框显示了在 TEE 内运行的组件集。黄色框显示了可能一起打包的示例。在另一个示例(未显示)中,红色框中的某些组件可能被单独打包。

此外,九列中的每一列都可由某些使用中数据隔离方法子集支持。这种打包分类对于机密计算的最终用户非常有用,因为它可以:

- 表达应该作为打包产品一部分的软件元素。
- 了解在特定封装产品中哪些信息是隔离的(或不是)。注意:这由红色虚线表示,该虚线描绘了在内存隔离部分运行的机密计算。
- 了解隔离方法中的常见角色,例如“TEE shim”,它有助于加载 TEE,并将信息传递到受保护的内存和从受保护的内存传递信息。
- 了解各种 CCC 项目如何通过常见的北向抽象来抽象内存隔离方法的差异。
- 了解从 TEE 公开的封装 API 如何与其他软件交互。这包括 TEE 在建立机密性后通过安全通道加载其他代码/数据的能力。
- 允许比较封装软件替代方案,每个替代方案可能基于不同的隔离方法。
- 启用可扩展性,以便新兴处理器技术可以声明它们支持的封装模型(例如基于 RISC-V)。

各种 CCC 项目将提供针对此处描述的一种或多种包装模型的代码。示例可能包括:

- Occlum 和/或 Gramine 可以帮助开发人员将现有应用程序打包为基于 Intel SGX 构建的“机密库”包。
- Enarx 可以帮助开发人员编译单个应用程序包,该包可以透明地部署到多个部署类别中。相同的应用程序包可以在 SGX 等“机密库”或 SEVSNP 等“机密 VM”中运行,Enarx 提供抽象层以确保相同的运行时环境。
- Open Enclave 可以让开发人员设计一个能够在 SGX(打包为“机密库”)和 TrustZone(打包为“机密进程”)上运行的库。

# A-Technical-Analysis-of-Confidential-Computing

<iframe src="/pdf/A-Technical-Analysis-of-Confidential-Computing.pdf" width="100%" height="1000" name="topFrame" scrolling="yes" noresize="noresize" frameborder="0" id="topFrame"></iframe>

2 changes: 1 addition & 1 deletion source/_posts/Security/LLM-Security.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ categories:

### 威胁模型

参考:[](https://confidentialcomputing.io/wp-content/uploads/sites/10/2023/03/CCC-A-Technical-Analysis-of-Confidential-Computing-v1.3_unlocked.pdf)
参考:[A Technical Analysis of Confidential Computing v1.3](https://confidentialcomputing.io/wp-content/uploads/sites/10/2023/03/CCC-A-Technical-Analysis-of-Confidential-Computing-v1.3_unlocked.pdf)
以下威胁向量通常被视为机密计算的范围:

- 软件攻击:包括对主机软件和固件的攻击。这可能包括操作系统、管理程序、BIOS、其他软件和工作负载。
Expand Down
Binary file added themes/fluid/source/img/post_pics/cc/ccc1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/fluid/source/img/post_pics/cc/ccc2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/fluid/source/img/post_pics/cc/ccc3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit c298ae9

Please sign in to comment.