the following URL:
http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html
Feng Wu (13):
iommu/vt-d: VT-d Posted-Interrupts feature detection
KVM: Initialize VT-d Posted-Interrtups Descriptor
KVM: Add KVM_CAP_PI to detect VT-d Posted-Interrtups
Update Posted-Interrupts descriptor according to the
following rules:
- Before VCPU block, set 'NV' to POSTED_INTR_WAKEUP_VECTOR
- After VCPU block, set 'NV' back to POSTED_INTR_VECTOR
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h |5 ++
arch/x86/kvm/vmx.c
This patch adds three helper functions to manipulate the Posted-
Interrtups Decriptor.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 18 ++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ae91b72..f4f 100644
Enable VT-d Posted-Interrtups and add a command line
parameter for it.
Signed-off-by: Feng Wu
---
drivers/iommu/irq_remapping.c |9 -
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index 0e36860..3cb9429
VCPU scheduling.
Signed-off-by: Feng Wu
---
drivers/iommu/intel_irq_remapping.c |7 +++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/iommu/intel_irq_remapping.c
b/drivers/iommu/intel_irq_remapping.c
index 87c02fe..249e2b1 100644
--- a/drivers/iommu/intel_irq_remapping.
that VCPU.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/entry_arch.h |2 ++
arch/x86/include/asm/hardirq.h |1 +
arch/x86/include/asm/hw_irq.h |2 ++
arch/x86/include/asm/irq_vectors.h |1 +
arch/x86/kernel/entry_64.S |2 ++
arch/x86/kernel/irq.c
Currently, we don't support urgent interrupt, all interrupts
are recognized as non-urgent interrupt, so we cannot send
posted-interrupt when 'SN' is set.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 11 +--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git
When VCPU is blocked and an external interrupts from assigned
devices is delivered to it, VT-d Posted-Interrupts mechanism
will deliver a interrrupt to the associated physical CPU with
Wake-up Vector. In its handler, we find the destination VCPU
and wake up it.
Signed-off-by: Feng Wu
---
arch
KVM side.
You can find the VT-d Posted-Interrtups Spec. in the following URL:
http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html
Feng Wu (1):
x86: Update VT-d Posted-Interrupts related information
hw/i386/kvm/pci-assign.c | 24
se
the VCPU with smallest 'round_robin_counter' as the destination,
then increase it.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/irq_remapping.h |6 ++
arch/x86/include/asm/kvm_host.h |2 +
arch/x86/kvm/vmx.c | 12 +++
arch/x86/kvm/x86.c
This patch changes the NDST filed of Posted-Interrupts
Descriptor after VCPU is scheduled to another physical
CPU.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 25 +
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm
update the IRTE with
the new guest interrtup configuration.
Signed-off-by: Feng Wu
---
hw/i386/kvm/pci-assign.c | 24
linux-headers/linux/kvm.h |2 ++
target-i386/kvm.c |5 +
target-i386/kvm_i386.h|1 +
4 files changed, 32 insertions(+), 0
This patch initialize the VT-d Posted-interrupt Descritpor.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/irq_remapping.h |1 +
arch/x86/kernel/apic/apic.c |1 +
arch/x86/kvm/vmx.c | 56 -
3 files changed, 56 insertions
posted-interrupt.
Signed-off-by: Feng Wu
---
drivers/iommu/intel_irq_remapping.c | 13 +
drivers/iommu/irq_remapping.c |4
drivers/iommu/irq_remapping.h |5 +
include/linux/intel-iommu.h |1 +
4 files changed, 23 insertions(+), 0 deletions
This patch adds KVM_CAP_PI to detect VT-d Posted-Interrtups
feature for QEMU.
Signed-off-by: Feng Wu
---
arch/x86/kvm/x86.c |4
include/uapi/linux/kvm.h |1 +
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0033df3
This patch adjusts the definition of 'struct irte', so that we can
add the VT-d Posted-Interrtups format in this structure later.
Signed-off-by: Feng Wu
---
drivers/iommu/intel_irq_remapping.c | 35 +++
include/linux/dmar.h|4 ++-
ce to
configure VT-d PI when guest updates the interrupt configuration
(MSI/MSI-X configuration).
- Define a new VFIO API: vfio_msi_get_irq(), which can be used by KVM
to get the host irq of the assigned devices. Then KVM can update the
associated IRTE for VT-d PI.
Feng Wu (2):
vfio: Ad
This API returns the host irq for the MSI/MSI-X interrrupts.
Signed-off-by: Feng Wu
---
drivers/vfio/pci/vfio_pci.c | 10 ++
include/linux/vfio.h|2 ++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
Add new group KVM_DEV_VFIO_INTERRUPT and command
KVM_DEV_VFIO_DEVIE_POSTING_IRQ related to it.
This is used for VT-d Posted-Interrupts setup.
Signed-off-by: Feng Wu
---
Documentation/virtual/kvm/devices/vfio.txt |8
include/uapi/linux/kvm.h | 14
IRQ attribute to tell KVM to update the
related IRTE according the VT-d Posted-Interrrupts Specification,
such as, the guest vector should be updated in the related IRTE.
Signed-off-by: Feng Wu
---
Documentation/virtual/kvm/devices/vfio.txt |9 +
include/uapi/linux/kvm.h
VT-d PI.
- Define a new attribute in KVM_DEV_VFIO_DEVICE group.
- Teach KVM about sturct pci_dev, and get host irq from it.
Feng Wu (2):
KVM: kvm-vfio: User API for VT-d Posted-Interrupts
KVM: kvm-vfio: implement the VFIO skeleton for VT-d Posted-Interrupts
Documentation/virtual/kvm/devices/
This patch adds the kvm-vfio interface for VT-d Posted-Interrrupts.
When guests updates MSI/MSI-x information for an assigned-device,
QEMU will use KVM_DEV_VFIO_DEVICE_POSTING_IRQ attribute to setup
IRTE for VT-d PI. This patch implement this IRQ attribute.
Signed-off-by: Feng Wu
---
virt/kvm
Make kvm_set_msi_irq() public, we can use this function outside.
Signed-off-by: Feng Wu
---
include/linux/kvm_host.h |2 ++
virt/kvm/irq_comm.c |2 +-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index cfa85ac
Enable VT-d Posted-Interrtups and add a command line
parameter for it.
Signed-off-by: Feng Wu
---
Documentation/kernel-parameters.txt |1 +
drivers/iommu/irq_remapping.c | 12
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Documentation/kernel
When vCPU is blocked and an external interrupts from assigned
devices is delivered to it, VT-d Posted-Interrupts mechanism
will deliver an interrupt to the associated physical CPU with
Wake-up Vector. In its handler, we find the destination vCPU
and wake up it.
Signed-off-by: Feng Wu
---
arch
Currently, we don't support urgent interrupt, all interrupts
are recognized as non-urgent interrupt, so we cannot send
posted-interrupt when 'SN' is set.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 11 +--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git
Update Posted-Interrupts descriptor according to the
following rules:
- Before vCPU block, set 'NV' to POSTED_INTR_WAKEUP_VECTOR
- After vCPU block, set 'NV' back to POSTED_INTR_VECTOR
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h |5 ++
arch/x86/kvm/vmx.c
This patch changes the NDST filed of Posted-Interrupts
Descriptor after vCPU is scheduled to another physical
CPU.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 25 +
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm
This patch defines macro __KVM_HAVE_ARCH_KVM_VFIO_POSTING and
implement kvm_arch_vfio_update_pi_irte for x86 architecture.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h |2 +
arch/x86/kvm/Makefile |2 +-
arch/x86/kvm/kvm_vfio_x86.c | 68
IRQ attribute to tell KVM to update the
related IRTE according the VT-d Posted-Interrrupts Specification,
such as, the guest vector should be updated in the related IRTE.
Signed-off-by: Feng Wu
---
Documentation/virtual/kvm/devices/vfio.txt |9 +
include/uapi/linux/kvm.h
that vCPU.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/entry_arch.h |2 ++
arch/x86/include/asm/hardirq.h |1 +
arch/x86/include/asm/hw_irq.h |2 ++
arch/x86/include/asm/irq_vectors.h |1 +
arch/x86/kernel/entry_64.S |2 ++
arch/x86/kernel/irq.c
This patch adds the kvm-vfio interface for VT-d Posted-Interrrupts.
When guests updates MSI/MSI-x information for an assigned-device,
QEMU will use KVM_DEV_VFIO_DEVICE_POSTING_IRQ attribute to setup
IRTE for VT-d PI. This patch implement this IRQ attribute.
Signed-off-by: Feng Wu
---
include
This patch adds some helper functions to manipulate the
Posted-Interrupts Descriptor.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 26 ++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index abdb84f..0b1383e
Move struct kvm_irq_routing_table from irqchip.c to kvm_host.h,
so we can use it outside of irqchip.c.
Signed-off-by: Feng Wu
---
include/linux/kvm_host.h | 19 +++
virt/kvm/irqchip.c | 11 ---
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a
Define a interface to get PI descriptor address from the vCPU structure.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h |1 +
arch/x86/kvm/vmx.c | 12
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/kvm_host.h b
This patch initializes the VT-d Posted-Interrupts Descriptor.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 27 +++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 0b1383e..66ca275 100644
--- a/arch/x86
This patch adds a new interface irq_remapping_cap() to detect
whether irq remapping supports new features, such as VT-d
Posted-Interrupts. We export this function out, so that KVM
code can check this and use this mechanism properly.
Signed-off-by: Feng Wu
Reviewed-by: Jiang Liu
---
arch/x86
he vCPU with smallest 'round_robin_counter' as the destination,
then increase it.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h |4 +++
virt/kvm/irq_comm.c | 41 +++
2 files changed, 45 insertions(+), 0 deletions(-)
diff --
Change struct pi_desc for VT-d Posted-Interrupts.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 15 +--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 3e556c6..abdb84f 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86
Add the Intel side implementation for capability in
struct irq_remap_ops.
Signed-off-by: Feng Wu
Reviewed-by: Jiang Liu
---
drivers/iommu/intel_irq_remapping.c | 27 +++
drivers/iommu/irq_remapping.c |2 ++
drivers/iommu/irq_remapping.h |4
3
Add helper function to detect VT-d Posted-Interrupts capability.
Signed-off-by: Feng Wu
Reviewed-by: Jiang Liu
---
include/linux/intel-iommu.h |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index ecaf3a9
Implement irq_set_vcpu_affinity for intel_ir_chip.
Signed-off-by: Feng Wu
Reviewed-by: Jiang Liu
---
arch/x86/include/asm/irq_remapping.h |5 +
drivers/iommu/intel_irq_remapping.c | 27 +++
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/arch
vCPU scheduling.
Signed-off-by: Feng Wu
Reviewed-by: Jiang Liu
---
drivers/iommu/intel_irq_remapping.c | 10 ++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/iommu/intel_irq_remapping.c
b/drivers/iommu/intel_irq_remapping.c
index 749cb93..01786a8 100644
---
Add a new irte_pi structure for VT-d Posted-Interrupts.
Signed-off-by: Feng Wu
Reviewed-by: Jiang Liu
---
include/linux/dmar.h | 32
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 8473756
Implement irq_set_vcpu_affinity for pci_msi_ir_controller.
Signed-off-by: Feng Wu
Reviewed-by: Jiang Liu
---
arch/x86/kernel/apic/msi.c |1 +
include/linux/irq.h|3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel
This patch adds a new member capability to struct irq_remap_ops,
this new function ops can be used to check whether some
features are supported, such as VT-d Posted-Interrupts.
Signed-off-by: Feng Wu
Reviewed-by: Jiang Liu
---
arch/x86/include/asm/irq_remapping.h |4
drivers/iommu
posted interrupts descriptor
and guest vector)
-->irq core will transfer the control to IOMMU
-->IOMMU will do the real work of updating IRTE (IRTE has new
format for VT-d Posted-Interrupts)
Signed-off-by: Jiang Liu
Signed-off-by: Feng Wu
---
include/linux/
/2] kvm-vfio: implement the vfio skeleton for VT-d
Posted-Interrupts"
20: x86 irq related changes
Feng Wu (25):
genirq: Introduce irq_set_vcpu_affinity() to target an interrupt to a
VCPU
iommu: Add new member capability to struct irq_remap_ops
iommu, x86: Define new irte structur
This patch adds SMAP handling logic when setting CR4 for guests
Signed-off-by: Feng Wu
---
arch/x86/kvm/cpuid.h | 8
arch/x86/kvm/mmu.c | 22 +++---
arch/x86/kvm/mmu.h | 2 ++
arch/x86/kvm/x86.c | 6 ++
4 files changed, 35 insertions(+), 3 deletions
This patch removes SMAP bit from CR4_RESERVED_BITS.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index ae5d783..b673925 100644
--- a/arch/x86
SMAP is disabled if CPU is in non-paging mode in hardware.
However KVM always uses paging mode to emulate guest non-paging
mode with TDP. To emulate this behavior, SMAP needs to be
manually disabled when guest switches to non-paging mode.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 10
ode
data accesses (these are implicit supervisor accesses) regardless of the
value of EFLAGS.AC.
This patchset pass-through SMAP feature to guests, and let guests
benefit from it.
Feng Wu (4):
KVM: expose SMAP feature to guest
KVM: Remove SMAP bit from CR4_RESERVED_BITS.
KVM: Add SMAP supp
This patch exposes SMAP feature to guest
Signed-off-by: Feng Wu
---
arch/x86/kvm/cpuid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index c697625..deb5f9b 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -303,7
SMAP is disabled if CPU is in non-paging mode in hardware.
However KVM always uses paging mode to emulate guest non-paging
mode with TDP. To emulate this behavior, SMAP needs to be
manually disabled when guest switches to non-paging mode.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 11
This patch removes SMAP bit from CR4_RESERVED_BITS.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index fdf83af..4eeb049 100644
--- a/arch/x86
in EPT realmode and EPT unpaging mode
* Expose SMAP feature to guest
Version 1:
* Change the logic of updatinng mmu permission bitmap for SMAP violation
* Expose SMAP feature to guest in the last patch of this series.
Feng Wu (4):
KVM: Remove SMAP bit from CR4_RESERVED_BITS.
KVM: Add S
This patch exposes SMAP feature to guest
Signed-off-by: Feng Wu
---
arch/x86/kvm/cpuid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index c697625..deb5f9b 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -303,7
This patch adds SMAP handling logic when setting CR4 for guests
Signed-off-by: Feng Wu
---
arch/x86/kvm/cpuid.h | 8
arch/x86/kvm/mmu.c | 24 +---
arch/x86/kvm/mmu.h | 26 +++---
arch/x86/kvm/paging_tmpl.h | 2 +-
arch/x86
ess way suggested by Paolo Bonzini to detect SMAP
violation in permission_fault().
Feng Wu (4):
KVM: Remove SMAP bit from CR4_RESERVED_BITS.
KVM: Add SMAP support when setting CR4
KVM: Disable SMAP for guests in EPT realmode and EPT unpaging mode
KVM: expose SMAP feature to guest
arch/
This patch removes SMAP bit from CR4_RESERVED_BITS.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index fdf83af..4eeb049 100644
--- a/arch/x86
SMAP is disabled if CPU is in non-paging mode in hardware.
However KVM always uses paging mode to emulate guest non-paging
mode with TDP. To emulate this behavior, SMAP needs to be
manually disabled when guest switches to non-paging mode.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 11
This patch exposes SMAP feature to guest
Signed-off-by: Feng Wu
---
arch/x86/kvm/cpuid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index c697625..deb5f9b 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -303,7
This patch adds SMAP handling logic when setting CR4 for guests
Thanks a lot to Paolo Bonzini for his suggestion to use the branchless
way to detect SMAP violation.
Signed-off-by: Feng Wu
---
arch/x86/kvm/cpuid.h | 8
arch/x86/kvm/mmu.c | 35
ess way suggested by Paolo Bonzini to detect SMAP
violation in permission_fault().
Version 4:
* Changes to some comments and code style.
Feng Wu (4):
KVM: Remove SMAP bit from CR4_RESERVED_BITS.
KVM: Add SMAP support when setting CR4
KVM: Disable SMAP for guests in EPT realmode and
This patch exposes SMAP feature to guest
Signed-off-by: Feng Wu
---
arch/x86/kvm/cpuid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index c697625..deb5f9b 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -303,7
SMAP is disabled if CPU is in non-paging mode in hardware.
However KVM always uses paging mode to emulate guest non-paging
mode with TDP. To emulate this behavior, SMAP needs to be
manually disabled when guest switches to non-paging mode.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 11
This patch removes SMAP bit from CR4_RESERVED_BITS.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index fdf83af..4eeb049 100644
--- a/arch/x86
This patch adds SMAP handling logic when setting CR4 for guests
Thanks a lot to Paolo Bonzini for his suggestion to use the branchless
way to detect SMAP violation.
Signed-off-by: Feng Wu
---
arch/x86/kvm/cpuid.h | 8
arch/x86/kvm/mmu.c | 34
This patch is based on the smap patchset
Feng Wu (1):
Rename variable smep to cr4_smep
arch/x86/kvm/mmu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message
Rename variable smep to cr4_smep, which can better reflect the
meaning of the variable.
Signed-off-by: Feng Wu
---
arch/x86/kvm/mmu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index a183783..6000557 100644
--- a/arch/x86
Use vector-hashing to handle lowest-priority interrupts for
posted-interrupts. As an example, modern Intel CPUs use this
method to handle lowest-priority interrupts.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 2 ++
arch/x86/kvm/irq_comm.c | 52
module parameter to control the vector-hashing mechanism
Feng Wu (2):
KVM: x86: Use vector-hashing to deliver lowest-priority interrupts
KVM: x86: Add lowest-priority support for vt-d posted-interrupts
arch/x86/kvm/irq_comm.c | 27 +--
arch/x86/kvm/lapic.c| 124
Use vector-hashing to deliver lowest-priority interrupts for
VT-d posted-interrupts.
Signed-off-by: Feng Wu
---
arch/x86/kvm/lapic.c | 67
arch/x86/kvm/lapic.h | 2 ++
arch/x86/kvm/vmx.c | 12 --
3 files changed, 79 insertions
Use vector-hashing to deliver lowest-priority interrupts, As an
example, modern Intel CPUs in server platform use this method to
handle lowest-priority interrupts.
Signed-off-by: Feng Wu
---
arch/x86/kvm/irq_comm.c | 27 ++-
arch/x86/kvm/lapic.c| 57
Move struct kvm_irq_routing_table from irqchip.c to kvm_host.h,
so we can use it outside of irqchip.c.
Signed-off-by: Feng Wu
---
include/linux/kvm_host.h | 15 +++
virt/kvm/irqchip.c | 11 ---
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/include
From: Eric Auger
This patch adds and documents a new KVM_DEV_VFIO_DEVICE group
and 2 device attributes: KVM_DEV_VFIO_DEVICE_FORWARD_IRQ,
KVM_DEV_VFIO_DEVICE_UNFORWARD_IRQ. The purpose is to be able
to set a VFIO device IRQ as forwarded or not forwarded.
the command takes as argument a handle to a
VFIO: external user API for interaction
KVM: kvm-vfio: wrappers to VFIO external API device helpers
Feng Wu (13):
KVM: Extend struct pi_desc for VT-d Posted-Interrupts
KVM: Add some helper functions for Posted-Interrupts
KVM: Define a new interface kvm_intr_is_single_vcpu()
KVM: Get P
Extend struct pi_desc for VT-d Posted-Interrupts.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f7b6168..bd26501 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86
single-CPU, we
can use PI to deliver the interrupts to it. Full functionality
of lowest-priority support will be added later.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 2 ++
arch/x86/kvm/irq_comm.c | 24
2 files changed, 26 insertions(+)
diff
This patch adds pi_clear_sn and pi_set_sn to struct kvm_x86_ops,
so we can set/clear SN outside vmx.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 3 +++
arch/x86/kvm/vmx.c | 13 +
2 files changed, 16 insertions(+)
diff --git a/arch/x86/include/asm
This patch adds some helper functions to manipulate the
Posted-Interrupts Descriptor.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 26 ++
1 file changed, 26 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index bd26501..8be6aa4 100644
--- a/arch
This patch updates the Posted-Interrupts Descriptor when vCPU
is blocked.
pre-block:
- Add the vCPU to the blocked per-CPU list
- Set 'NV' to POSTED_INTR_WAKEUP_VECTOR
post-block:
- Remove the vCPU from the per-CPU list
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h |
From: Eric Auger
Provide wrapper functions that allow KVM-VFIO device code to
interact with a vfio device:
- kvm_vfio_device_get_external_user gets a handle to a struct
vfio_device from the vfio device file descriptor and increments
its reference counter,
- kvm_vfio_device_put_external_user d
is set.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 16
1 file changed, 16 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 7e8a800..f1daa8b 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -4485,6 +4485,22 @
This patch updates the Posted-Interrupts Descriptor when vCPU
is preempted.
sched out:
- Set 'SN' to suppress furture non-urgent interrupts posted for
the vCPU.
sched in:
- Clear 'SN'
- Change NDST if vCPU is scheduled to a different CPU
- Set 'NV' to POSTED_INTR_
remapping mode.
This patch implements these IRQ attributes.
Signed-off-by: Feng Wu
---
include/linux/kvm_host.h | 22 +
virt/kvm/vfio.c | 126 +++
2 files changed, 148 insertions(+)
diff --git a/include/linux/kvm_host.h b/include/linux
Make kvm_set_msi_irq() public, we can use this function outside.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 4
arch/x86/kvm/irq_comm.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm
Define an interface to get PI descriptor address from the vCPU structure.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 2 ++
arch/x86/kvm/vmx.c | 11 +++
2 files changed, 13 insertions(+)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm
This patch defines macro __KVM_HAVE_ARCH_KVM_VFIO_POST and
implement kvm_arch_vfio_update_pi_irte for x86 architecture.
Signed-off-by: Feng Wu
---
arch/x86/include/asm/kvm_host.h | 2 +
arch/x86/kvm/Makefile | 3 +-
arch/x86/kvm/kvm_vfio_x86.c | 85
/address fields,
QEMU will use this IRQ attribute to tell KVM to update the
related IRTE according the VT-d Posted-Interrrupts Specification,
such as, the guest vector should be updated in the related IRTE.
Signed-off-by: Feng Wu
---
Documentation/virtual/kvm/devices/vfio.txt | 9 +
include
From: Eric Auger
The VFIO external user API is enriched with 3 new functions that
allows a kernel user external to VFIO to retrieve some information
from a VFIO device.
- vfio_device_get_external_user enables to get a vfio device from
its fd and increments its reference counter
- vfio_device_p
This patch adds the registration/unregistration of an
irq_bypass_producer for MSI/MSIx on vfio pci devices.
Signed-off-by: Feng Wu
---
drivers/vfio/pci/vfio_pci_intrs.c | 8 ++--
drivers/vfio/pci/vfio_pci_private.h | 2 ++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a
This series is based on Alex and Eric's irq bypass manager framework. To
make things clear, I only send out the patches related to irq bypass
manager, the purpose here is to show how certain callbacks are used
in VT-d PI and help to improve the irqbypass manager itself.
Feng Wu (5):
Add reference to struct irq_bypass_produce so we can get the producer
information from the consumer side.
Signed-off-by: Feng Wu
---
include/linux/kvm_irqfd.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/kvm_irqfd.h b/include/linux/kvm_irqfd.h
index 3c0bd07..0c1de05 100644
Call update routine when updating irqfd, this can update the
IRTE for Intel posted-interrupts.
Signed-off-by: Feng Wu
---
virt/kvm/eventfd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index a32cf6c..1226835 100644
--- a/virt
This patch adds the routine to update IRTE for posted-interrupts
when guest changes the interrupt configuration.
Signed-off-by: Feng Wu
---
arch/x86/kvm/x86.c | 73 ++
1 file changed, 73 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch
Add the following x86 specific routines for irqbypass manger:
- kvm_arch_irq_bypass_add_producer
- kvm_arch_irq_bypass_del_producer
- kvm_arch_irq_bypass_stop
- kvm_arch_irq_bypass_resume
- kvm_arch_irq_bypass_update
Signed-off-by: Feng Wu
---
arch/x86/kvm/Kconfig | 1 +
arch/x86/kvm/x86.c
Move struct kvm_irq_routing_table from irqchip.c to kvm_host.h,
so we can use it outside of irqchip.c.
Signed-off-by: Feng Wu
---
include/linux/kvm_host.h | 15 +++
virt/kvm/irqchip.c | 11 ---
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/include
This patch adds the routine to update IRTE for posted-interrupts
when guest changes the interrupt configuration.
Signed-off-by: Feng Wu
---
arch/x86/kvm/x86.c | 73 ++
1 file changed, 73 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch
is set.
Signed-off-by: Feng Wu
---
arch/x86/kvm/vmx.c | 16
1 file changed, 16 insertions(+)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index cecd018..d4d5abc 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -4484,6 +4484,22 @
1 - 100 of 221 matches
Mail list logo