[Xen-devel] [v3 01/15] Vt-d Posted-intterrupt (PI) design

2015-06-23 Thread Feng Wu
Add the design doc for VT-d PI. Signed-off-by: Feng Wu --- docs/misc/vtd-pi.txt | 333 +++ 1 file changed, 333 insertions(+) create mode 100644 docs/misc/vtd-pi.txt diff --git a/docs/misc/vtd-pi.txt b/docs/misc/vtd-pi.txt new file mode 100644

[Xen-devel] [v3 00/15] Add VT-d Posted-Interrupts support

2015-06-23 Thread Feng Wu
some magic numbers. Feng Wu (15): Vt-d Posted-intterrupt (PI) design Add helper macro for X86_FEATURE_CX16 feature detection Add cmpxchg16b support for x86-64 iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature vt-d: VT-d Posted-Interrupts feature detection vmx: Extend stru

[Xen-devel] [v3 07/15] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-06-23 Thread Feng Wu
This patch initializes the VT-d Posted-interrupt Descriptor. Signed-off-by: Feng Wu --- v3: - Move pi_desc_init() to xen/arch/x86/hvm/vmx/vmcs.c - Remove the 'inline' flag of pi_desc_init() xen/arch/x86/hvm/vmx/vmcs.c | 18 ++ xen/include/asm-x86/hvm/vmx/vmx.h

[Xen-devel] [RFC v2 15/15] Add a command line parameter for VT-d posted-interrupts

2015-05-08 Thread Feng Wu
Enable VT-d Posted-Interrupts and add a command line parameter for it. Signed-off-by: Feng Wu --- docs/misc/xen-command-line.markdown | 9 - xen/drivers/passthrough/iommu.c | 8 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/misc/xen-command

[Xen-devel] [RFC v2 07/15] vt-d: Add API to update IRTE when VT-d PI is used

2015-05-08 Thread Feng Wu
This patch adds an API which is used to update the IRTE for posted-interrupt when guest changes MSI/MSI-X information. Signed-off-by: Feng Wu --- xen/drivers/passthrough/vtd/intremap.c | 98 ++ xen/drivers/passthrough/vtd/iommu.h| 4 ++ xen/include/asm-x86

[Xen-devel] [RFC v2 10/15] vmx: Define two per-cpu variables

2015-05-08 Thread Feng Wu
This patch defines two per-cpu variables: blocked_vcpu: A list storing the vCPUs which were blocked on this pCPU. blocked_vcpu_lock: The spinlock to protect blocked_vcpu. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmcs.c | 3 +++ xen/arch/x86/hvm/vmx/vmx.c| 7 +++ xen

[Xen-devel] [RFC v2 06/15] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-05-08 Thread Feng Wu
Extend struct iremap_entry according to VT-d Posted-Interrupts Spec. Signed-off-by: Feng Wu --- xen/drivers/passthrough/vtd/intremap.c | 90 +- xen/drivers/passthrough/vtd/iommu.h| 26 +++--- xen/drivers/passthrough/vtd/utils.c| 10 ++-- 3 files

[Xen-devel] [RFC v2 04/15] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-05-08 Thread Feng Wu
Extend struct pi_desc according to VT-d Posted-Interrupts Spec. Signed-off-by: Feng Wu --- xen/include/asm-x86/hvm/vmx/vmcs.h | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h index

[Xen-devel] [RFC v2 02/15] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-05-08 Thread Feng Wu
t' to control whether enable VT-d posted-interrupt or not in the generic IOMMU code. Signed-off-by: Feng Wu --- xen/drivers/passthrough/iommu.c | 11 ++- xen/include/xen/iommu.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/iom

[Xen-devel] [RFC v2 13/15] Update Posted-Interrupts Descriptor during vCPU scheduling

2015-05-08 Thread Feng Wu
terrupts. (Current, we only support non-urgent interrupts) - Set 'NV' back to 'Notification Vector' if needed. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmx.c | 130 + xen/common/schedule.c | 5 ++ xen/include/xen

[Xen-devel] [RFC v2 01/15] Vt-d Posted-intterrupt (PI) design

2015-05-08 Thread Feng Wu
Add the design doc for VT-d PI. Signed-off-by: Feng Wu --- docs/misc/vtd-pi.txt | 332 +++ 1 file changed, 332 insertions(+) create mode 100644 docs/misc/vtd-pi.txt diff --git a/docs/misc/vtd-pi.txt b/docs/misc/vtd-pi.txt new file mode 100644

