<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/arm64/kvm/arch_timer.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/arm64/kvm/arch_timer.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/arm64/kvm/arch_timer.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-06-08T09:16:23Z</updated>
<entry>
<title>KVM: arm64: Warn if accessing timer pending state outside of vcpu context</title>
<updated>2022-06-08T09:16:23Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2022-06-07T13:14:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=efedd01de475e126e43a07d0b1221bb65e497163'/>
<id>urn:sha1:efedd01de475e126e43a07d0b1221bb65e497163</id>
<content type='text'>
A recurrent bug in the KVM/arm64 code base consists in trying to
access the timer pending state outside of the vcpu context, which
makes zero sense (the pending state only exists when the vcpu
is loaded).

In order to avoid more embarassing crashes and catch the offenders
red-handed, add a warning to kvm_arch_timer_get_input_level() and
return the state as non-pending. This avoids taking the system down,
and still helps tracking down silly bugs.

Reviewed-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20220607131427.1164881-4-maz@kernel.org
</content>
</entry>
<entry>
<title>KVM: arm64: Handle blocking WFIT instruction</title>
<updated>2022-04-20T12:24:45Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2022-04-19T18:27:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=89f5074c503b6b6f181c0240c931f67bcaf266e9'/>
<id>urn:sha1:89f5074c503b6b6f181c0240c931f67bcaf266e9</id>
<content type='text'>
When trapping a blocking WFIT instruction, take it into account when
computing the deadline of the background timer.

The state is tracked with a new vcpu flag, and is gated by a new
CPU capability, which isn't currently enabled.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20220419182755.601427-6-maz@kernel.org
</content>
</entry>
<entry>
<title>KVM: arm64: Introduce kvm_counter_compute_delta() helper</title>
<updated>2022-04-20T12:24:44Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2022-04-19T18:27:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=daf85a5f6be33788e18ff3efad1d7c3ad66a8cb3'/>
<id>urn:sha1:daf85a5f6be33788e18ff3efad1d7c3ad66a8cb3</id>
<content type='text'>
Refactor kvm_timer_compute_delta() and extract a helper that
compute the delta (in ns) between a given timer and an arbitrary
value.

No functional change expected.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20220419182755.601427-5-maz@kernel.org
</content>
</entry>
<entry>
<title>KVM: arm64: Simplify kvm_cpu_has_pending_timer()</title>
<updated>2022-04-20T12:24:44Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2022-04-19T18:27:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b57de4ffd7c6d1247fdaef8437450ab7c1dd4ed0'/>
<id>urn:sha1:b57de4ffd7c6d1247fdaef8437450ab7c1dd4ed0</id>
<content type='text'>
kvm_cpu_has_pending_timer() ends up checking all the possible
timers for a wake-up cause. However, we already check for
pending interrupts whenever we try to wake-up a vcpu, including
the timer interrupts.

Obviously, doing the same work twice is once too many. Reduce
this helper to almost nothing, but keep it around, as we are
going to make use of it soon.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20220419182755.601427-4-maz@kernel.org
</content>
</entry>
<entry>
<title>KVM: Add helpers to wake/query blocking vCPU</title>
<updated>2021-12-08T09:24:54Z</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2021-10-09T02:12:12Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d92a5d1c6c757f659ffb9c2c2e65fcf3d571c14e'/>
<id>urn:sha1:d92a5d1c6c757f659ffb9c2c2e65fcf3d571c14e</id>
<content type='text'>
Add helpers to wake and query a blocking vCPU.  In addition to providing
nice names, the helpers reduce the probability of KVM neglecting to use
kvm_arch_vcpu_get_wait().

No functional change intended.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Message-Id: &lt;20211009021236.4122790-20-seanjc@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: Rename kvm_vcpu_block() =&gt; kvm_vcpu_halt()</title>
<updated>2021-12-08T09:24:51Z</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2021-10-09T02:12:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=91b99ea7065786d0bff1c9281b002455dbaeb08b'/>
<id>urn:sha1:91b99ea7065786d0bff1c9281b002455dbaeb08b</id>
<content type='text'>
Rename kvm_vcpu_block() to kvm_vcpu_halt() in preparation for splitting
the actual "block" sequences into a separate helper (to be named
kvm_vcpu_block()).  x86 will use the standalone block-only path to handle
non-halt cases where the vCPU is not runnable.

Rename block_ns to halt_ns to match the new function name.

No functional change intended.

Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Message-Id: &lt;20211009021236.4122790-14-seanjc@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: Use 'unsigned long' as kvm_for_each_vcpu()'s index</title>
<updated>2021-12-08T09:24:15Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2021-11-16T16:04:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=46808a4cb89708c2e5b264eb9d1035762581921b'/>
<id>urn:sha1:46808a4cb89708c2e5b264eb9d1035762581921b</id>
<content type='text'>
Everywhere we use kvm_for_each_vpcu(), we use an int as the vcpu
index. Unfortunately, we're about to move rework the iterator,
which requires this to be upgrade to an unsigned long.

Let's bite the bullet and repaint all of it in one go.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Message-Id: &lt;20211116160403.4074052-7-maz@kernel.org&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: arm64: timer: Add support for SW-based deactivation</title>
<updated>2021-06-01T09:46:00Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2021-03-15T14:21:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5f59229680f70078ac4c11db2ae89be087474144'/>
<id>urn:sha1:5f59229680f70078ac4c11db2ae89be087474144</id>
<content type='text'>
In order to deal with the lack of active state, we need to use
the mask/unmask primitives (after all, the active state is just an
additional mask on top of the normal one).

To avoid adding a bunch of ugly conditionals in the timer and vgic
code, let's use a timer-specific irqdomain to deal with the state
conversion. Yes, this is an unexpected use of irqdomains, but
there is no reason not to be just as creative as the designers
of the HW...

This involves overloading the vcpu_affinity, set_irqchip_state
and eoi callbacks so that the rest of the KVM code can continue
ignoring the oddities of the underlying platform.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
</content>
</entry>
<entry>
<title>KVM: arm64: timer: Refactor IRQ configuration</title>
<updated>2021-06-01T09:46:00Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2021-03-15T14:05:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2f2f7e39dbb31aa1db13c490a4e47502497510fe'/>
<id>urn:sha1:2f2f7e39dbb31aa1db13c490a4e47502497510fe</id>
<content type='text'>
As we are about to add some more things to the timer IRQ
configuration, move this code out of the main timer init code
into its own set of functions.

No functional changes.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
</content>
</entry>
<entry>
<title>KVM: arm64: vgic: move irq-&gt;get_input_level into an ops structure</title>
<updated>2021-06-01T09:45:59Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2021-03-01T17:39:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=db75f1a33f82ad332b6e139c5960e01999969d2c'/>
<id>urn:sha1:db75f1a33f82ad332b6e139c5960e01999969d2c</id>
<content type='text'>
We already have the option to attach a callback to an interrupt
to retrieve its pending state. As we are planning to expand this
facility, move this callback into its own data structure.

This will limit the size of individual interrupts as the ops
structures can be shared across multiple interrupts.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
</content>
</entry>
</feed>
