From d57760a053611bff5b8d684f4291daba9873be95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Mon, 10 Jun 2024 10:18:44 +0200 Subject: [PATCH] style: format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- src/arch/x86_64/mod.rs | 3 ++- src/macos/x86_64/vcpu.rs | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/arch/x86_64/mod.rs b/src/arch/x86_64/mod.rs index 4944d577..ff2c82f5 100644 --- a/src/arch/x86_64/mod.rs +++ b/src/arch/x86_64/mod.rs @@ -351,7 +351,8 @@ mod tests { PageTableFlags::from_bits_truncate(entry) .difference( PageTableFlags::PRESENT - | PageTableFlags::WRITABLE | PageTableFlags::HUGE_PAGE + | PageTableFlags::WRITABLE + | PageTableFlags::HUGE_PAGE ) .is_empty(), "Pagetable bits at {addr:#x} are incorrect" diff --git a/src/macos/x86_64/vcpu.rs b/src/macos/x86_64/vcpu.rs index ca76ad7b..1cfaf230 100644 --- a/src/macos/x86_64/vcpu.rs +++ b/src/macos/x86_64/vcpu.rs @@ -130,17 +130,18 @@ lazy_static! { let cap: u64 = { read_vmx_cap(&xhypervisor::VMXCap::PINBASED).unwrap() }; cap2ctrl(cap, PIN_BASED_INTR | PIN_BASED_NMI | PIN_BASED_VIRTUAL_NMI) }; - static ref CAP_PROCBASED: u64 = - { - let cap: u64 = { read_vmx_cap(&xhypervisor::VMXCap::PROCBASED).unwrap() }; - cap2ctrl( - cap, - CPU_BASED_SECONDARY_CTLS - | CPU_BASED_MWAIT | CPU_BASED_MSR_BITMAPS - | CPU_BASED_MONITOR | CPU_BASED_TSC_OFFSET - | CPU_BASED_TPR_SHADOW, - ) - }; + static ref CAP_PROCBASED: u64 = { + let cap: u64 = { read_vmx_cap(&xhypervisor::VMXCap::PROCBASED).unwrap() }; + cap2ctrl( + cap, + CPU_BASED_SECONDARY_CTLS + | CPU_BASED_MWAIT + | CPU_BASED_MSR_BITMAPS + | CPU_BASED_MONITOR + | CPU_BASED_TSC_OFFSET + | CPU_BASED_TPR_SHADOW, + ) + }; static ref CAP_PROCBASED2: u64 = { let cap: u64 = { read_vmx_cap(&xhypervisor::VMXCap::PROCBASED2).unwrap() }; cap2ctrl(cap, CPU_BASED2_RDTSCP | CPU_BASED2_APIC_REG_VIRT)