GithubHelp home page GithubHelp logo

yaxitech / sev Goto Github PK

View Code? Open in Web Editor NEW

This project forked from virtee/sev

0.0 1.0 0.0 749 KB

Rust library abstracting Linux AMD SEV and SEV-SNP ioctls.

License: Apache License 2.0

Shell 0.40% Python 0.06% C 0.22% Rust 99.01% Meson 0.31%

sev's Introduction

Workflow Status Average time to resolve an issue Percentage of issues still open Maintenance

sev

The sev crate provides an implementation of the AMD Secure Encrypted Virtualization (SEV) APIs and the [SEV Secure Nested Paging Firmware (SNP)] (https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/56860.pdf) ABIs.

SEV APIs

The Linux kernel exposes two technically distinct AMD SEV APIs:

  1. An API for managing the SEV platform itself
  2. An API for managing SEV-enabled KVM virtual machines

This crate implements both of those APIs and offers them to client. code through a flexible and type-safe high-level interface.

SNP ABIs

Like SEV, the Linux kernel exposes another two different AMD SEV-SNP ABIs:

  1. An ABI for managing the SEV-SNP platform itself
  2. An ABI for managing SEV-SNP enabled KVM virtual machines

These new ABIs work only for SEV-SNP enabled hosts and guests.

This crate implements APIs for both SEV and SEV-SNP management.

SEV and SEV-SNP enablement

By default, both the SEV and SEV-SNP libraries are compiled. Because many modules provide support to both legacy SEV and SEV-SNP, they have been split into individual sub-modules sev.rs and snp.rs, isolating generation specific behavior. If desired, you may opt to exclude either of the sub-modules by disabling its feature in your project's Cargo.toml

For example, to include the SEV APIs only: sev = { version = "1.2.1", default-features = false, features = ["sev"] }

To include the SEV-SNP APIs only: sev = { version = "1.2.1", default-features = false, features = ["snp"] }

Platform Management

Refer to the firmware module for more information.

Guest Management

Refer to the launch module for more information.

Cryptographic Verification

To enable the cryptographic verification of certificate chains and attestation reports, either the openssl or crypto_nossl feature has to be enabled manually. With openssl, OpenSSL is used for the verification. With crypto_nossl, OpenSSL is not used for the verification and instead pure-Rust libraries (e.g., p384, rsa, etc.) are used. openssl and crypto_nossl are mutually exclusive, and enabling both at the same time leads to a compiler error.

Remarks

Note that the Linux kernel provides access to these APIs through a set of ioctls that are meant to be called on device nodes (/dev/kvm and /dev/sev, to be specific). As a result, these ioctls form the substrate of the sev crate. Binaries that result from consumers of this crate are expected to run as a process with the necessary privileges to interact with the device nodes.

Using the C API

Projects in C can take advantage of the C API for the SEV launch ioctls. To install the C API, users can use cargo-c with the features they would like to produce and install a pkg-config file, a static library, a dynamic library, and a C header:

cargo cinstall --prefix=/usr --libdir=/usr/lib64

License: Apache-2.0

sev's People

Contributors

npmccallum avatar tylerfanelli avatar larrydewey avatar haraldh avatar dependabot[bot] avatar mbestavros avatar rvolosatovs avatar dgonzalezvillal avatar crobinso avatar sarutak avatar michiboo avatar heavenboy8 avatar slp avatar fspreiss avatar bfurner27 avatar ambaxter avatar lilienbm-zz avatar squidboylan avatar zildj1an avatar dubek avatar fuuuoverclocking avatar jepio avatar sameo avatar zeenix avatar

Watchers

 avatar

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.