AccelBuilder

Struct AccelBuilder 

Source
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>

Source

pub fn build(self) -> Accel
where S: IsComplete,

Finish building and return the requested object

Source

pub fn accel_type(self, value: AccelType) -> AccelBuilder<SetAccelType<S>>
where S::AccelType: IsUnset,

Required.

Source

pub fn igd_passthru( self, value: OnOffDefaultOff, ) -> AccelBuilder<SetIgdPassthru<S>>
where S::IgdPassthru: IsUnset,

Optional (Some / Option setters).

When Xen is in use, this option controls whether Intel integrated graphics devices can be passed through to the guest (default=off)

Source

pub fn maybe_igd_passthru( self, value: Option<OnOffDefaultOff>, ) -> AccelBuilder<SetIgdPassthru<S>>
where S::IgdPassthru: IsUnset,

Optional (Some / Option setters).

When Xen is in use, this option controls whether Intel integrated graphics devices can be passed through to the guest (default=off)

Source

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.

Source

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.

Source

pub fn kvm_shadow_mem(self, value: usize) -> AccelBuilder<SetKvmShadowMem<S>>
where S::KvmShadowMem: IsUnset,

Optional (Some / Option setters).

Defines the size of the KVM shadow MMU.

Source

pub fn maybe_kvm_shadow_mem( self, value: Option<usize>, ) -> AccelBuilder<SetKvmShadowMem<S>>
where S::KvmShadowMem: IsUnset,

Optional (Some / Option setters).

Defines the size of the KVM shadow MMU.

Source

pub fn one_insn_per_tb(self, value: OnOff) -> AccelBuilder<SetOneInsnPerTb<S>>
where S::OneInsnPerTb: IsUnset,

Optional (Some / Option setters).

Makes the TCG accelerator put only one guest instruction into each translation block. This slows down emulation a lot, but can be useful in some situations, such as when trying to analyse the logs produced by the -d option.

Source

pub fn maybe_one_insn_per_tb( self, value: Option<OnOff>, ) -> AccelBuilder<SetOneInsnPerTb<S>>
where S::OneInsnPerTb: IsUnset,

Optional (Some / Option setters).

Makes the TCG accelerator put only one guest instruction into each translation block. This slows down emulation a lot, but can be useful in some situations, such as when trying to analyse the logs produced by the -d option.

Source

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.

Source

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.

Source

pub fn tb_size(self, value: usize) -> AccelBuilder<SetTbSize<S>>
where S::TbSize: IsUnset,

Optional (Some / Option setters).

Controls the size (in MiB) of the TCG translation block cache.

Source

pub fn maybe_tb_size(self, value: Option<usize>) -> AccelBuilder<SetTbSize<S>>
where S::TbSize: IsUnset,

Optional (Some / Option setters).

Controls the size (in MiB) of the TCG translation block cache.

Source

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.

Source

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.

Source

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).

Source

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).

Source

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.

Source

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.

Source

pub fn thread(self, value: TCGThreadType) -> AccelBuilder<SetThread<S>>
where S::Thread: IsUnset,

Optional (Some / Option setters).

Enable single or multi-threaded TCG

Source

pub fn maybe_thread( self, value: Option<TCGThreadType>, ) -> AccelBuilder<SetThread<S>>
where S::Thread: IsUnset,

Optional (Some / Option setters).

Enable single or multi-threaded TCG

Source

pub fn device(self, value: PathBuf) -> AccelBuilder<SetDevice<S>>
where S::Device: IsUnset,

Optional (Some / Option setters).

Sets the path to the KVM device node. Defaults to /dev/kvm. This option can be used to pass the KVM device to use via a file descriptor by setting the value to /dev/fdset/NN.

Source

pub fn maybe_device(self, value: Option<PathBuf>) -> AccelBuilder<SetDevice<S>>
where S::Device: IsUnset,

Optional (Some / Option setters).

Sets the path to the KVM device node. Defaults to /dev/kvm. This option can be used to pass the KVM device to use via a file descriptor by setting the value to /dev/fdset/NN.

Auto Trait Implementations§

§

impl<S> Freeze for AccelBuilder<S>

§

impl<S> RefUnwindSafe for AccelBuilder<S>

§

impl<S> Send for AccelBuilder<S>

§

impl<S> Sync for AccelBuilder<S>

§

impl<S> Unpin for AccelBuilder<S>

§

impl<S> UnwindSafe for AccelBuilder<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.