forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'kvm-3.10-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull kvm updates from Gleb Natapov: "Highlights of the updates are: general: - new emulated device API - legacy device assignment is now optional - irqfd interface is more generic and can be shared between arches x86: - VMCS shadow support and other nested VMX improvements - APIC virtualization and Posted Interrupt hardware support - Optimize mmio spte zapping ppc: - BookE: in-kernel MPIC emulation with irqfd support - Book3S: in-kernel XICS emulation (incomplete) - Book3S: HV: migration fixes - BookE: more debug support preparation - BookE: e6500 support ARM: - reworking of Hyp idmaps s390: - ioeventfd for virtio-ccw And many other bug fixes, cleanups and improvements" * tag 'kvm-3.10-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (204 commits) kvm: Add compat_ioctl for device control API KVM: x86: Account for failing enable_irq_window for NMI window request KVM: PPC: Book3S: Add API for in-kernel XICS emulation kvm/ppc/mpic: fix missing unlock in set_base_addr() kvm/ppc: Hold srcu lock when calling kvm_io_bus_read/write kvm/ppc/mpic: remove users kvm/ppc/mpic: fix mmio region lists when multiple guests used kvm/ppc/mpic: remove default routes from documentation kvm: KVM_CAP_IOMMU only available with device assignment ARM: KVM: iterate over all CPUs for CPU compatibility check KVM: ARM: Fix spelling in error message ARM: KVM: define KVM_ARM_MAX_VCPUS unconditionally KVM: ARM: Fix API documentation for ONE_REG encoding ARM: KVM: promote vfp_host pointer to generic host cpu context ARM: KVM: add architecture specific hook for capabilities ARM: KVM: perform HYP initilization for hotplugged CPUs ARM: KVM: switch to a dual-step HYP init code ARM: KVM: rework HYP page table freeing ARM: KVM: enforce maximum size for identity mapped code ARM: KVM: move to a KVM provided HYP idmap ...
- Loading branch information
Showing
110 changed files
with
8,522 additions
and
2,270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This directory contains specific device bindings for KVM_CAP_DEVICE_CTRL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
MPIC interrupt controller | ||
========================= | ||
|
||
Device types supported: | ||
KVM_DEV_TYPE_FSL_MPIC_20 Freescale MPIC v2.0 | ||
KVM_DEV_TYPE_FSL_MPIC_42 Freescale MPIC v4.2 | ||
|
||
Only one MPIC instance, of any type, may be instantiated. The created | ||
MPIC will act as the system interrupt controller, connecting to each | ||
vcpu's interrupt inputs. | ||
|
||
Groups: | ||
KVM_DEV_MPIC_GRP_MISC | ||
Attributes: | ||
KVM_DEV_MPIC_BASE_ADDR (rw, 64-bit) | ||
Base address of the 256 KiB MPIC register space. Must be | ||
naturally aligned. A value of zero disables the mapping. | ||
Reset value is zero. | ||
|
||
KVM_DEV_MPIC_GRP_REGISTER (rw, 32-bit) | ||
Access an MPIC register, as if the access were made from the guest. | ||
"attr" is the byte offset into the MPIC register space. Accesses | ||
must be 4-byte aligned. | ||
|
||
MSIs may be signaled by using this attribute group to write | ||
to the relevant MSIIR. | ||
|
||
KVM_DEV_MPIC_GRP_IRQ_ACTIVE (rw, 32-bit) | ||
IRQ input line for each standard openpic source. 0 is inactive and 1 | ||
is active, regardless of interrupt sense. | ||
|
||
For edge-triggered interrupts: Writing 1 is considered an activating | ||
edge, and writing 0 is ignored. Reading returns 1 if a previously | ||
signaled edge has not been acknowledged, and 0 otherwise. | ||
|
||
"attr" is the IRQ number. IRQ numbers for standard sources are the | ||
byte offset of the relevant IVPR from EIVPR0, divided by 32. | ||
|
||
IRQ Routing: | ||
|
||
The MPIC emulation supports IRQ routing. Only a single MPIC device can | ||
be instantiated. Once that device has been created, it's available as | ||
irqchip id 0. | ||
|
||
This irqchip 0 has 256 interrupt pins, which expose the interrupts in | ||
the main array of interrupt sources (a.k.a. "SRC" interrupts). | ||
|
||
The numbering is the same as the MPIC device tree binding -- based on | ||
the register offset from the beginning of the sources array, without | ||
regard to any subdivisions in chip documentation such as "internal" | ||
or "external" interrupts. | ||
|
||
Access to non-SRC interrupts is not implemented through IRQ routing mechanisms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
XICS interrupt controller | ||
|
||
Device type supported: KVM_DEV_TYPE_XICS | ||
|
||
Groups: | ||
KVM_DEV_XICS_SOURCES | ||
Attributes: One per interrupt source, indexed by the source number. | ||
|
||
This device emulates the XICS (eXternal Interrupt Controller | ||
Specification) defined in PAPR. The XICS has a set of interrupt | ||
sources, each identified by a 20-bit source number, and a set of | ||
Interrupt Control Presentation (ICP) entities, also called "servers", | ||
each associated with a virtual CPU. | ||
|
||
The ICP entities are created by enabling the KVM_CAP_IRQ_ARCH | ||
capability for each vcpu, specifying KVM_CAP_IRQ_XICS in args[0] and | ||
the interrupt server number (i.e. the vcpu number from the XICS's | ||
point of view) in args[1] of the kvm_enable_cap struct. Each ICP has | ||
64 bits of state which can be read and written using the | ||
KVM_GET_ONE_REG and KVM_SET_ONE_REG ioctls on the vcpu. The 64 bit | ||
state word has the following bitfields, starting at the | ||
least-significant end of the word: | ||
|
||
* Unused, 16 bits | ||
|
||
* Pending interrupt priority, 8 bits | ||
Zero is the highest priority, 255 means no interrupt is pending. | ||
|
||
* Pending IPI (inter-processor interrupt) priority, 8 bits | ||
Zero is the highest priority, 255 means no IPI is pending. | ||
|
||
* Pending interrupt source number, 24 bits | ||
Zero means no interrupt pending, 2 means an IPI is pending | ||
|
||
* Current processor priority, 8 bits | ||
Zero is the highest priority, meaning no interrupts can be | ||
delivered, and 255 is the lowest priority. | ||
|
||
Each source has 64 bits of state that can be read and written using | ||
the KVM_GET_DEVICE_ATTR and KVM_SET_DEVICE_ATTR ioctls, specifying the | ||
KVM_DEV_XICS_SOURCES attribute group, with the attribute number being | ||
the interrupt source number. The 64 bit state word has the following | ||
bitfields, starting from the least-significant end of the word: | ||
|
||
* Destination (server number), 32 bits | ||
This specifies where the interrupt should be sent, and is the | ||
interrupt server number specified for the destination vcpu. | ||
|
||
* Priority, 8 bits | ||
This is the priority specified for this interrupt source, where 0 is | ||
the highest priority and 255 is the lowest. An interrupt with a | ||
priority of 255 will never be delivered. | ||
|
||
* Level sensitive flag, 1 bit | ||
This bit is 1 for a level-sensitive interrupt source, or 0 for | ||
edge-sensitive (or MSI). | ||
|
||
* Masked flag, 1 bit | ||
This bit is set to 1 if the interrupt is masked (cannot be delivered | ||
regardless of its priority), for example by the ibm,int-off RTAS | ||
call, or 0 if it is not masked. | ||
|
||
* Pending flag, 1 bit | ||
This bit is 1 if the source has a pending interrupt, otherwise 0. | ||
|
||
Only one XICS instance may be created per VM. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.