@@ -25,8 +25,10 @@ Returns:
2525
2626 ======= ========================================================
2727 -EBUSY The PMU overflow interrupt is already set
28- -ENXIO The overflow interrupt not set when attempting to get it
29- -ENODEV PMUv3 not supported
28+ -EFAULT Error reading interrupt number
29+ -ENXIO PMUv3 not supported or the overflow interrupt not set
30+ when attempting to get it
31+ -ENODEV KVM_ARM_VCPU_PMU_V3 feature missing from VCPU
3032 -EINVAL Invalid PMU overflow interrupt number supplied or
3133 trying to set the IRQ number without using an in-kernel
3234 irqchip.
@@ -45,16 +47,63 @@ all vcpus, while as an SPI it must be a separate number per vcpu.
4547Returns:
4648
4749 ======= ======================================================
50+ -EEXIST Interrupt number already used
4851 -ENODEV PMUv3 not supported or GIC not initialized
49- -ENXIO PMUv3 not properly configured or in-kernel irqchip not
50- configured as required prior to calling this attribute
52+ -ENXIO PMUv3 not supported, missing VCPU feature or interrupt
53+ number not set
5154 -EBUSY PMUv3 already initialized
5255 ======= ======================================================
5356
5457Request the initialization of the PMUv3. If using the PMUv3 with an in-kernel
5558virtual GIC implementation, this must be done after initializing the in-kernel
5659irqchip.
5760
61+ 1.3 ATTRIBUTE: KVM_ARM_VCPU_PMU_V3_FILTER
62+ -----------------------------------------
63+
64+ :Parameters: in kvm_device_attr.addr the address for a PMU event filter is a
65+ pointer to a struct kvm_pmu_event_filter
66+
67+ :Returns:
68+
69+ ======= ======================================================
70+ -ENODEV: PMUv3 not supported or GIC not initialized
71+ -ENXIO: PMUv3 not properly configured or in-kernel irqchip not
72+ configured as required prior to calling this attribute
73+ -EBUSY: PMUv3 already initialized
74+ -EINVAL: Invalid filter range
75+ ======= ======================================================
76+
77+ Request the installation of a PMU event filter described as follows:
78+
79+ struct kvm_pmu_event_filter {
80+ __u16 base_event;
81+ __u16 nevents;
82+
83+ #define KVM_PMU_EVENT_ALLOW 0
84+ #define KVM_PMU_EVENT_DENY 1
85+
86+ __u8 action;
87+ __u8 pad[3];
88+ };
89+
90+ A filter range is defined as the range [@base_event, @base_event + @nevents),
91+ together with an @action (KVM_PMU_EVENT_ALLOW or KVM_PMU_EVENT_DENY). The
92+ first registered range defines the global policy (global ALLOW if the first
93+ @action is DENY, global DENY if the first @action is ALLOW). Multiple ranges
94+ can be programmed, and must fit within the event space defined by the PMU
95+ architecture (10 bits on ARMv8.0, 16 bits from ARMv8.1 onwards).
96+
97+ Note: "Cancelling" a filter by registering the opposite action for the same
98+ range doesn't change the default action. For example, installing an ALLOW
99+ filter for event range [0:10) as the first filter and then applying a DENY
100+ action for the same range will leave the whole range as disabled.
101+
102+ Restrictions: Event 0 (SW_INCR) is never filtered, as it doesn't count a
103+ hardware event. Filtering event 0x1E (CHAIN) has no effect either, as it
104+ isn't strictly speaking an event. Filtering the cycle counter is possible
105+ using event 0x11 (CPU_CYCLES).
106+
58107
591082. GROUP: KVM_ARM_VCPU_TIMER_CTRL
60109=================================
0 commit comments