[Xen-devel] [RFC v2 09/15] Add a new per-vCPU tasklet to wakeup the blocked vCPU

2015-05-08 Thread Feng Wu
This patch adds a new per-vCPU tasklet to wakeup the blocked vCPU. It can be used in the case vcpu_unblock cannot be called directly. This tasklet will be used in later patch in this series. Signed-off-by: Feng Wu --- xen/common/domain.c | 11 +++ xen/include/xen/sched.h | 3 +++ 2

[Xen-devel] [RFC v2 11/15] vmx: Add a global wake-up vector for VT-d Posted-Interrupts

2015-05-08 Thread Feng Wu
This patch adds a global vector which is used to wake up the blocked vCPU when an interrupt is being posted to it. Signed-off-by: Feng Wu Suggested-by: Yang Zhang --- xen/arch/x86/hvm/vmx/vmx.c| 31 +++ xen/include/asm-x86/hvm/hvm.h | 1 + xen/include

[Xen-devel] [RFC v2 12/15] vmx: Properly handle notification event when vCPU is running

2015-05-08 Thread Feng Wu
When a vCPU is running in Root mode and a notification event has been injected to it. we need to set VCPU_KICK_SOFTIRQ for the current cpu, so the pending interrupt in PIRR will be synced to vIRR before VM-Exit in time. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmx.c| 55

[Xen-devel] [RFC v2 08/15] Update IRTE according to guest interrupt config changes

2015-05-08 Thread Feng Wu
vector-hashing mechamisn to find the destination vCPU. This follows the hardware behavior, since modern Intel CPUs use vector hashing to handle the lowest-priority interrupt. For multicast/broadcast vCPU, we cannot handle it via interrupt posting, still use interrupt remapping. Signed-off-by: Feng

[Xen-devel] [RFC v2 14/15] Suppress posting interrupts when 'SN' is set

2015-05-08 Thread Feng Wu
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 --- xen/arch/x86/hvm/vmx/vmx.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) d

[Xen-devel] [RFC v2 05/15] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-05-08 Thread Feng Wu
This patch initializes the VT-d Posted-interrupt Descriptor. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmcs.c | 3 +++ xen/include/asm-x86/hvm/vmx/vmx.h | 20 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch

[Xen-devel] [RFC v2 03/15] vt-d: VT-d Posted-Interrupts feature detection

2015-05-08 Thread Feng Wu
posted-interrupt. Signed-off-by: Feng Wu --- xen/drivers/passthrough/vtd/iommu.c | 15 +-- xen/drivers/passthrough/vtd/iommu.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index

[Xen-devel] [RFC v2 00/15] Add VT-d Posted-Interrupts support

2015-05-08 Thread Feng Wu
RFC v2 07/15] vt-d: Add API to update IRTE when VT-d PI is used" How to update the IRTE for PI dynamically (in an atomic way)? I am trying to use cmpxchg16b and it is in progress, I will add this in the next version. Feng Wu (15): Vt-d Posted-intterrupt (PI) design iommu: Add iommu_intpost

[Xen-devel] [RFC v1 00/15] Add VT-d Posted-Interrupts support

2015-03-25 Thread Feng Wu
the following URL: http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html This patch set follow the following design: http://article.gmane.org/gmane.comp.emulators.xen.devel/236476 Feng Wu (15): iommu: Add iommu_intpost to control VT-d Posted

[Xen-devel] [RFC v1 07/15] vt-d: Add API to update IRTE when VT-d PI is used

2015-03-25 Thread Feng Wu
This patch adds an API which is used to update the IRTE for posted-interrupt when guest changes MSI/MSI-X information. Signed-off-by: Feng Wu --- xen/drivers/passthrough/vtd/intremap.c | 83 ++ xen/drivers/passthrough/vtd/iommu.h| 3 ++ xen/include/asm-x86

[Xen-devel] [RFC v1 02/15] vt-d: VT-d Posted-Interrupts feature detection

2015-03-25 Thread Feng Wu
posted-interrupt. Signed-off-by: Feng Wu --- xen/drivers/passthrough/vtd/iommu.c | 15 +-- xen/drivers/passthrough/vtd/iommu.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index

[Xen-devel] [RFC v1 12/15] vmx: Properly handle notification event when vCPU is running

