sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget)/translations/zh_CN/virt/kvm/devices/vcpumodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/zh_TW/virt/kvm/devices/vcpumodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/it_IT/virt/kvm/devices/vcpumodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ja_JP/virt/kvm/devices/vcpumodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ko_KR/virt/kvm/devices/vcpumodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/sp_SP/virt/kvm/devices/vcpumodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhC/var/lib/git/docbuild/linux/Documentation/virt/kvm/devices/vcpu.rsthKubhsection)}(hhh](htitle)}(hGeneric vcpu interfaceh]hGeneric vcpu interface}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hThe virtual cpu "device" also accepts the ioctls KVM_SET_DEVICE_ATTR, KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same struct kvm_device_attr as other devices, but targets VCPU-wide settings and controls.h]hThe virtual cpu “device” also accepts the ioctls KVM_SET_DEVICE_ATTR, KVM_GET_DEVICE_ATTR, and KVM_HAS_DEVICE_ATTR. The interface uses the same struct kvm_device_attr as other devices, but targets VCPU-wide settings and controls.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hMThe groups and attributes per virtual cpu, if any, are architecture specific.h]hMThe groups and attributes per virtual cpu, if any, are architecture specific.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hhh](h)}(h"1. GROUP: KVM_ARM_VCPU_PMU_V3_CTRLh]h"1. GROUP: KVM_ARM_VCPU_PMU_V3_CTRL}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh field_list)}(hhh]hfield)}(hhh](h field_name)}(h Architecturesh]h Architectures}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhhhKubh field_body)}(hARM64 h]h)}(hARM64h]hARM64}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h'1.1. ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_IRQh]h'1.1. ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_IRQ}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8hhhhhKubh)}(hhh]h)}(hhh](j)}(h Parametersh]h Parameters}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjLhhhKubj)}(hVin kvm_device_attr.addr the address for PMU overflow interrupt is a pointer to an int h]h)}(hUin kvm_device_attr.addr the address for PMU overflow interrupt is a pointer to an inth]hUin kvm_device_attr.addr the address for PMU overflow interrupt is a pointer to an int}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj]ubah}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1hhhhKhjIhhubah}(h]h ]h"]h$]h&]uh1hhj8hhhhhKubh)}(hReturns:h]hReturns:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8hhubh block_quote)}(hX======= ======================================================== -EBUSY The PMU overflow interrupt is already set -EFAULT Error reading interrupt number -ENXIO PMUv3 not supported or the overflow interrupt not set when attempting to get it -ENODEV KVM_ARM_VCPU_PMU_V3 feature missing from VCPU -EINVAL Invalid PMU overflow interrupt number supplied or trying to set the IRQ number without using an in-kernel irqchip. ======= ======================================================== h]htable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK8uh1jhjubhtbody)}(hhh](hrow)}(hhh](hentry)}(hhh]h)}(h-EBUSYh]h-EBUSY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h)The PMU overflow interrupt is already seth]h)The PMU overflow interrupt is already set}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-EFAULTh]h-EFAULT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hError reading interrupt numberh]hError reading interrupt number}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj/ubah}(h]h ]h"]h$]h&]uh1jhj,ubj)}(hhh]h)}(hOPMUv3 not supported or the overflow interrupt not set when attempting to get ith]hOPMUv3 not supported or the overflow interrupt not set when attempting to get it}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjFubah}(h]h ]h"]h$]h&]uh1jhj,ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENODEVh]h-ENODEV}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjfubah}(h]h ]h"]h$]h&]uh1jhjcubj)}(hhh]h)}(h-KVM_ARM_VCPU_PMU_V3 feature missing from VCPUh]h-KVM_ARM_VCPU_PMU_V3 feature missing from VCPU}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj}ubah}(h]h ]h"]h$]h&]uh1jhjcubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-EINVALh]h-EINVAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hrInvalid PMU overflow interrupt number supplied or trying to set the IRQ number without using an in-kernel irqchip.h]hrInvalid PMU overflow interrupt number supplied or trying to set the IRQ number without using an in-kernel irqchip.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhj8hhubh)}(hX-A value describing the PMUv3 (Performance Monitor Unit v3) overflow interrupt number for this vcpu. This interrupt could be a PPI or SPI, but the interrupt type must be same for each vcpu. As a PPI, the interrupt number is the same for all vcpus, while as an SPI it must be a separate number per vcpu.h]hX-A value describing the PMUv3 (Performance Monitor Unit v3) overflow interrupt number for this vcpu. This interrupt could be a PPI or SPI, but the interrupt type must be same for each vcpu. As a PPI, the interrupt number is the same for all vcpus, while as an SPI it must be a separate number per vcpu.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hj8hhubeh}(h]!attribute-kvm-arm-vcpu-pmu-v3-irqah ]h"]'1.1. attribute: kvm_arm_vcpu_pmu_v3_irqah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h'1.2 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_INITh]h'1.2 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_INIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK+ubh)}(hhh]h)}(hhh](j)}(h Parametersh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhhhKubj)}(h0no additional parameter in kvm_device_attr.addr h]h)}(h/no additional parameter in kvm_device_attr.addrh]h/no additional parameter in kvm_device_attr.addr}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hj%ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhK-hjhhubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK-ubh)}(hReturns:h]hReturns:}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hjhhubj)}(hXV======= ====================================================== -EEXIST Interrupt number already used -ENODEV PMUv3 not supported or GIC not initialized -ENXIO PMUv3 not supported, missing VCPU feature or interrupt number not set -EBUSY PMUv3 already initialized ======= ====================================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj^ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK6uh1jhj^ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h-EEXISTh]h-EEXIST}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hj{ubah}(h]h ]h"]h$]h&]uh1jhjxubj)}(hhh]h)}(hInterrupt number already usedh]hInterrupt number already used}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjubah}(h]h ]h"]h$]h&]uh1jhjxubeh}(h]h ]h"]h$]h&]uh1jhjuubj)}(hhh](j)}(hhh]h)}(h-ENODEVh]h-ENODEV}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h*PMUv3 not supported or GIC not initializedh]h*PMUv3 not supported or GIC not initialized}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjuubj)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hEPMUv3 not supported, missing VCPU feature or interrupt number not seth]hEPMUv3 not supported, missing VCPU feature or interrupt number not set}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjuubj)}(hhh](j)}(hhh]h)}(h-EBUSYh]h-EBUSY}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hj ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hPMUv3 already initializedh]hPMUv3 already initialized}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hj7ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjuubeh}(h]h ]h"]h$]h&]uh1jhj^ubeh}(h]h ]h"]h$]h&]colsKuh1jhj[ubah}(h]h ]h"]h$]h&]uh1jhjWubah}(h]h ]h"]h$]h&]uh1jhhhK1hjhhubh)}(hRequest the initialization of the PMUv3. If using the PMUv3 with an in-kernel virtual GIC implementation, this must be done after initializing the in-kernel irqchip.h]hRequest the initialization of the PMUv3. If using the PMUv3 with an in-kernel virtual GIC implementation, this must be done after initializing the in-kernel irqchip.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hjhhubeh}(h]"attribute-kvm-arm-vcpu-pmu-v3-initah ]h"]'1.2 attribute: kvm_arm_vcpu_pmu_v3_initah$]h&]uh1hhhhhhhhK+ubh)}(hhh](h)}(h)1.3 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_FILTERh]h)1.3 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_FILTER}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK>ubh)}(hhh](h)}(hhh](j)}(h Parametersh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhhhKubj)}(hiin kvm_device_attr.addr the address for a PMU event filter is a pointer to a struct kvm_pmu_event_filter h]h)}(hhin kvm_device_attr.addr the address for a PMU event filter is a pointer to a struct kvm_pmu_event_filterh]hhin kvm_device_attr.addr the address for a PMU event filter is a pointer to a struct kvm_pmu_event_filter}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhK@hjhhubh)}(hhh](j)}(hReturnsh]hReturns}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhhhKubj)}(hX======= ====================================================== -ENODEV PMUv3 not supported or GIC not initialized -ENXIO PMUv3 not properly configured or in-kernel irqchip not configured as required prior to calling this attribute -EBUSY PMUv3 already initialized or a VCPU has already run -EINVAL Invalid filter range ======= ====================================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK6uh1jhjubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h-ENODEVh]h-ENODEV}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h*PMUv3 not supported or GIC not initializedh]h*PMUv3 not supported or GIC not initialized}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhj2ubah}(h]h ]h"]h$]h&]uh1jhj/ubj)}(hhh]h)}(hmPMUv3 not properly configured or in-kernel irqchip not configured as required prior to calling this attributeh]hmPMUv3 not properly configured or in-kernel irqchip not configured as required prior to calling this attribute}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjIubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-EBUSYh]h-EBUSY}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjiubah}(h]h ]h"]h$]h&]uh1jhjfubj)}(hhh]h)}(h3PMUv3 already initialized or a VCPU has already runh]h3PMUv3 already initialized or a VCPU has already run}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjubah}(h]h ]h"]h$]h&]uh1jhjfubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-EINVALh]h-EINVAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hInvalid filter rangeh]hInvalid filter range}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhKChjhhubeh}(h]h ]h"]h$]h&]uh1hhjhhhhhK@ubh)}(hERequest the installation of a PMU event filter described as follows::h]hDRequest the installation of a PMU event filter described as follows:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhjhhubh literal_block)}(hstruct kvm_pmu_event_filter { __u16 base_event; __u16 nevents; #define KVM_PMU_EVENT_ALLOW 0 #define KVM_PMU_EVENT_DENY 1 __u8 action; __u8 pad[3]; };h]hstruct kvm_pmu_event_filter { __u16 base_event; __u16 nevents; #define KVM_PMU_EVENT_ALLOW 0 #define KVM_PMU_EVENT_DENY 1 __u8 action; __u8 pad[3]; };}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhKOhjhhubh)}(hXA filter range is defined as the range [@base_event, @base_event + @nevents), together with an @action (KVM_PMU_EVENT_ALLOW or KVM_PMU_EVENT_DENY). The first registered range defines the global policy (global ALLOW if the first @action is DENY, global DENY if the first @action is ALLOW). Multiple ranges can be programmed, and must fit within the event space defined by the PMU architecture (10 bits on ARMv8.0, 16 bits from ARMv8.1 onwards).h]hXA filter range is defined as the range [@base_event, @base_event + @nevents), together with an @action (KVM_PMU_EVENT_ALLOW or KVM_PMU_EVENT_DENY). The first registered range defines the global policy (global ALLOW if the first @action is DENY, global DENY if the first @action is ALLOW). Multiple ranges can be programmed, and must fit within the event space defined by the PMU architecture (10 bits on ARMv8.0, 16 bits from ARMv8.1 onwards).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKZhjhhubh)}(hX"Note: "Cancelling" a filter by registering the opposite action for the same range doesn't change the default action. For example, installing an ALLOW filter for event range [0:10) as the first filter and then applying a DENY action for the same range will leave the whole range as disabled.h]hX(Note: “Cancelling” a filter by registering the opposite action for the same range doesn’t change the default action. For example, installing an ALLOW filter for event range [0:10) as the first filter and then applying a DENY action for the same range will leave the whole range as disabled.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjhhubh)}(hRestrictions: Event 0 (SW_INCR) is never filtered, as it doesn't count a hardware event. Filtering event 0x1E (CHAIN) has no effect either, as it isn't strictly speaking an event. Filtering the cycle counter is possible using event 0x11 (CPU_CYCLES).h]hRestrictions: Event 0 (SW_INCR) is never filtered, as it doesn’t count a hardware event. Filtering event 0x1E (CHAIN) has no effect either, as it isn’t strictly speaking an event. Filtering the cycle counter is possible using event 0x11 (CPU_CYCLES).}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjhhubeh}(h]$attribute-kvm-arm-vcpu-pmu-v3-filterah ]h"])1.3 attribute: kvm_arm_vcpu_pmu_v3_filterah$]h&]uh1hhhhhhhhK>ubh)}(hhh](h)}(h*1.4 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_SET_PMUh]h*1.4 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_SET_PMU}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjIhhhhhKlubh)}(hhh](h)}(hhh](j)}(h Parametersh]h Parameters}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj]hhhKubj)}(hOin kvm_device_attr.addr the address to an int representing the PMU identifier. h]h)}(hNin kvm_device_attr.addr the address to an int representing the PMU identifier.h]hNin kvm_device_attr.addr the address to an int representing the PMU identifier.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjnubah}(h]h ]h"]h$]h&]uh1jhj]ubeh}(h]h ]h"]h$]h&]uh1hhhhKnhjZhhubh)}(hhh](j)}(hReturnsh]hReturns}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhhhKubj)}(hX======= ==================================================== -EBUSY PMUv3 already initialized, a VCPU has already run or an event filter has already been set -EFAULT Error accessing the PMU identifier -ENXIO PMU not found -ENODEV PMUv3 not supported or GIC not initialized -ENOMEM Could not allocate memory ======= ==================================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK4uh1jhjubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h-EBUSYh]h-EBUSY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKthjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hYPMUv3 already initialized, a VCPU has already run or an event filter has already been seth]hYPMUv3 already initialized, a VCPU has already run or an event filter has already been set}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKthjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-EFAULTh]h-EFAULT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h"Error accessing the PMU identifierh]h"Error accessing the PMU identifier}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhj/ubah}(h]h ]h"]h$]h&]uh1jhj,ubj)}(hhh]h)}(h PMU not foundh]h PMU not found}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjFubah}(h]h ]h"]h$]h&]uh1jhj,ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENODEVh]h-ENODEV}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhjfubah}(h]h ]h"]h$]h&]uh1jhjcubj)}(hhh]h)}(h*PMUv3 not supported or GIC not initializedh]h*PMUv3 not supported or GIC not initialized}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhj}ubah}(h]h ]h"]h$]h&]uh1jhjcubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENOMEMh]h-ENOMEM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hCould not allocate memoryh]hCould not allocate memory}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhKqhjZhhubeh}(h]h ]h"]h$]h&]uh1hhjIhhhhhKnubh)}(hXRequest that the VCPU uses the specified hardware PMU when creating guest events for the purpose of PMU emulation. The PMU identifier can be read from the "type" file for the desired PMU instance under /sys/devices (or, equivalent, /sys/bus/even_source). This attribute is particularly useful on heterogeneous systems where there are at least two CPU PMUs on the system. The PMU that is set for one VCPU will be used by all the other VCPUs. It isn't possible to set a PMU if a PMU event filter is already present.h]hXRequest that the VCPU uses the specified hardware PMU when creating guest events for the purpose of PMU emulation. The PMU identifier can be read from the “type” file for the desired PMU instance under /sys/devices (or, equivalent, /sys/bus/even_source). This attribute is particularly useful on heterogeneous systems where there are at least two CPU PMUs on the system. The PMU that is set for one VCPU will be used by all the other VCPUs. It isn’t possible to set a PMU if a PMU event filter is already present.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hjIhhubh)}(hXNote that KVM will not make any attempts to run the VCPU on the physical CPUs associated with the PMU specified by this attribute. This is entirely left to userspace. However, attempting to run the VCPU on a physical CPU not supported by the PMU will fail and KVM_RUN will return with exit_reason = KVM_EXIT_FAIL_ENTRY and populate the fail_entry struct by setting hardare_entry_failure_reason field to KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED and the cpu field to the processor id.h]hXNote that KVM will not make any attempts to run the VCPU on the physical CPUs associated with the PMU specified by this attribute. This is entirely left to userspace. However, attempting to run the VCPU on a physical CPU not supported by the PMU will fail and KVM_RUN will return with exit_reason = KVM_EXIT_FAIL_ENTRY and populate the fail_entry struct by setting hardare_entry_failure_reason field to KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED and the cpu field to the processor id.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjIhhubeh}(h]%attribute-kvm-arm-vcpu-pmu-v3-set-pmuah ]h"]*1.4 attribute: kvm_arm_vcpu_pmu_v3_set_pmuah$]h&]uh1hhhhhhhhKlubeh}(h]group-kvm-arm-vcpu-pmu-v3-ctrlah ]h"]"1. group: kvm_arm_vcpu_pmu_v3_ctrlah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h!2. GROUP: KVM_ARM_VCPU_TIMER_CTRLh]h!2. GROUP: KVM_ARM_VCPU_TIMER_CTRL}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"hhhhhKubh)}(hhh]h)}(hhh](j)}(h Architecturesh]h Architectures}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj6hhhKubj)}(hARM64 h]h)}(hARM64h]hARM64}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjGubah}(h]h ]h"]h$]h&]uh1jhj6ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj3hhubah}(h]h ]h"]h$]h&]uh1hhj"hhhhhKubh)}(hhh](h)}(hG2.1. ATTRIBUTES: KVM_ARM_VCPU_TIMER_IRQ_{VTIMER,PTIMER,HVTIMER,HPTIMER}h]hG2.1. ATTRIBUTES: KVM_ARM_VCPU_TIMER_IRQ_{VTIMER,PTIMER,HVTIMER,HPTIMER}}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjkhhhhhKubh)}(hhh]h)}(hhh](j)}(h Parametersh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhhhKubj)}(hSin kvm_device_attr.addr the address for the timer interrupt is a pointer to an int h]h)}(hRin kvm_device_attr.addr the address for the timer interrupt is a pointer to an inth]hRin kvm_device_attr.addr the address for the timer interrupt is a pointer to an int}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhj|hhubah}(h]h ]h"]h$]h&]uh1hhjkhhhhhKubh)}(hReturns:h]hReturns:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjkhhubj)}(h======= ================================= -EINVAL Invalid timer interrupt number -EBUSY One or more VCPUs has already run ======= ================================= h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK!uh1jhjubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h-EINVALh]h-EINVAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hInvalid timer interrupt numberh]hInvalid timer interrupt number}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-EBUSYh]h-EBUSY}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h!One or more VCPUs has already runh]h!One or more VCPUs has already run}(hj7 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj4 ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjkhhubh)}(hA value describing the architected timer interrupt number when connected to an in-kernel virtual GIC. These must be a PPI (16 <= intid < 32). Setting the attribute overrides the default values (see below).h]hA value describing the architected timer interrupt number when connected to an in-kernel virtual GIC. These must be a PPI (16 <= intid < 32). Setting the attribute overrides the default values (see below).}(hjj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjkhhubj)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj{ ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK*uh1jhj{ ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(hKVM_ARM_VCPU_TIMER_IRQ_VTIMERh]hKVM_ARM_VCPU_TIMER_IRQ_VTIMER}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h)The EL1 virtual timer intid (default: 27)h]h)The EL1 virtual timer intid (default: 27)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(hKVM_ARM_VCPU_TIMER_IRQ_PTIMERh]hKVM_ARM_VCPU_TIMER_IRQ_PTIMER}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h*The EL1 physical timer intid (default: 30)h]h*The EL1 physical timer intid (default: 30)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(hKVM_ARM_VCPU_TIMER_IRQ_HVTIMERh]hKVM_ARM_VCPU_TIMER_IRQ_HVTIMER}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h)The EL2 virtual timer intid (default: 28)h]h)The EL2 virtual timer intid (default: 28)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(hKVM_ARM_VCPU_TIMER_IRQ_HPTIMERh]hKVM_ARM_VCPU_TIMER_IRQ_HPTIMER}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj= ubah}(h]h ]h"]h$]h&]uh1jhj: ubj)}(hhh]h)}(h*The EL2 physical timer intid (default: 26)h]h*The EL2 physical timer intid (default: 26)}(hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjT ubah}(h]h ]h"]h$]h&]uh1jhj: ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj{ ubeh}(h]h ]h"]h$]h&]colsKuh1jhjx ubah}(h]h ]h"]h$]h&]uh1jhjkhhhhhNubh)}(hXSetting the same PPI for different timers will prevent the VCPUs from running. Setting the interrupt number on a VCPU configures all VCPUs created at that time to use the number provided for a given timer, overwriting any previously configured values on other VCPUs. Userspace should configure the interrupt numbers on at least one VCPU after creating all VCPUs and before running any VCPUs.h]hXSetting the same PPI for different timers will prevent the VCPUs from running. Setting the interrupt number on a VCPU configures all VCPUs created at that time to use the number provided for a given timer, overwriting any previously configured values on other VCPUs. Userspace should configure the interrupt numbers on at least one VCPU after creating all VCPUs and before running any VCPUs.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjkhhubhtarget)}(h.. _kvm_arm_vcpu_pvtime_ctrl:h]h}(h]h ]h"]h$]h&]refidkvm-arm-vcpu-pvtime-ctrluh1j hKhjkhhhhubeh}(h]?attributes-kvm-arm-vcpu-timer-irq-vtimer-ptimer-hvtimer-hptimerah ]h"]G2.1. attributes: kvm_arm_vcpu_timer_irq_{vtimer,ptimer,hvtimer,hptimer}ah$]h&]uh1hhj"hhhhhKubeh}(h]group-kvm-arm-vcpu-timer-ctrlah ]h"]!2. group: kvm_arm_vcpu_timer_ctrlah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h"3. GROUP: KVM_ARM_VCPU_PVTIME_CTRLh]h"3. GROUP: KVM_ARM_VCPU_PVTIME_CTRL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hhh]h)}(hhh](j)}(h Architecturesh]h Architectures}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj hhhKubj)}(hARM64 h]h)}(hARM64h]hARM64}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hhh](h)}(h&3.1 ATTRIBUTE: KVM_ARM_VCPU_PVTIME_IPAh]h&3.1 ATTRIBUTE: KVM_ARM_VCPU_PVTIME_IPA}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hhh]h)}(hhh](j)}(h Parametersh]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj hhhKubj)}(h64-bit base address h]h)}(h64-bit base addressh]h64-bit base address}(hj" hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hReturns:h]hReturns:}(hjB hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(h======= ====================================== -ENXIO Stolen time not implemented -EEXIST Base address already set for this VCPU -EINVAL Base address not 64 byte aligned ======= ====================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjW ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK&uh1jhjW ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hjw hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjt ubah}(h]h ]h"]h$]h&]uh1jhjq ubj)}(hhh]h)}(hStolen time not implementedh]hStolen time not implemented}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhjq ubeh}(h]h ]h"]h$]h&]uh1jhjn ubj)}(hhh](j)}(hhh]h)}(h-EEXISTh]h-EEXIST}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h&Base address already set for this VCPUh]h&Base address already set for this VCPU}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjn ubj)}(hhh](j)}(hhh]h)}(h-EINVALh]h-EINVAL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h Base address not 64 byte alignedh]h Base address not 64 byte aligned}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjn ubeh}(h]h ]h"]h$]h&]uh1jhjW ubeh}(h]h ]h"]h$]h&]colsKuh1jhjT ubah}(h]h ]h"]h$]h&]uh1jhjP ubah}(h]h ]h"]h$]h&]uh1jhhhKhj hhubh)}(hXSpecifies the base address of the stolen time structure for this VCPU. The base address must be 64 byte aligned and exist within a valid guest memory region. See Documentation/virt/kvm/arm/pvtime.rst for more information including the layout of the stolen time structure.h]hXSpecifies the base address of the stolen time structure for this VCPU. The base address must be 64 byte aligned and exist within a valid guest memory region. See Documentation/virt/kvm/arm/pvtime.rst for more information including the layout of the stolen time structure.}(hj/ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubeh}(h]!attribute-kvm-arm-vcpu-pvtime-ipaah ]h"]&3.1 attribute: kvm_arm_vcpu_pvtime_ipaah$]h&]uh1hhj hhhhhKubeh}(h](group-kvm-arm-vcpu-pvtime-ctrlj eh ]h"]("3. group: kvm_arm_vcpu_pvtime_ctrlkvm_arm_vcpu_pvtime_ctrleh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}jK j sexpect_referenced_by_id}j j subh)}(hhh](h)}(h4. GROUP: KVM_VCPU_TSC_CTRLh]h4. GROUP: KVM_VCPU_TSC_CTRL}(hjU hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjR hhhhhKubh)}(hhh]h)}(hhh](j)}(h Architecturesh]h Architectures}(hji hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjf hhhKubj)}(hx86 h]h)}(hx86h]hx86}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjw ubah}(h]h ]h"]h$]h&]uh1jhjf ubeh}(h]h ]h"]h$]h&]uh1hhhhKhjc hhubah}(h]h ]h"]h$]h&]uh1hhjR hhhhhKubh)}(h"4.1 ATTRIBUTE: KVM_VCPU_TSC_OFFSETh]h"4.1 ATTRIBUTE: KVM_VCPU_TSC_OFFSET}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjR hhubh)}(hhh]h)}(hhh](j)}(h Parametersh]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj hhhKubj)}(h64-bit unsigned TSC offset h]h)}(h64-bit unsigned TSC offseth]h64-bit unsigned TSC offset}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubah}(h]h ]h"]h$]h&]uh1hhjR hhhhhKubh)}(hReturns:h]hReturns:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjR hhubj)}(h======= ====================================== -EFAULT Error reading/writing the provided parameter address. -ENXIO Attribute not supported ======= ====================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK&uh1jhj ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h-EFAULTh]h-EFAULT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h5Error reading/writing the provided parameter address.h]h5Error reading/writing the provided parameter address.}(hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj* ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjJ ubah}(h]h ]h"]h$]h&]uh1jhjG ubj)}(hhh]h)}(hAttribute not supportedh]hAttribute not supported}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhja ubah}(h]h ]h"]h$]h&]uh1jhjG ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]colsKuh1jhj ubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhhhKhjR hhubh)}(hwSpecifies the guest's TSC offset relative to the host's TSC. The guest's TSC is then derived by the following equation:h]h}Specifies the guest’s TSC offset relative to the host’s TSC. The guest’s TSC is then derived by the following equation:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjR hhubj)}(h+guest_tsc = host_tsc + KVM_VCPU_TSC_OFFSET h]h)}(h*guest_tsc = host_tsc + KVM_VCPU_TSC_OFFSETh]h*guest_tsc = host_tsc + KVM_VCPU_TSC_OFFSET}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhhhKhjR hhubh)}(hThis attribute is useful to adjust the guest's TSC on live migration, so that the TSC counts the time during which the VM was paused. The following describes a possible algorithm to use for this purpose.h]hThis attribute is useful to adjust the guest’s TSC on live migration, so that the TSC counts the time during which the VM was paused. The following describes a possible algorithm to use for this purpose.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjR hhubh)}(hFrom the source VMM process:h]hFrom the source VMM process:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjR hhubhenumerated_list)}(hhh](h list_item)}(hInvoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_src), kvmclock nanoseconds (guest_src), and host CLOCK_REALTIME nanoseconds (host_src). h]h)}(hInvoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_src), kvmclock nanoseconds (guest_src), and host CLOCK_REALTIME nanoseconds (host_src).h]hInvoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_src), kvmclock nanoseconds (guest_src), and host CLOCK_REALTIME nanoseconds (host_src).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hj hhhhhNubj )}(hcRead the KVM_VCPU_TSC_OFFSET attribute for every vCPU to record the guest TSC offset (ofs_src[i]). h]h)}(hbRead the KVM_VCPU_TSC_OFFSET attribute for every vCPU to record the guest TSC offset (ofs_src[i]).h]hbRead the KVM_VCPU_TSC_OFFSET attribute for every vCPU to record the guest TSC offset (ofs_src[i]).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hj hhhhhNubj )}(hTInvoke the KVM_GET_TSC_KHZ ioctl to record the frequency of the guest's TSC (freq). h]h)}(hSInvoke the KVM_GET_TSC_KHZ ioctl to record the frequency of the guest's TSC (freq).h]hUInvoke the KVM_GET_TSC_KHZ ioctl to record the frequency of the guest’s TSC (freq).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hj hhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1j hjR hhhhhKubh)}(h!From the destination VMM process:h]h!From the destination VMM process:}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjR hhubj )}(hhh](j )}(hX=Invoke the KVM_SET_CLOCK ioctl, providing the source nanoseconds from kvmclock (guest_src) and CLOCK_REALTIME (host_src) in their respective fields. Ensure that the KVM_CLOCK_REALTIME flag is set in the provided structure. KVM will advance the VM's kvmclock to account for elapsed time since recording the clock values. Note that this will cause problems in the guest (e.g., timeouts) unless CLOCK_REALTIME is synchronized between the source and destination, and a reasonably short time passes between the source pausing the VMs and the destination executing steps 4-7. h](h)}(hInvoke the KVM_SET_CLOCK ioctl, providing the source nanoseconds from kvmclock (guest_src) and CLOCK_REALTIME (host_src) in their respective fields. Ensure that the KVM_CLOCK_REALTIME flag is set in the provided structure.h]hInvoke the KVM_SET_CLOCK ioctl, providing the source nanoseconds from kvmclock (guest_src) and CLOCK_REALTIME (host_src) in their respective fields. Ensure that the KVM_CLOCK_REALTIME flag is set in the provided structure.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDubh)}(hX[KVM will advance the VM's kvmclock to account for elapsed time since recording the clock values. Note that this will cause problems in the guest (e.g., timeouts) unless CLOCK_REALTIME is synchronized between the source and destination, and a reasonably short time passes between the source pausing the VMs and the destination executing steps 4-7.h]hX]KVM will advance the VM’s kvmclock to account for elapsed time since recording the clock values. Note that this will cause problems in the guest (e.g., timeouts) unless CLOCK_REALTIME is synchronized between the source and destination, and a reasonably short time passes between the source pausing the VMs and the destination executing steps 4-7.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDubeh}(h]h ]h"]h$]h&]uh1j hjAhhhhhNubj )}(hhInvoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_dest) and kvmclock nanoseconds (guest_dest). h]h)}(hgInvoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_dest) and kvmclock nanoseconds (guest_dest).h]hgInvoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_dest) and kvmclock nanoseconds (guest_dest).}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjubah}(h]h ]h"]h$]h&]uh1j hjAhhhhhNubj )}(hXAdjust the guest TSC offsets for every vCPU to account for (1) time elapsed since recording state and (2) difference in TSCs between the source and destination machine: ofs_dst[i] = ofs_src[i] - (guest_src - guest_dest) * freq + (tsc_src - tsc_dest) ("ofs[i] + tsc - guest * freq" is the guest TSC value corresponding to a time of 0 in kvmclock. The above formula ensures that it is the same on the destination as it was on the source). h](h)}(hAdjust the guest TSC offsets for every vCPU to account for (1) time elapsed since recording state and (2) difference in TSCs between the source and destination machine:h]hAdjust the guest TSC offsets for every vCPU to account for (1) time elapsed since recording state and (2) difference in TSCs between the source and destination machine:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubhdefinition_list)}(hhh]hdefinition_list_item)}(hQofs_dst[i] = ofs_src[i] - (guest_src - guest_dest) * freq + (tsc_src - tsc_dest) h](hterm)}(hofs_dst[i] = ofs_src[i] -h]hofs_dst[i] = ofs_src[i] -}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubh definition)}(hhh]h)}(h6(guest_src - guest_dest) * freq + (tsc_src - tsc_dest)h]h6(guest_src - guest_dest) * freq + (tsc_src - tsc_dest)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h("ofs[i] + tsc - guest * freq" is the guest TSC value corresponding to a time of 0 in kvmclock. The above formula ensures that it is the same on the destination as it was on the source).h]h(“ofs[i] + tsc - guest * freq” is the guest TSC value corresponding to a time of 0 in kvmclock. The above formula ensures that it is the same on the destination as it was on the source).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1j hjAhhhhhNubj )}(hnWrite the KVM_VCPU_TSC_OFFSET attribute for every vCPU with the respective value derived in the previous step.h]h)}(hnWrite the KVM_VCPU_TSC_OFFSET attribute for every vCPU with the respective value derived in the previous step.h]hnWrite the KVM_VCPU_TSC_OFFSET attribute for every vCPU with the respective value derived in the previous step.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubah}(h]h ]h"]h$]h&]uh1j hjAhhhhhNubeh}(h]h ]h"]h$]h&]j.j/j0hj1j2startKuh1j hjR hhhhhKubeh}(h]group-kvm-vcpu-tsc-ctrlah ]h"]4. group: kvm_vcpu_tsc_ctrlah$]h&]uh1hhhhhhhhKubeh}(h]generic-vcpu-interfaceah ]h"]generic vcpu interfaceah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj9error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}j ]j asnameids}(jjjjjjjj}jFjCjjj j j j jK j jJ jG jB j? j j u nametypes}(jjjjjFjj j jK jJ jB j uh}(jhjhjj8j}jjCjjjIj j"j jkj j jG j j? j j jR u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]hsystem_message)}(hhh]h)}(h:Enumerated list start value not ordinal-1: "4" (ordinal 4)h]h>Enumerated list start value not ordinal-1: “4” (ordinal 4)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1jhjR hhhhhKubatransform_messages]j)}(hhh]h)}(hhh]h>Hyperlink target "kvm-arm-vcpu-pvtime-ctrl" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineKuh1juba transformerN include_log] decorationNhhub.