diff options
author | Paul Mackerras <paulus@ozlabs.org> | 2016-08-19 15:35:56 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2016-09-12 10:12:28 +1000 |
commit | 5d375199ea963fa2a972eae9c7d83db36ed37082 (patch) | |
tree | 3c9f9b81ff4e70925c0c8893f97fbe05510e9f23 /arch/powerpc/include/asm/pmac_low_i2c.h | |
parent | 366274f59c4de018f72ab44bb41ccaf3d657eb52 (diff) | |
download | talos-op-linux-5d375199ea963fa2a972eae9c7d83db36ed37082.tar.gz talos-op-linux-5d375199ea963fa2a972eae9c7d83db36ed37082.zip |
KVM: PPC: Book3S HV: Set server for passed-through interrupts
When a guest has a PCI pass-through device with an interrupt, it
will direct the interrupt to a particular guest VCPU. In fact the
physical interrupt might arrive on any CPU, and then get
delivered to the target VCPU in the emulated XICS (guest interrupt
controller), and eventually delivered to the target VCPU.
Now that we have code to handle device interrupts in real mode
without exiting to the host kernel, there is an advantage to having
the device interrupt arrive on the same sub(core) as the target
VCPU is running on. In this situation, the interrupt can be
delivered to the target VCPU without any exit to the host kernel
(using a hypervisor doorbell interrupt between threads if
necessary).
This patch aims to get passed-through device interrupts arriving
on the correct core by setting the interrupt server in the real
hardware XICS for the interrupt to the first thread in the (sub)core
where its target VCPU is running. We do this in the real-mode H_EOI
code because the H_EOI handler already needs to look at the
emulated ICS state for the interrupt (whereas the H_XIRR handler
doesn't), and we know we are running in the target VCPU context
at that point.
We set the server CPU in hardware using an OPAL call, regardless of
what the IRQ affinity mask for the interrupt says, and without
updating the affinity mask. This amounts to saying that when an
interrupt is passed through to a guest, as a matter of policy we
allow the guest's affinity for the interrupt to override the host's.
This is inspired by an earlier patch from Suresh Warrier, although
none of this code came from that earlier patch.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/include/asm/pmac_low_i2c.h')
0 files changed, 0 insertions, 0 deletions