qsphinx.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]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/pt_BR/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&]uh1jhjhhhKubh field_body)}(hARM64 h]h)}(hARM64h]hARM64}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj(ubah}(h]h ]h"]h$]h&]uh1j&hjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubah}(h]h ]h"]h$]h&]uh1j hhhhhhhKubh)}(hhh](h)}(h'1.1. ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_IRQh]h'1.1. ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_IRQ}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjLhhhhhKubj )}(hhh]j)}(hhh](j)}(h Parametersh]h Parameters}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1jhj`hhhKubj')}(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}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjqubah}(h]h ]h"]h$]h&]uh1j&hj`ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj]hhubah}(h]h ]h"]h$]h&]uh1j hjLhhhhhKubh)}(hReturns:h]hReturns:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjLhhubh 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&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(hError reading interrupt numberh]hError reading interrupt number}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj#ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjCubah}(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}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjZubah}(h]h ]h"]h$]h&]uh1jhj@ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENODEVh]h-ENODEV}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjzubah}(h]h ]h"]h$]h&]uh1jhjwubj)}(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&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjwubeh}(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&]uh1jhhhKhjLhhubh)}(hXlA 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. For GICv5-based guests, the architected PPI (23) must be used.h]hXlA 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. For GICv5-based guests, the architected PPI (23) must be used.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjLhhubeh}(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,ubj )}(hhh]j)}(hhh](j)}(h Parametersh]h Parameters}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj(hhhKubj')}(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.hj9ubah}(h]h ]h"]h$]h&]uh1j&hj(ubeh}(h]h ]h"]h$]h&]uh1jhhhK.hj%hhubah}(h]h ]h"]h$]h&]uh1j hjhhhhhK.ubh)}(hReturns:h]hReturns:}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hjhhubj)}(hXo======= ====================================================== -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 (non-GICv5 guests, only) -EBUSY PMUv3 already initialized ======= ====================================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjrubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK6uh1jhjrubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h-EEXISTh]h-EEXIST}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hInterrupt number already usedh]hInterrupt number already used}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENODEVh]h-ENODEV}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(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&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h^PMUv3 not supported, missing VCPU feature or interrupt number not set (non-GICv5 guests, only)h]h^PMUv3 not supported, missing VCPU feature or interrupt number not set (non-GICv5 guests, only)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-EBUSYh]h-EBUSY}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hj4ubah}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh]h)}(hPMUv3 already initializedh]hPMUv3 already initialized}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hjKubah}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjrubeh}(h]h ]h"]h$]h&]colsKuh1jhjoubah}(h]h ]h"]h$]h&]uh1jhjkubah}(h]h ]h"]h$]h&]uh1jhhhK2hjhhubh)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjhhubeh}(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?ubj )}(hhh](j)}(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&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1j&hjubeh}(h]h ]h"]h$]h&]uh1jhhhKAhjhhubj)}(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&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h*PMUv3 not supported or GIC not initializedh]h*PMUv3 not supported or GIC not initialized}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhj&ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhjFubah}(h]h ]h"]h$]h&]uh1jhjCubj)}(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}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhj]ubah}(h]h ]h"]h$]h&]uh1jhjCubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h-EBUSYh]h-EBUSY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhj}ubah}(h]h ]h"]h$]h&]uh1jhjzubj)}(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&]uh1hhhhKJhjubah}(h]h ]h"]h$]h&]uh1jhjzubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h-EINVALh]h-EINVAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hInvalid filter rangeh]hInvalid filter range}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j&hjubeh}(h]h ]h"]h$]h&]uh1jhhhKDhjhhubeh}(h]h ]h"]h$]h&]uh1j hjhhhhhKAubh)}(hERequest the installation of a PMU event filter described as follows::h]hDRequest the installation of a PMU event filter described as follows:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjhhubh 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]; };}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKPhjhhubh)}(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).}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hjhhubh)}(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.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjhhubh)}(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).}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjhhubeh}(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}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj]hhhhhKmubj )}(hhh](j)}(hhh](j)}(h Parametersh]h Parameters}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1jhjqhhhKubj')}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjubah}(h]h ]h"]h$]h&]uh1j&hjqubeh}(h]h ]h"]h$]h&]uh1jhhhKohjnhhubj)}(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&]uh1hhhhKuhjubah}(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&]uh1hhhhKuhjubah}(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&]uh1hhhhKwhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h"Error accessing the PMU identifierh]h"Error accessing the PMU identifier}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhj#ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhjCubah}(h]h ]h"]h$]h&]uh1jhj@ubj)}(hhh]h)}(h PMU not foundh]h PMU not found}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhjZubah}(h]h ]h"]h$]h&]uh1jhj@ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENODEVh]h-ENODEV}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjzubah}(h]h ]h"]h$]h&]uh1jhjwubj)}(hhh]h)}(h*PMUv3 not supported or GIC not initializedh]h*PMUv3 not supported or GIC not initialized}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjubah}(h]h ]h"]h$]h&]uh1jhjwubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENOMEMh]h-ENOMEM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hCould not allocate memoryh]hCould not allocate memory}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhjubah}(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&]uh1j&hjubeh}(h]h ]h"]h$]h&]uh1jhhhKrhjnhhubeh}(h]h ]h"]h$]h&]uh1j hj]hhhhhKoubh)}(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.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK}hj]hhubh)}(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&]uh1hhhhKhj]hhubeh}(h]%attribute-kvm-arm-vcpu-pmu-v3-set-pmuah ]h"]*1.4 attribute: kvm_arm_vcpu_pmu_v3_set_pmuah$]h&]uh1hhhhhhhhKmubh)}(hhh](h)}(h21.5 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_SET_NR_COUNTERSh]h21.5 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_SET_NR_COUNTERS}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.hhhhhKubj )}(hhh](j)}(hhh](j)}(h Parametersh]h Parameters}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBhhhKubj')}(hjin kvm_device_attr.addr the address to an unsigned int representing the maximum value taken by PMCR_EL0.N h]h)}(hiin kvm_device_attr.addr the address to an unsigned int representing the maximum value taken by PMCR_EL0.Nh]hiin kvm_device_attr.addr the address to an unsigned int representing the maximum value taken by PMCR_EL0.N}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjSubah}(h]h ]h"]h$]h&]uh1j&hjBubeh}(h]h ]h"]h$]h&]uh1jhhhKhj?hhubj)}(hhh](j)}(hReturnsh]hReturns}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1jhjqhhhKubj')}(hX======= ==================================================== -EBUSY PMUv3 already initialized, a VCPU has already run or an event filter has already been set -EFAULT Error accessing the value pointed to by addr -ENODEV PMUv3 not supported or GIC not initialized -EINVAL No PMUv3 explicitly selected, or value of N out of range ======= ==================================================== 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&]uh1hhhhKhjubah}(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&]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)}(h,Error accessing the value pointed to by addrh]h,Error accessing the value pointed to by addr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-ENODEVh]h-ENODEV}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h*PMUv3 not supported or GIC not initializedh]h*PMUv3 not supported or GIC not initialized}(hj. hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj+ ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h-EINVALh]h-EINVAL}(hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjK ubah}(h]h ]h"]h$]h&]uh1jhjH ubj)}(hhh]h)}(h8No PMUv3 explicitly selected, or value of N out of rangeh]h8No PMUv3 explicitly selected, or value of N out of range}(hje hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjb ubah}(h]h ]h"]h$]h&]uh1jhjH 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&]uh1j&hjqubeh}(h]h ]h"]h$]h&]uh1jhhhKhj?hhubeh}(h]h ]h"]h$]h&]uh1j hj.hhhhhKubh)}(hXQSet the number of implemented event counters in the virtual PMU. This mandates that a PMU has explicitly been selected via KVM_ARM_VCPU_PMU_V3_SET_PMU, and will fail when no PMU has been explicitly selected, or the number of counters is out of range for the selected PMU. Selecting a new PMU cancels the effect of setting this attribute.h]hXQSet the number of implemented event counters in the virtual PMU. This mandates that a PMU has explicitly been selected via KVM_ARM_VCPU_PMU_V3_SET_PMU, and will fail when no PMU has been explicitly selected, or the number of counters is out of range for the selected PMU. Selecting a new PMU cancels the effect of setting this attribute.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj.hhubeh}(h]-attribute-kvm-arm-vcpu-pmu-v3-set-nr-countersah ]h"]21.5 attribute: kvm_arm_vcpu_pmu_v3_set_nr_countersah$]h&]uh1hhhhhhhhKubeh}(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 hhhhhKubj )}(hhh]j)}(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&]uh1j&hj ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubah}(h]h ]h"]h$]h&]uh1j hj 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}}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubj )}(hhh]j)}(hhh](j)}(h Parametersh]h Parameters}(hj" hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj hhhKubj')}(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}(hj4 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj0 ubah}(h]h ]h"]h$]h&]uh1j&hj ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubah}(h]h ]h"]h$]h&]uh1j hj hhhhhKubh)}(hReturns:h]hReturns:}(hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(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&]colwidthKuh1jhji ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK!uh1jhji ubj)}(hhh](j)}(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)}(hInvalid timer interrupt numberh]hInvalid timer interrupt number}(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-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}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhji ubeh}(h]h ]h"]h$]h&]colsKuh1jhjf ubah}(h]h ]h"]h$]h&]uh1jhjb ubah}(h]h ]h"]h$]h&]uh1jhhhKhj hhubh)}(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).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(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&]uh1hhhhKhj8 ubah}(h]h ]h"]h$]h&]uh1jhj5 ubj)}(hhh]h)}(h)The EL1 virtual timer intid (default: 27)h]h)The EL1 virtual timer intid (default: 27)}(hjR hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjO ubah}(h]h ]h"]h$]h&]uh1jhj5 ubeh}(h]h ]h"]h$]h&]uh1jhj2 ubj)}(hhh](j)}(hhh]h)}(hKVM_ARM_VCPU_TIMER_IRQ_PTIMERh]hKVM_ARM_VCPU_TIMER_IRQ_PTIMER}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjo ubah}(h]h ]h"]h$]h&]uh1jhjl 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&]uh1jhjl ubeh}(h]h ]h"]h$]h&]uh1jhj2 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&]uh1jhj2 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)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj2 ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]colsKuh1jhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubh)}(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&]uh1hhhhKhj hhubhtarget)}(h.. _kvm_arm_vcpu_pvtime_ctrl:h]h}(h]h ]h"]h$]h&]refidkvm-arm-vcpu-pvtime-ctrluh1j2 hKhj hhhhubeh}(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}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjP hhhhhKubj )}(hhh]j)}(hhh](j)}(h Architecturesh]h Architectures}(hjg hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjd hhhKubj')}(hARM64 h]h)}(hARM64h]hARM64}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhju ubah}(h]h ]h"]h$]h&]uh1j&hjd ubeh}(h]h ]h"]h$]h&]uh1jhhhKhja hhubah}(h]h ]h"]h$]h&]uh1j hjP 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 hhhhhKubj )}(hhh]j)}(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&]uh1j&hj ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubah}(h]h ]h"]h$]h&]uh1j hj hhhhhKubh)}(hReturns:h]hReturns:}(hj 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&]colwidthKuh1jhj ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK&uh1jhj ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h-ENXIOh]h-ENXIO}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj 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&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h-EEXISTh]h-EEXIST}(hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjK ubah}(h]h ]h"]h$]h&]uh1jhjH ubj)}(hhh]h)}(h&Base address already set for this VCPUh]h&Base address already set for this VCPU}(hje hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjb ubah}(h]h ]h"]h$]h&]uh1jhjH ubeh}(h]h ]h"]h$]h&]uh1jhj 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&]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&]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&]uh1hhjP hhhhhKubeh}(h](group-kvm-arm-vcpu-pvtime-ctrlj? eh ]h"]("3. group: kvm_arm_vcpu_pvtime_ctrlkvm_arm_vcpu_pvtime_ctrleh$]h&]uh1hhhhhhhhǨexpect_referenced_by_name}j j4 sexpect_referenced_by_id}j? j4 subh)}(hhh](h)}(h4. GROUP: KVM_VCPU_TSC_CTRLh]h4. GROUP: KVM_VCPU_TSC_CTRL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubj )}(hhh]j)}(hhh](j)}(h Architecturesh]h Architectures}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhhhKubj')}(hx86 h]h)}(hx86h]hx86}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j&hjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubah}(h]h ]h"]h$]h&]uh1j hj hhhhhKubh)}(h"4.1 ATTRIBUTE: KVM_VCPU_TSC_OFFSETh]h"4.1 ATTRIBUTE: KVM_VCPU_TSC_OFFSET}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj )}(hhh]j)}(hhh](j)}(h Parametersh]h Parameters}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjLhhhKubj')}(h64-bit unsigned TSC offset h]h)}(h64-bit unsigned TSC offseth]h64-bit unsigned TSC offset}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj]ubah}(h]h ]h"]h$]h&]uh1j&hjLubeh}(h]h ]h"]h$]h&]uh1jhhhKhjIhhubah}(h]h ]h"]h$]h&]uh1j hj hhhhhKubh)}(hReturns:h]hReturns:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj 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&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK&uh1jhjubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h-EFAULTh]h-EFAULT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h5Error reading/writing the provided parameter address.h]h5Error reading/writing the provided parameter address.}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hAttribute not supportedh]hAttribute not supported}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(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&]uh1jhhhKhj 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:}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj 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}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjEubah}(h]h ]h"]h$]h&]uh1jhhhKhj 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&]uh1hhhhKhj hhubh)}(hFrom the source VMM process:h]hFrom the source VMM process:}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj 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).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(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]).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(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&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j~hj{hhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jyhj hhhhhKubh)}(h!From the destination VMM process:h]h!From the destination VMM process:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubjz)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubh)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1j~hjhhhhhNubj)}(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).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j~hjhhhhhNubj)}(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:}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubhdefinition_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] -}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1j?hhhMhj;ubh definition)}(hhh]h)}(h6(guest_src - guest_dest) * freq + (tsc_src - tsc_dest)h]h6(guest_src - guest_dest) * freq + (tsc_src - tsc_dest)}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjQubah}(h]h ]h"]h$]h&]uh1jOhj;ubeh}(h]h ]h"]h$]h&]uh1j9hhhMhj6ubah}(h]h ]h"]h$]h&]uh1j4hj"ubh)}(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).}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM!hj"ubeh}(h]h ]h"]h$]h&]uh1j~hjhhhhhNubj)}(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~hjhhhhhNubeh}(h]h ]h"]h$]h&]jjjhjjstartKuh1jyhj hhhhhM ubeh}(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_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehnj _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? ]j4 asnameids}(jjj j jjjjjZjWj+j(j j jM jJ jE jB j j? j j j j jju nametypes}(jj jjjZj+j jM jE j j j juh}(jhj hjjLjjjWjj(j]j j.jJ j jB j j? jP j jP j j jj 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)}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehnjlineKuh1j<hj hhhhhM ubatransform_messages]j=)}(hhh]h)}(hhh]h>Hyperlink target "kvm-arm-vcpu-pvtime-ctrl" is not referenced.}hj_sbah}(h]h ]h"]h$]h&]uh1hhj\ubah}(h]h ]h"]h$]h&]levelKtypejWsourcehnjlineKuh1j<uba transformerN include_log] decorationNhhub.