Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
daa520b
hypervisor: kvm: Add GUEST_MEMFD and KVM_SET_USER_MEMORY_REGION2 support
Talador12 Mar 11, 2026
a9e65df
vmm: allow IGVM payload alongside a kernel
rhakobyan Apr 7, 2026
6b0c58d
arch, hypervisor, vmm: skip vcpu setup when using igvm and kvm
rhakobyan Apr 7, 2026
597f5e7
hypervisor, vmm: pass SNP guest policy to sev_snp_init
rhakobyan Apr 7, 2026
29713b5
vmm: make RSDP address optional in configure_system
rhakobyan Apr 8, 2026
d3eb5e8
vmm: remove sev_snp_enabled parameter from payload loading
rhakobyan Apr 8, 2026
2bf9acb
igvm, vmm: parse IGVM file early and thread it through VM setup
rhakobyan Apr 9, 2026
01d4d47
hypervisor, vmm: Add KVM SEV_{INIT2, SNP_LAUNCH_START} support
rhakobyan Apr 7, 2026
ad58591
hypervisor, vmm: Add support for KVM_SEV_SNP_LAUNCH_UPDATE
rhakobyan Apr 7, 2026
2f73f67
hypervisor, vmm: Add support for KVM_SEV_SNP_LAUNCH_FINISH
rhakobyan Apr 7, 2026
3069e84
hypervisor: Handle KVM_HC_MAP_GPA_RANGE hypercalls
rhakobyan Apr 8, 2026
9730869
hypervisor: handle VcpuExit::MemoryFault for AP boot page conversions
rhakobyan Apr 8, 2026
bfb6671
vmm: add KVM SEV-SNP support to IGVM loader
rhakobyan Apr 8, 2026
c452b02
vmm: reserve memory regions for stage0 and VMSA on KVM SEV-SNP
rhakobyan Apr 8, 2026
fcd6a2d
fw_cfg: export full setup-header area for x86_64 kernels
dgreid Apr 3, 2026
d9c0f3a
vmm: use 64-bit BARs for hotplugged virtio block devices
dgreid Apr 3, 2026
765d783
ci: Add CI jobs for KVM SEV-SNP
Talador12 Apr 1, 2026
3f7c4d6
Address open review feedback on SEV-SNP PR
Talador12 Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
- name: Build (sev_snp)
run: cargo build --locked --bin cloud-hypervisor --no-default-features --features "sev_snp"

- name: Build (kvm + sev_snp)
run: cargo build --locked --bin cloud-hypervisor --no-default-features --features "kvm,igvm,sev_snp,fw_cfg"

- name: Build (igvm)
run: cargo build --locked --bin cloud-hypervisor --no-default-features --features "igvm"

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,36 @@ jobs:
target: ${{ matrix.target }}
args: --locked --all --all-targets --no-default-features --tests --examples --features "tdx,kvm" -- -D warnings

- name: Clippy (kvm + sev_snp + igvm + fw_cfg)
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
uses: houseabsolute/actions-rust-cross@v1
with:
command: clippy
cross-version: 3e0957637b49b1bbced23ad909170650c5b70635
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
args: --locked --all --all-targets --no-default-features --tests --examples --features "kvm,sev_snp,igvm,fw_cfg" -- -D warnings

- name: Clippy (mshv + kvm + igvm)
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
uses: houseabsolute/actions-rust-cross@v1
with:
command: clippy
cross-version: 3e0957637b49b1bbced23ad909170650c5b70635
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
args: --locked --all --all-targets --no-default-features --tests --examples --features "mshv,kvm,igvm" -- -D warnings

- name: Clippy (default features + sev_snp + igvm + fw_cfg)
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
uses: houseabsolute/actions-rust-cross@v1
with:
command: clippy
cross-version: 3e0957637b49b1bbced23ad909170650c5b70635
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
args: --locked --all --all-targets --tests --examples --features "sev_snp,igvm,fw_cfg" -- -D warnings

- name: Check build did not modify any files
run: test -z "$(git status --porcelain)"

Expand Down
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion arch/src/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,7 @@ pub fn configure_vcpu(
cpu_vendor: CpuVendor,
topology: (u16, u16, u16, u16),
nested: bool,
setup_registers: bool,
) -> super::Result<()> {
let x2apic_id = get_x2apic_id(id, Some(topology));

Expand Down Expand Up @@ -891,7 +892,9 @@ pub fn configure_vcpu(
}

regs::setup_msrs(vcpu).map_err(Error::MsrsConfiguration)?;
if let Some((kernel_entry_point, guest_memory)) = boot_setup {
if let Some((kernel_entry_point, guest_memory)) = boot_setup
&& setup_registers
{
regs::setup_regs(vcpu, kernel_entry_point).map_err(Error::RegsConfiguration)?;
regs::setup_fpu(vcpu).map_err(Error::FpuConfiguration)?;

Expand Down
10 changes: 10 additions & 0 deletions devices/src/legacy/fw_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,16 @@ impl FwCfg {
let kernel_start = bp.text_offset;
#[cfg(target_arch = "x86_64")]
let kernel_start = (bp.hdr.setup_sects as usize + 1) * 512;
if kernel_start <= buffer.len() {
buffer.truncate(kernel_start);
} else {
buffer.resize(kernel_start, 0);
file.read_exact_at(
&mut buffer[size_of::<boot_params>()..],
size_of::<boot_params>() as u64,
)?;
}

self.known_items[FW_CFG_SETUP_SIZE as usize] = FwCfgContent::U32(buffer.len() as u32);
self.known_items[FW_CFG_SETUP_DATA as usize] = FwCfgContent::Bytes(buffer);
self.known_items[FW_CFG_KERNEL_SIZE as usize] =
Expand Down
1 change: 1 addition & 0 deletions hypervisor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tdx = []
[dependencies]
anyhow = { workspace = true }
arc-swap = "1.9.0"
bitfield = "0.16.1"
bitfield-struct = "0.12.0"
byteorder = { workspace = true }
cfg-if = { workspace = true }
Expand Down
9 changes: 7 additions & 2 deletions hypervisor/src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,15 @@ pub trait Vcpu: Send + Sync {
) -> Result<[u32; 4]> {
unimplemented!()
}
#[cfg(feature = "mshv")]
fn set_sev_control_register(&self, _reg: u64) -> Result<()> {
#[cfg(feature = "sev_snp")]
fn set_sev_control_register(&self, _vmsa_pfn: u64) -> Result<()> {
unimplemented!()
}
#[cfg(feature = "sev_snp")]
fn setup_sev_snp_regs(&self, _vmsa: igvm::snp_defs::SevVmsa) -> Result<()> {
unimplemented!()
}

///
/// Sets the value of GIC redistributor address
///
Expand Down
5 changes: 5 additions & 0 deletions hypervisor/src/hypervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ pub enum HypervisorError {
#[cfg(target_arch = "x86_64")]
#[error("Failed to enable AMX tile state components")]
CouldNotEnableAmxStateComponents(#[source] crate::arch::x86::AmxGuestSupportError),
///
/// Failed to retrieve SEV-SNP capabilities
///
#[error("Failed to retrieve SEV-SNP capabilities:{0}")]
SevSnpCapabilities(#[source] anyhow::Error),
}

///
Expand Down
Loading
Loading