1 Star 0 Fork 0

zhengjun186110/SGX-hardware

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rdmsr.h 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
Mark Nelson 提交于 2023-12-12 22:23 . Update documentation
///////////////////////////////////////////////////////////////////////////////
// rdmsr.h - 2023
//
/// This module contains Linux-specific, privlidged code (wants to run as root)
/// that utilizes the RDMSR instruction by reading from /dev/cpu/0/msr to
/// discover & report SGX additional capabilities.
///
/// @file rdmsr.h
/// @author Mark Nelson <marknels@hawaii.edu>
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include <stdbool.h> // For bool
#include <inttypes.h> // For PRIx64 uint64_t
#define IA32_FEATURE_CONTROL 0x03A
#define IA32_SGXLEPUBKEYHASH0 0x08C
#define IA32_SGX_SVN_STATUS 0x500
#define MSR_SGXOWNEREPOCH0 0x300
#define IA32_XSS 0xda0
/// On Linux, return true if we are running as root (with CAP_SYS_ADMIN). In
/// all other situations, return false.
bool checkCapabilities( void );
/// Read an MSR on a CPU
bool rdmsr( uint32_t reg, int cpu, uint64_t* pData );
/// Read and print SGX-specific MSRs on a CPU
void read_SGX_MSRs( void );
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhengjun186110/SGX-hardware.git
git@gitee.com:zhengjun186110/SGX-hardware.git
zhengjun186110
SGX-hardware
SGX-hardware
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385