2015-03-25 Thread Feng Wu
When a vCPU is running in Root mode and a notification event has been injected to it. we need to set VCPU_KICK_SOFTIRQ for the current cpu, so the pending interrupt in PIRR will be synced to vIRR before VM-Exit in time. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmx.c| 24

[Xen-devel] [RFC v1 04/15] vmx: Add some helper functions for Posted-Interrupts

2015-03-25 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu --- xen/include/asm-x86/hvm/vmx/vmx.h | 21 + 1 file changed, 21 insertions(+) diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h

[Xen-devel] [RFC v1 09/15] Add a new per-vCPU tasklet to wakeup the blocked vCPU

2015-03-25 Thread Feng Wu
This patch adds a new per-vCPU tasklet to wakeup the blocked vCPU. It can be used in the case vcpu_unblock cannot be called directly. Signed-off-by: Feng Wu --- xen/common/domain.c | 11 +++ xen/include/xen/sched.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/xen/common

[Xen-devel] [RFC v1 11/15] vmx: Add a global wake-up vector for VT-d Posted-Interrupts

2015-03-25 Thread Feng Wu
This patch adds a global vector which is used to wake up the blocked vCPU when an interrupt is being posted to it. Signed-off-by: Feng Wu Suggested-by: Yang Zhang --- xen/arch/x86/hvm/vmx/vmx.c| 33 + xen/include/asm-x86/hvm/hvm.h | 1 + xen/include

[Xen-devel] [RFC v1 06/15] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-03-25 Thread Feng Wu
Extend struct iremap_entry according to VT-d Posted-Interrupts Spec. Signed-off-by: Feng Wu --- xen/drivers/passthrough/vtd/iommu.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h index 42047e0

[Xen-devel] [RFC v1 01/15] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-03-25 Thread Feng Wu
t' to control whether enable VT-d posted-interrupt or not in the generic IOMMU code. Signed-off-by: Feng Wu --- xen/drivers/passthrough/iommu.c | 11 ++- xen/include/xen/iommu.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/iom

[Xen-devel] [RFC v1 03/15] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-03-25 Thread Feng Wu
Extend struct pi_desc according to VT-d Posted-Interrupts Spec. Signed-off-by: Feng Wu --- xen/include/asm-x86/hvm/vmx/vmcs.h | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h index

[Xen-devel] [RFC v1 13/15] Update Posted-Interrupts Descriptor during vCPU scheduling

2015-03-25 Thread Feng Wu
terrupts. (Current, we only support non-urgent interrupts) - Set 'NV' back to 'Notification Vector' if needed. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmx.c | 108 + xen/common/schedule.c | 3 ++ 2 files chan

[Xen-devel] [RFC v1 15/15] Add a command line parameter for VT-d posted-interrupts

2015-03-25 Thread Feng Wu
Enable VT-d Posted-Interrupts and add a command line parameter for it. Signed-off-by: Feng Wu --- xen/drivers/passthrough/iommu.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index 302e3e4..1bda7e9

[Xen-devel] [RFC v1 14/15] Suppress posting interrupts when 'SN' is set

2015-03-25 Thread Feng Wu
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 --- xen/arch/x86/hvm/vmx/vmx.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) d

[Xen-devel] [RFC v1 05/15] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-03-25 Thread Feng Wu
This patch initializes the VT-d Posted-interrupt Descriptor. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmcs.c | 3 +++ xen/include/asm-x86/hvm/vmx/vmx.h | 21 - 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch

[Xen-devel] [RFC v1 08/15] Update IRTE according to guest interrupt config changes

2015-03-25 Thread Feng Wu
vector-hashing mechamisn to find the destination vCPU. This follows the hardware behavior, since modern Intel CPUs use vector hashing to handle the lowest-priority interrupt. For multicase/broadcast vCPU, we cannot handle it via interrupt posting, still use interrupt remapping. Signed-off-by: Feng

[Xen-devel] [RFC v1 10/15] vmx: Define two per-cpu variants

2015-03-25 Thread Feng Wu
This patch defines two per-cpu variants: blocked_vcpu_on_cpu: A list storing the vCPUs which were blocked on this pCPU. blocked_vcpu_on_cpu_lock: The spinlock to protect blocked_vcpu_on_cpu. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmcs.c | 3 +++ xen/arch/x86/hvm/vmx/vmx.c

<    1   2   3