hyperlight-dev / hyperlight-dev/hyperlight

Optimise floating point/SIMD context-save/restore

Offen
#711 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area/performance lifecycle/confirmed
Vorherrschende Sprache
Rust
Sterne
4.7k
Forks
208
Ø Merge
1 T. 7 Std.
Gemergte PRs (30 T.)
47

Beschreibung

Currently, the hyperlight_guest exception handlers are compiled along with the rest of the guest code, and the compiler sometimes introduces floating point/SIMD instructions (e.g. exception handlers use the same memcpy as the rest of the guest, which uses XMM registers on x86-64). Because of this, we currently save and restore the entire floating point and SSE register state on every context switch (see [here](https://github.com/hyperlight-dev/hyperlight/blob/ea6fa8f16dae2325d94af39eb6ac3b441b24dcac/src/hyperlight_guest_bin/src/exceptions/interrupt_entry.rs#L74). This is not ideal, because it makes the context-save large and slow.

Other kernels, like Linux, arrange for most kernel code to be compiled without FPU/SIMD, and in the few cases where it's a good performance tradeoff to use SIMD in the kernel at the cost of the extra overhead, they have `kernel_fpu_begin()`/`kernel_fpu_end()`. We should figure out a way to compile Hyperlight in a similar configuration, and see if it's a performance improvement to do so.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.