Commit graph

193 commits

Author SHA1 Message Date
Changyuan Lyu
b71ee9aac3 refactor(kvm): add a module for in-kernel devices
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-29 09:54:48 -07:00
Changyuan Lyu
a90f1b44c8 docs: fix the vhost-vsock dev path
/dev/vsock is the guest vsock driver.

Fixes: 2e59fe0866 ("docs: update README.md")

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-26 01:14:02 -07:00
Changyuan Lyu
2e59fe0866 docs: update README.md
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-26 00:53:25 -07:00
Changyuan Lyu
164b6abd3c docs(snp): boot SEV-SNP guests with latest KVM
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-26 00:53:25 -07:00
Changyuan Lyu
57c5667c12 feat(hvf): map/unmap guest memory
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-23 15:37:06 -07:00
Changyuan Lyu
f0719ff1c4 feat(hvf): create and destroy VCPUs
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-23 15:37:06 -07:00
Changyuan Lyu
8165673b00 fix(cli): derive Default for Hypervisor on macOS
This removes the `derivable_impls` warning from clippy.

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-23 15:37:06 -07:00
Changyuan Lyu
ebeff5f872 feat(hvf): create and destroy guests
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-23 15:37:06 -07:00
Changyuan Lyu
cd95d29164 refactor(hvf): move Vm and Vcpu to sub modules
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-23 15:37:06 -07:00
Changyuan Lyu
e26a46887a fix(board)!: handle shutdown and reset on aarch64
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 23:41:26 -07:00
Changyuan Lyu
8c45dd7ef4 fix(board): do not add PCI IO bus on aarch64
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 23:41:26 -07:00
Changyuan Lyu
a324ecfc57 fix(board): impl empty coco_* methods on aarch64
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 23:41:26 -07:00
Changyuan Lyu
1c1148639e feat(board): create devicetree for aarch64 guests
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 23:12:49 -07:00
Changyuan Lyu
5634465cda feat(dt): add a module for creating devicetree
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 23:12:49 -07:00
Changyuan Lyu
7d5f6e8838 feat(loader): load Linux kernel image on aarch64
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 23:12:49 -07:00
Changyuan Lyu
810211b228 feat(pl011): implement an emuldated UART(PL011)
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 20:30:29 -07:00
Changyuan Lyu
41eee098f6 feat(kvm): create up to 32 IrqSenders on aarch64
Most devices should use MSI. 32 SPIs should be enough for MMIO
devices.

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 20:30:29 -07:00
Changyuan Lyu
aeac0b601d fix(hv)!: rename IntxSender to IrqSender
The term "INTx" seems to be mostly used with PCI devices. "IRQ" is a
more general name for pin-based interrupts.

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 20:30:29 -07:00
Changyuan Lyu
ca2319a82d fix(vm): create VCPU and GIC earlier than devices
On aarch64, as required by KVM, all VCPUs and the GIC must be created
before any IRQFD can be created.

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 20:30:29 -07:00
Changyuan Lyu
914c725936 refactor(serial): split out console as a new mod
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-22 20:30:29 -07:00
Changyuan Lyu
98be90f6d6 feat(board): create RAM for aarch64 VMs
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-21 17:50:12 -07:00
Changyuan Lyu
1978840e70 feat(kvm)!: init aarch64 VCPUs
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-21 17:50:12 -07:00
Changyuan Lyu
5d037becae feat(board)!: create and init GIC V2 for aarch64
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-21 17:50:12 -07:00
Changyuan Lyu
e79171d626 feat(kvm)!: create in-kernel GIC V2 for aarch64
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-21 17:50:12 -07:00
Changyuan Lyu
4563d5fb33 feat(kvm)!: get/set aarch64 registers
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-21 17:50:12 -07:00
Changyuan Lyu
cab83e44b0 fix(kvm): add cfg attr to remove compiler warnings
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-21 17:50:12 -07:00
Changyuan Lyu
548e748a85 fix!: use u64 as the type of guest addresses
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-21 00:09:15 -07:00
Changyuan Lyu
42ee9393bb ci: cargo clippy for aarch64-unknown-linux-gnu
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-19 15:57:01 -07:00
Changyuan Lyu
645879bfac ci: add action cache to reduce workflow time
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-19 15:57:01 -07:00
Changyuan Lyu
61eb8200f8 ci: remove Cirrus, add GitHub Actions on macOS
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 22:12:28 -07:00
Changyuan Lyu
78e4f92e96 feat: skeleton for running VMs on Apple silicon
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 22:12:28 -07:00
Changyuan Lyu
7065002d42 fix(trace_error): add cfg attr to match arms
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 22:12:28 -07:00
Changyuan Lyu
038329b721 feat: skeleton for running KVM VMs on aarch64
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 20:43:01 -07:00
Changyuan Lyu
6368c4fb38 feat: add definitions for aarch64 registers
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 20:43:01 -07:00
Changyuan Lyu
468080b5b0 refactor(board): separate out arch-dependent code
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 20:43:01 -07:00
Changyuan Lyu
2603a38380 refactor(kvm): separate out AMD-SEV related code
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 20:43:01 -07:00
Changyuan Lyu
6efa97ab84 refactor(kvm): separate out arch-dependent code
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 20:43:01 -07:00
Changyuan Lyu
c8e891e7e7 refactor: move x86_64 registers to module arch
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 20:43:01 -07:00
Changyuan Lyu
54a12de6f5 test(kvm): move VCPU tests to sub module x86_64
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 20:43:01 -07:00
Changyuan Lyu
917cc88c3c refactor(kvm): use c_enum for KVM VM types
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 19:29:37 -07:00
Changyuan Lyu
3813d22a43 refactor(kvm): use c_enum for capabilities
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 19:29:37 -07:00
Changyuan Lyu
6c00567356 refactor(kvm): use c_enum for VM exit constants
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 19:29:37 -07:00
Changyuan Lyu
4cb8d9c799 refactor(blk): use c_enum for constants
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 19:29:37 -07:00
Changyuan Lyu
f18a584280 feat: add macro c_enum for C enum bindings
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-16 19:29:37 -07:00
Changyuan Lyu
9325f0bf0c feat(snp): initialize AP registers of an SNP guest
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-15 20:49:37 -07:00
Changyuan Lyu
3e33b12a75 feat(snp): prepare the CPUID page of an SNP guest
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-15 20:49:37 -07:00
Changyuan Lyu
d8f90832e1 feat(snp)!: launch update of an SNP guest
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-15 20:49:37 -07:00
Changyuan Lyu
56cd8919df feat(snp): mark SNP guest memory as private
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-15 20:49:37 -07:00
Changyuan Lyu
355efd7566 feat(snp)!: handle SNP covert memory hypercall
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-15 20:49:37 -07:00
Changyuan Lyu
8e43412a2a feat(kvm)!: enable hypercall for SNP guests
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-15 20:49:37 -07:00