pub struct AccelBuilder<S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with build()
.
Implementations§
Source§impl<S: State> AccelBuilder<S>
impl<S: State> AccelBuilder<S>
Sourcepub fn build(self) -> Accelwhere
S: IsComplete,
pub fn build(self) -> Accelwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn accel_type(self, value: AccelType) -> AccelBuilder<SetAccelType<S>>where
S::AccelType: IsUnset,
pub fn accel_type(self, value: AccelType) -> AccelBuilder<SetAccelType<S>>where
S::AccelType: IsUnset,
Required.
Sourcepub fn igd_passthru(
self,
value: OnOffDefaultOff,
) -> AccelBuilder<SetIgdPassthru<S>>where
S::IgdPassthru: IsUnset,
pub fn igd_passthru(
self,
value: OnOffDefaultOff,
) -> AccelBuilder<SetIgdPassthru<S>>where
S::IgdPassthru: IsUnset,
Sourcepub fn maybe_igd_passthru(
self,
value: Option<OnOffDefaultOff>,
) -> AccelBuilder<SetIgdPassthru<S>>where
S::IgdPassthru: IsUnset,
pub fn maybe_igd_passthru(
self,
value: Option<OnOffDefaultOff>,
) -> AccelBuilder<SetIgdPassthru<S>>where
S::IgdPassthru: IsUnset,
Sourcepub fn kernel_irqchip(
self,
value: OnOffSplit,
) -> AccelBuilder<SetKernelIrqchip<S>>where
S::KernelIrqchip: IsUnset,
pub fn kernel_irqchip(
self,
value: OnOffSplit,
) -> AccelBuilder<SetKernelIrqchip<S>>where
S::KernelIrqchip: IsUnset,
Optional (Some / Option setters).
Controls KVM in-kernel irqchip support. The default is full acceleration of the interrupt controllers. On x86, split irqchip reduces the kernel attack surface, at a performance cost for non-MSI interrupts. Disabling the in-kernel irqchip completely is not recommended except for debugging purposes.
Sourcepub fn maybe_kernel_irqchip(
self,
value: Option<OnOffSplit>,
) -> AccelBuilder<SetKernelIrqchip<S>>where
S::KernelIrqchip: IsUnset,
pub fn maybe_kernel_irqchip(
self,
value: Option<OnOffSplit>,
) -> AccelBuilder<SetKernelIrqchip<S>>where
S::KernelIrqchip: IsUnset,
Optional (Some / Option setters).
Controls KVM in-kernel irqchip support. The default is full acceleration of the interrupt controllers. On x86, split irqchip reduces the kernel attack surface, at a performance cost for non-MSI interrupts. Disabling the in-kernel irqchip completely is not recommended except for debugging purposes.
Sourcepub fn kvm_shadow_mem(self, value: usize) -> AccelBuilder<SetKvmShadowMem<S>>where
S::KvmShadowMem: IsUnset,
pub fn kvm_shadow_mem(self, value: usize) -> AccelBuilder<SetKvmShadowMem<S>>where
S::KvmShadowMem: IsUnset,
Sourcepub fn maybe_kvm_shadow_mem(
self,
value: Option<usize>,
) -> AccelBuilder<SetKvmShadowMem<S>>where
S::KvmShadowMem: IsUnset,
pub fn maybe_kvm_shadow_mem(
self,
value: Option<usize>,
) -> AccelBuilder<SetKvmShadowMem<S>>where
S::KvmShadowMem: IsUnset,
Sourcepub fn one_insn_per_tb(self, value: OnOff) -> AccelBuilder<SetOneInsnPerTb<S>>where
S::OneInsnPerTb: IsUnset,
pub fn one_insn_per_tb(self, value: OnOff) -> AccelBuilder<SetOneInsnPerTb<S>>where
S::OneInsnPerTb: IsUnset,
Sourcepub fn maybe_one_insn_per_tb(
self,
value: Option<OnOff>,
) -> AccelBuilder<SetOneInsnPerTb<S>>where
S::OneInsnPerTb: IsUnset,
pub fn maybe_one_insn_per_tb(
self,
value: Option<OnOff>,
) -> AccelBuilder<SetOneInsnPerTb<S>>where
S::OneInsnPerTb: IsUnset,
Sourcepub fn split_wx(self, value: OnOff) -> AccelBuilder<SetSplitWx<S>>where
S::SplitWx: IsUnset,
pub fn split_wx(self, value: OnOff) -> AccelBuilder<SetSplitWx<S>>where
S::SplitWx: IsUnset,
Optional (Some / Option setters).
Controls the use of split w^x mapping for the TCG code generation buffer. Some operating systems require this to be enabled, and in such a case this will default on. On other operating systems, this will default off, but one may enable this for testing or debugging.
Sourcepub fn maybe_split_wx(self, value: Option<OnOff>) -> AccelBuilder<SetSplitWx<S>>where
S::SplitWx: IsUnset,
pub fn maybe_split_wx(self, value: Option<OnOff>) -> AccelBuilder<SetSplitWx<S>>where
S::SplitWx: IsUnset,
Optional (Some / Option setters).
Controls the use of split w^x mapping for the TCG code generation buffer. Some operating systems require this to be enabled, and in such a case this will default on. On other operating systems, this will default off, but one may enable this for testing or debugging.
Sourcepub fn tb_size(self, value: usize) -> AccelBuilder<SetTbSize<S>>where
S::TbSize: IsUnset,
pub fn tb_size(self, value: usize) -> AccelBuilder<SetTbSize<S>>where
S::TbSize: IsUnset,
Sourcepub fn maybe_tb_size(self, value: Option<usize>) -> AccelBuilder<SetTbSize<S>>where
S::TbSize: IsUnset,
pub fn maybe_tb_size(self, value: Option<usize>) -> AccelBuilder<SetTbSize<S>>where
S::TbSize: IsUnset,
Sourcepub fn dirty_ring_size(self, value: usize) -> AccelBuilder<SetDirtyRingSize<S>>where
S::DirtyRingSize: IsUnset,
pub fn dirty_ring_size(self, value: usize) -> AccelBuilder<SetDirtyRingSize<S>>where
S::DirtyRingSize: IsUnset,
Optional (Some / Option setters).
When the KVM accelerator is used, it controls the size of the per-vCPU dirty page ring buffer (number of entries for each vCPU). It should be a value that is power of two, and it should be 1024 or bigger (but still less than the maximum value that the kernel supports). 4096 could be a good initial value if you have no idea which is the best. Set this value to 0 to disable the feature. By default, this feature is disabled (dirty-ring-size=0). When enabled, KVM will instead record dirty pages in a bitmap.
Sourcepub fn maybe_dirty_ring_size(
self,
value: Option<usize>,
) -> AccelBuilder<SetDirtyRingSize<S>>where
S::DirtyRingSize: IsUnset,
pub fn maybe_dirty_ring_size(
self,
value: Option<usize>,
) -> AccelBuilder<SetDirtyRingSize<S>>where
S::DirtyRingSize: IsUnset,
Optional (Some / Option setters).
When the KVM accelerator is used, it controls the size of the per-vCPU dirty page ring buffer (number of entries for each vCPU). It should be a value that is power of two, and it should be 1024 or bigger (but still less than the maximum value that the kernel supports). 4096 could be a good initial value if you have no idea which is the best. Set this value to 0 to disable the feature. By default, this feature is disabled (dirty-ring-size=0). When enabled, KVM will instead record dirty pages in a bitmap.
Sourcepub fn eager_split_size(
self,
value: usize,
) -> AccelBuilder<SetEagerSplitSize<S>>where
S::EagerSplitSize: IsUnset,
pub fn eager_split_size(
self,
value: usize,
) -> AccelBuilder<SetEagerSplitSize<S>>where
S::EagerSplitSize: IsUnset,
Optional (Some / Option setters).
KVM implements dirty page logging at the PAGE_SIZE granularity and enabling dirty-logging on a huge-page requires breaking it into PAGE_SIZE pages in the first place. KVM on ARM does this splitting lazily by default. There are performance benefits in doing huge-page split eagerly, especially in situations where TLBI costs associated with break-before-make sequences are considerable and also if guest workloads are read intensive. The size here specifies how many pages to break at a time and needs to be a valid block size which is 1GB/2MB/4KB, 32MB/16KB and 512MB/64KB for 4KB/16KB/64KB PAGE_SIZE respectively. Be wary of specifying a higher size as it will have an impact on the memory. By default, this feature is disabled (eager-split-size=0).
Sourcepub fn maybe_eager_split_size(
self,
value: Option<usize>,
) -> AccelBuilder<SetEagerSplitSize<S>>where
S::EagerSplitSize: IsUnset,
pub fn maybe_eager_split_size(
self,
value: Option<usize>,
) -> AccelBuilder<SetEagerSplitSize<S>>where
S::EagerSplitSize: IsUnset,
Optional (Some / Option setters).
KVM implements dirty page logging at the PAGE_SIZE granularity and enabling dirty-logging on a huge-page requires breaking it into PAGE_SIZE pages in the first place. KVM on ARM does this splitting lazily by default. There are performance benefits in doing huge-page split eagerly, especially in situations where TLBI costs associated with break-before-make sequences are considerable and also if guest workloads are read intensive. The size here specifies how many pages to break at a time and needs to be a valid block size which is 1GB/2MB/4KB, 32MB/16KB and 512MB/64KB for 4KB/16KB/64KB PAGE_SIZE respectively. Be wary of specifying a higher size as it will have an impact on the memory. By default, this feature is disabled (eager-split-size=0).
Sourcepub fn notify_vmexit(
self,
value: Vec<NotifyVMExitType>,
) -> AccelBuilder<SetNotifyVmexit<S>>where
S::NotifyVmexit: IsUnset,
pub fn notify_vmexit(
self,
value: Vec<NotifyVMExitType>,
) -> AccelBuilder<SetNotifyVmexit<S>>where
S::NotifyVmexit: IsUnset,
Optional (Some / Option setters).
Enables or disables notify VM exit support on x86 host and specify
the corresponding notify window to trigger the VM exit if enabled.
run
option enables the feature. It does nothing and continue
if the exit happens. internal-error
option enables the feature.
It raises a internal error. disable
option doesn’t enable the feature.
This feature can mitigate the CPU stuck issue due to event windows don’t
open up for a specified of time (i.e. notify-window).
Default: notify-vmexit=run,notify-window=0.
Sourcepub fn maybe_notify_vmexit(
self,
value: Option<Vec<NotifyVMExitType>>,
) -> AccelBuilder<SetNotifyVmexit<S>>where
S::NotifyVmexit: IsUnset,
pub fn maybe_notify_vmexit(
self,
value: Option<Vec<NotifyVMExitType>>,
) -> AccelBuilder<SetNotifyVmexit<S>>where
S::NotifyVmexit: IsUnset,
Optional (Some / Option setters).
Enables or disables notify VM exit support on x86 host and specify
the corresponding notify window to trigger the VM exit if enabled.
run
option enables the feature. It does nothing and continue
if the exit happens. internal-error
option enables the feature.
It raises a internal error. disable
option doesn’t enable the feature.
This feature can mitigate the CPU stuck issue due to event windows don’t
open up for a specified of time (i.e. notify-window).
Default: notify-vmexit=run,notify-window=0.