[Xen-devel] [PATCH v8 15/17] vmx: VT-d posted-interrupt core logic handling

2015-10-12 Thread Feng Wu
u.citrix.com> CC: Dario Faggioli <dario.faggi...@citrix.com> Sugguested-by: Dario Faggioli <dario.faggi...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> --- v8: - Remove the lazy context switch handling for PI state transition - Change PI state in vcpu_block() and do_po

[Xen-devel] [PATCH v8 05/17] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-10-12 Thread Feng Wu
Extend struct pi_desc according to VT-d Posted-Interrupts Spec. CC: Kevin Tian <kevin.t...@intel.com> CC: Keir Fraser <k...@xen.org> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-

[Xen-devel] [PATCH v8 00/17] Add VT-d Posted-Interrupts support

2015-10-12 Thread Feng Wu
. in the following URL: http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html Feng Wu (17): VT-d Posted-intterrupt (PI) design Add cmpxchg16b support for x86-64 iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature vt-d: VT-d Posted

[Xen-devel] [PATCH v8 10/17] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-10-12 Thread Feng Wu
Extend struct iremap_entry according to VT-d Posted-Interrupts Spec. CC: Yang Zhang <yang.z.zh...@intel.com> CC: Kevin Tian <kevin.t...@intel.com> Signed-off-by: Feng Wu <feng...@intel.com> Acked-by: Kevin Tian <kevin.t...@intel.com> --- v8: - Make use of the __ui

[Xen-devel] [PATCH v8 16/17] VT-d: Dump the posted format IRTE

2015-10-12 Thread Feng Wu
Add the utility to dump the posted format IRTE. CC: Yang Zhang <yang.z.zh...@intel.com> CC: Kevin Tian <kevin.t...@intel.com> Signed-off-by: Feng Wu <feng...@intel.com> --- v8: - Coding style v7: - Remove the two stage loop v6: - Fix a typo v4: - Newly added xen/drive

[Xen-devel] [PATCH v8 13/17] Update IRTE according to guest interrupt config changes

2015-10-12 Thread Feng Wu
<jbeul...@suse.com> Signed-off-by: Feng Wu <feng...@intel.com> Acked-by: Jan Beulich <jbeul...@suse.com> --- v8: - Remove local variable 'bitmap_array_size' - Use switch to replace if-else v7: - Remove some pointless debug printk - Fix a logic error when assigning 'deliv

[Xen-devel] [PATCH v8 04/17] vt-d: VT-d Posted-Interrupts feature detection

2015-10-12 Thread Feng Wu
gt; CC: Kevin Tian <kevin.t...@intel.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Reviewed-by: Jan Beulich <jbeul...@suse.com> --- v7: - Remove pointless "if non iommu_intremap then disable iommu_intpost" log

[Xen-devel] [PATCH v8 08/17] vmx: Suppress posting interrupts when 'SN' is set

2015-10-12 Thread Feng Wu
ooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Reviewed-by: Jan Beulich <jbeul...@suse.com> --- v8: - Parenthesize '1 << POSTED_INTR_ON' and '1 << POSTED_INTR_SN' v7: - Coding

[Xen-devel] [PATCH v8 09/17] VT-d: Remove pointless casts

2015-10-12 Thread Feng Wu
Remove pointless casts. CC: Yang Zhang <yang.z.zh...@intel.com> CC: Kevin Tian <kevin.t...@intel.com> Suggested-by: Jan Beulich <jbeul...@suse.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- v7: - R

[Xen-devel] [PATCH v8 06/17] vmx: Add some helper functions for Posted-Interrupts

2015-10-12 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. CC: Kevin Tian <kevin.t...@intel.com> CC: Keir Fraser <k...@xen.org> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <

[Xen-devel] [PATCH v8 02/17] Add cmpxchg16b support for x86-64

2015-10-12 Thread Feng Wu
This patch adds cmpxchg16b support for x86-64, so software can perform 128-bit atomic write/read. CC: Keir Fraser <k...@xen.org> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> --- v8: - Re

[Xen-devel] [PATCH v8 03/17] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-10-12 Thread Feng Wu
' to control whether enable VT-d posted-interrupt or not in the generic IOMMU code. CC: Jan Beulich <jbeul...@suse.com> CC: Kevin Tian <kevin.t...@intel.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Kevin Tian <kevin.t...@intel.com> Reviewed-by: Konrad Rzeszutek Wilk

[Xen-devel] [PATCH v8 12/17] x86: move some APIC related macros to apicdef.h

2015-10-12 Thread Feng Wu
Move some APIC related macros to apicdef.h, so they can be used outside of vlapic.c. CC: Keir Fraser <k...@xen.org> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> Acked-by: Jan Beulich &l

[Xen-devel] [PATCH v7 01/17] VT-d Posted-intterrupt (PI) design

2015-09-11 Thread Feng Wu
Add the design doc for VT-d PI. CC: Kevin Tian <kevin.t...@intel.com> CC: Yang Zhang <yang.z.zh...@intel.com> CC: Jan Beulich <jbeul...@suse.com> CC: Keir Fraser <k...@xen.org> CC: Andrew Cooper <andrew.coop...@citrix.com> CC: George Dunlap <george.dun...@eu.c

[Xen-devel] [PATCH v7 00/17] Add VT-d Posted-Interrupts support

2015-09-11 Thread Feng Wu
. in the following URL: http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html Feng Wu (17): VT-d Posted-intterrupt (PI) design Add cmpxchg16b support for x86-64 iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature vt-d: VT-d Posted

[Xen-devel] [PATCH v7 10/17] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-09-11 Thread Feng Wu
Extend struct iremap_entry according to VT-d Posted-Interrupts Spec. CC: Yang Zhang <yang.z.zh...@intel.com> CC: Kevin Tian <kevin.t...@intel.com> Signed-off-by: Feng Wu <feng...@intel.com> Acked-by: Kevin Tian <kevin.t...@intel.com> --- v7: - Add a __uint128_t membe

[Xen-devel] [PATCH v7 15/17] vmx: VT-d posted-interrupt core logic handling

2015-09-11 Thread Feng Wu
drew Cooper <andrew.coop...@citrix.com> CC: Kevin Tian <kevin.t...@intel.com> CC: George Dunlap <george.dun...@eu.citrix.com> CC: Dario Faggioli <dario.faggi...@citrix.com> Sugguested-by: Dario Faggioli <dario.faggi...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.co

[Xen-devel] [PATCH v7 14/17] vmx: Properly handle notification event when vCPU is running

2015-09-11 Thread Feng Wu
> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> Acked-by: Kevin Tian <kevin.t...@intel.com> --- v7: - Retain 'cli' in the comments to make it more understandable. - Register another not

[Xen-devel] [PATCH v7 06/17] vmx: Add some helper functions for Posted-Interrupts

2015-09-11 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. CC: Kevin Tian <kevin.t...@intel.com> CC: Keir Fraser <k...@xen.org> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <

[Xen-devel] [PATCH v7 07/17] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-09-11 Thread Feng Wu
This patch initializes the VT-d Posted-interrupt Descriptor. CC: Kevin Tian <kevin.t...@intel.com> CC: Keir Fraser <k...@xen.org> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> Acked-by: Ke

[Xen-devel] [PATCH v7 02/17] Add cmpxchg16b support for x86-64

2015-09-11 Thread Feng Wu
This patch adds cmpxchg16b support for x86-64, so software can perform 128-bit atomic write/read. CC: Keir Fraser <k...@xen.org> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> --- v7: - Make

[Xen-devel] [PATCH v7 09/17] VT-d: Remove pointless casts

2015-09-11 Thread Feng Wu
Remove pointless casts. CC: Yang Zhang <yang.z.zh...@intel.com> CC: Kevin Tian <kevin.t...@intel.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- v7: - Remove an 'u32' casting omitted in v5 v5: - Ne

[Xen-devel] [PATCH v7 08/17] vmx: Suppress posting interrupts when 'SN' is set

2015-09-11 Thread Feng Wu
ooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- v7: - Coding style - Read the current pi_desc.control as the intial value of prev.control v6: - Add some comments v5: - keep the vcpu_kick() a

[Xen-devel] [PATCH v7 05/17] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-09-11 Thread Feng Wu
Extend struct pi_desc according to VT-d Posted-Interrupts Spec. CC: Kevin Tian <kevin.t...@intel.com> CC: Keir Fraser <k...@xen.org> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-

[Xen-devel] [PATCH v7 04/17] vt-d: VT-d Posted-Interrupts feature detection

2015-09-11 Thread Feng Wu
gt; CC: Kevin Tian <kevin.t...@intel.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- v7: - Remove pointless "if non iommu_intremap then disable iommu_intpost" logic - Don't need to check !iommu_intremap or !iommu_i

[Xen-devel] [PATCH v7 12/17] x86: move some APIC related macros to apicdef.h

2015-09-11 Thread Feng Wu
Move some APIC related macros to apicdef.h, so they can be used outside of vlapic.c. CC: Keir Fraser <k...@xen.org> CC: Jan Beulich <jbeul...@suse.com> CC: Andrew Cooper <andrew.coop...@citrix.com> Signed-off-by: Feng Wu <feng...@intel.com> --- v7: - Put the Macros t

[Xen-devel] [PATCH v7 13/17] Update IRTE according to guest interrupt config changes

2015-09-11 Thread Feng Wu
<jbeul...@suse.com> Signed-off-by: Feng Wu <feng...@intel.com> --- v7: - Remove some pointless debug printk - Fix a logic error when assigning 'delivery_mode' - Adjust the definition of local variable 'idx' - Add a dprintk if we cannot find the vCPU from 'pi_find_dest_vcpu'

[Xen-devel] [PATCH v7 03/17] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-09-11 Thread Feng Wu
' to control whether enable VT-d posted-interrupt or not in the generic IOMMU code. CC: Jan Beulich <jbeul...@suse.com> CC: Kevin Tian <kevin.t...@intel.com> Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Kevin Tian <kevin.t...@intel.com> Reviewed-by: Konrad Rzeszutek Wilk

[Xen-devel] [PATCH v7 16/17] VT-d: Dump the posted format IRTE

2015-09-11 Thread Feng Wu
Add the utility to dump the posted format IRTE. CC: Yang Zhang <yang.z.zh...@intel.com> CC: Kevin Tian <kevin.t...@intel.com> Signed-off-by: Feng Wu <feng...@intel.com> --- v7: - Remove the two stage loop v6: - Fix a typo v4: - Newly added xen/drivers/passthroug

[Xen-devel] [PATCH v6 05/18] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-08-24 Thread Feng Wu
Extend struct pi_desc according to VT-d Posted-Interrupts Spec. CC: Kevin Tian kevin.t...@intel.com CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Andrew Cooper andrew.coop

[Xen-devel] [PATCH v6 13/18] Update IRTE according to guest interrupt config changes

2015-08-24 Thread Feng Wu
jbeul...@suse.com Signed-off-by: Feng Wu feng...@intel.com --- v6: - Use macro to replace plain numbers - Correct the overflow error in a loop v5: - Make 'struct vcpu *vcpu' const v4: - Make some 'int' variables 'unsigned int' in pi_find_dest_vcpu() - Make 'dest_id' uint32_t - Rename 'size

[Xen-devel] [PATCH v6 07/18] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-08-24 Thread Feng Wu
This patch initializes the VT-d Posted-interrupt Descriptor. CC: Kevin Tian kevin.t...@intel.com CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com Reviewed

[Xen-devel] [PATCH v6 06/18] vmx: Add some helper functions for Posted-Interrupts

2015-08-24 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. CC: Kevin Tian kevin.t...@intel.com CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Konrad

[Xen-devel] [PATCH v6 03/18] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-08-24 Thread Feng Wu
' to control whether enable VT-d posted-interrupt or not in the generic IOMMU code. CC: Jan Beulich jbeul...@suse.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Kevin Tian kevin.t...@intel.com Reviewed-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com --- v5

[Xen-devel] [PATCH v6 02/18] Add cmpxchg16b support for x86-64

2015-08-24 Thread Feng Wu
This patch adds cmpxchg16b support for x86-64, so software can perform 128-bit atomic write/read. CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v6: - Fix a typo v5: - Change back

[Xen-devel] [PATCH v6 00/18] Add VT-d Posted-Interrupts support

2015-08-24 Thread Feng Wu
. in the following URL: http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html Feng Wu (18): VT-d Posted-intterrupt (PI) design Add cmpxchg16b support for x86-64 iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature vt-d: VT-d Posted

[Xen-devel] [PATCH v6 01/18] VT-d Posted-intterrupt (PI) design

2015-08-24 Thread Feng Wu
Add the design doc for VT-d PI. CC: Kevin Tian kevin.t...@intel.com CC: Yang Zhang yang.z.zh...@intel.com CC: Jan Beulich jbeul...@suse.com CC: Keir Fraser k...@xen.org CC: Andrew Cooper andrew.coop...@citrix.com CC: George Dunlap george.dun...@eu.citrix.com Signed-off-by: Feng Wu feng

[Xen-devel] [PATCH v6 18/18] Add a command line parameter for VT-d posted-interrupts

2015-08-24 Thread Feng Wu
Enable VT-d Posted-Interrupts and add a command line parameter for it. Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Kevin Tian kevin.t...@intel.com --- v6: - Change the default value to 'false' in xen-command-line.markdown docs/misc/xen-command-line.markdown | 9 - xen/drivers

[Xen-devel] [PATCH v6 16/18] vmx: Add some scheduler hooks for VT-d posted interrupts

2015-08-24 Thread Feng Wu
...@citrix.com CC: Kevin Tian kevin.t...@intel.com CC: George Dunlap george.dun...@eu.citrix.com CC: Dario Faggioli dario.faggi...@citrix.com Sugguested-by: Dario Faggioli dario.faggi...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Dario Faggioli dario.faggi...@citrix.com --- v6: - Add two

[Xen-devel] [PATCH v6 15/18] vmx: Properly handle notification event when vCPU is running

2015-08-24 Thread Feng Wu
Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v6: - Ack the interrupt in the beginning of pi_notification_interrupt() v4: - Coding style. v3: - Make pi_notification_interrupt() static xen

[Xen-devel] [PATCH v6 14/18] vmx: posted-interrupt handling when vCPU is blocked

2015-08-24 Thread Feng Wu
: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v6: - Fix some typos - Ack the interrupt right after the spin_unlock in pi_wakeup_interrupt() v4: - Use local variables in pi_wakeup_interrupt() - Remove vcpu from the blocked

[Xen-devel] [PATCH v6 17/18] VT-d: Dump the posted format IRTE

2015-08-24 Thread Feng Wu
Add the utility to dump the posted format IRTE. CC: Yang Zhang yang.z.zh...@intel.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com --- v6: - Fix a typo v4: - Newly added xen/drivers/passthrough/vtd/utils.c | 43 +++-- 1 file

[Xen-devel] [PATCH v6 12/18] x86: move some APIC related macros to apicdef.h

2015-08-24 Thread Feng Wu
Move some APIC related macros to apicdef.h, so they can be used outside of vlapic.c. Signed-off-by: Feng Wu feng...@intel.com --- v6: - Newly introduced. xen/arch/x86/hvm/vlapic.c | 5 - xen/include/asm-x86/apicdef.h | 4 2 files changed, 4 insertions(+), 5 deletions(-) diff --git

[Xen-devel] [PATCH v6 09/18] VT-d: Remove pointless casts

2015-08-24 Thread Feng Wu
Remove pointless casts. Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com --- v5: - Newly added. xen/drivers/passthrough/vtd/utils.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/xen/drivers/passthrough/vtd

[Xen-devel] [PATCH v6 10/18] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-08-24 Thread Feng Wu
Extend struct iremap_entry according to VT-d Posted-Interrupts Spec. CC: Yang Zhang yang.z.zh...@intel.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v4: - res_4 is not a bitfiled, correct it. - Expose 'im

[Xen-devel] [PATCH v6 08/18] vmx: Suppress posting interrupts when 'SN' is set

2015-08-24 Thread Feng Wu
Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com --- v6: - Add some comments v5: - keep the vcpu_kick() at the end of vmx_deliver_posted_intr() - Keep the 'return' after calling __vmx_deliver_posted_interrupt() v4: - Coding style. - V3 removes

[Xen-devel] [PATCH v5 11/17] vt-d: Add API to update IRTE when VT-d PI is used

2015-08-11 Thread Feng Wu
...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v5: - Make some function parameters const - Call spin_unlock_irq(desc-lock); a little eariler - Add ASSERT(spin_is_locked(pcidevs_lock)) - -EBADSLT - -ENODEV, EBADSLT is removed in the lasted Xen v4: - Don't

[Xen-devel] [PATCH v5 10/17] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-08-11 Thread Feng Wu
Extend struct iremap_entry according to VT-d Posted-Interrupts Spec. CC: Yang Zhang yang.z.zh...@intel.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v4: - res_4 is not a bitfiled, correct it. - Expose 'im

[Xen-devel] [PATCH v5 13/17] vmx: posted-interrupt handling when vCPU is blocked

2015-08-11 Thread Feng Wu
: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Use local variables in pi_wakeup_interrupt() - Remove vcpu from the blocked list when pi_desc.on==1, this - avoid kick vcpu multiple times. - Remove tasklet v3

[Xen-devel] [PATCH v5 16/17] VT-d: Dump the posted format IRTE

2015-08-11 Thread Feng Wu
Add the utility to dump the posted format IRTE. CC: Yang Zhang yang.z.zh...@intel.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Newly added xen/drivers/passthrough/vtd/utils.c | 41 - 1 file changed, 40 insertions

[Xen-devel] [PATCH v5 12/17] Update IRTE according to guest interrupt config changes

2015-08-11 Thread Feng Wu
jbeul...@suse.com Signed-off-by: Feng Wu feng...@intel.com --- v5: - Make 'struct vcpu *vcpu' const v4: - Make some 'int' variables 'unsigned int' in pi_find_dest_vcpu() - Make 'dest_id' uint32_t - Rename 'size' to 'bitmap_array_size' - find_next_bit() and find_first_bit() always return unsigned int

[Xen-devel] [PATCH v5 15/17] vmx: Add some scheduler hooks for VT-d posted interrupts

2015-08-11 Thread Feng Wu
...@citrix.com CC: Kevin Tian kevin.t...@intel.com CC: George Dunlap george.dun...@eu.citrix.com CC: Dario Faggioli dario.faggi...@citrix.com Sugguested-by: Dario Faggioli dario.faggi...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v5: - Rename arch_vcpu_wake to arch_vcpu_wake_prepare - Make

[Xen-devel] [PATCH v5 17/17] Add a command line parameter for VT-d posted-interrupts

2015-08-11 Thread Feng Wu
Enable VT-d Posted-Interrupts and add a command line parameter for it. Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Kevin Tian kevin.t...@intel.com --- docs/misc/xen-command-line.markdown | 9 - xen/drivers/passthrough/iommu.c | 3 +++ 2 files changed, 11 insertions(+), 1

[Xen-devel] [PATCH v5 09/17] VT-d: Remove pointless casts

2015-08-11 Thread Feng Wu
Remove pointless casts. Signed-off-by: Feng Wu feng...@intel.com --- v5: - Newly added. xen/drivers/passthrough/vtd/utils.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c index

[Xen-devel] [PATCH v5 04/17] vt-d: VT-d Posted-Interrupts feature detection

2015-08-11 Thread Feng Wu
Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com --- v5: - Remove blank line v4: - Correct a logic error when setting iommu_intpost to 0 v3: - Remove the if no intremap then no intpost logic in intel_vtd_setup(), it is covered in the iommu_setup(). - Add if no intremap

[Xen-devel] [PATCH v5 14/17] vmx: Properly handle notification event when vCPU is running

2015-08-11 Thread Feng Wu
Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v4: - Coding style. v3: - Make pi_notification_interrupt() static xen/arch/x86/hvm/vmx/vmx.c | 47

[Xen-devel] [PATCH v5 08/17] vmx: Suppress posting interrupts when 'SN' is set

2015-08-11 Thread Feng Wu
Signed-off-by: Feng Wu feng...@intel.com --- v5: - keep the vcpu_kick() at the end of vmx_deliver_posted_intr() - Keep the 'return' after calling __vmx_deliver_posted_interrupt() v4: - Coding style. - V3 removes a vcpu_kick() from the eoi_exitmap_changed path incorrectly, fix it. v3: - use

[Xen-devel] [PATCH v5 05/17] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-08-11 Thread Feng Wu
Extend struct pi_desc according to VT-d Posted-Interrupts Spec. CC: Kevin Tian kevin.t...@intel.com CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Andrew Cooper andrew.coop

[Xen-devel] [PATCH v5 01/17] VT-d Posted-intterrupt (PI) design

2015-08-11 Thread Feng Wu
Add the design doc for VT-d PI. CC: Kevin Tian kevin.t...@intel.com CC: Yang Zhang yang.z.zh...@intel.com CC: Jan Beulich jbeul...@suse.com CC: Keir Fraser k...@xen.org CC: Andrew Cooper andrew.coop...@citrix.com CC: George Dunlap george.dun...@eu.citrix.com Signed-off-by: Feng Wu feng

[Xen-devel] [PATCH v5 03/17] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-08-11 Thread Feng Wu
' to control whether enable VT-d posted-interrupt or not in the generic IOMMU code. CC: Jan Beulich jbeul...@suse.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Kevin Tian kevin.t...@intel.com --- v5: - Remove the if no intremap then no intpost logic

[Xen-devel] [PATCH v5 06/17] vmx: Add some helper functions for Posted-Interrupts

2015-08-11 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. CC: Kevin Tian kevin.t...@intel.com CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Newly added xen

[Xen-devel] [PATCH v5 07/17] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-08-11 Thread Feng Wu
This patch initializes the VT-d Posted-interrupt Descriptor. CC: Kevin Tian kevin.t...@intel.com CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v3

[Xen-devel] [PATCH v5 02/17] Add cmpxchg16b support for x86-64

2015-08-11 Thread Feng Wu
This patch adds cmpxchg16b support for x86-64, so software can perform 128-bit atomic write/read. CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v5: - Change back the parameters

[Xen-devel] [PATCH v5 00/17] Add VT-d Posted-Interrupts support

2015-08-11 Thread Feng Wu
. in the following URL: http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html Feng Wu (17): VT-d Posted-intterrupt (PI) design Add cmpxchg16b support for x86-64 iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature vt-d: VT-d Posted

[Xen-devel] [PATCH v1] xenpt: Properly handle 64-bit bar with more than 4G size

2015-08-04 Thread Feng Wu
io_regions[x] when handling XEN_PT_BAR_FLAG_UPPER. Signed-off-by: Feng Wu feng...@intel.com --- I cannot test this patch sicne I don't have such a device, if someone have it, it would be highly appreicated if he can help to verfiy this patch. hw/xen/xen_pt_config_init.c | 22 +++--- 1

[Xen-devel] [v4 11/17] vt-d: Add API to update IRTE when VT-d PI is used

2015-07-23 Thread Feng Wu
...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v4: - Don't inline setup_posted_irte() - const struct pi_desc *pi_desc for setup_posted_irte() - return -EINVAL when pirq_spin_lock_irq_desc() fails. - Make some variables const - Release irq desc lock earlier

[Xen-devel] [v4 13/17] vmx: posted-interrupt handling when vCPU is blocked

2015-07-23 Thread Feng Wu
: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Use local variables in pi_wakeup_interrupt() - Remove vcpu from the blocked list when pi_desc.on==1, this - avoid kick vcpu multiple times. - Remove tasklet v3

[Xen-devel] [v4 08/17] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-07-23 Thread Feng Wu
This patch initializes the VT-d Posted-interrupt Descriptor. CC: Kevin Tian kevin.t...@intel.com CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v4

[Xen-devel] [v4 12/17] Update IRTE according to guest interrupt config changes

2015-07-23 Thread Feng Wu
jbeul...@suse.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Make some 'int' variables 'unsigned int' in pi_find_dest_vcpu() - Make 'dest_id' uint32_t - Rename 'size' to 'bitmap_array_size' - find_next_bit() and find_first_bit() always return unsigned int, so no need to check whether

[Xen-devel] [v4 14/17] vmx: Properly handle notification event when vCPU is running

2015-07-23 Thread Feng Wu
Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v4: - Coding style. v3: - Make pi_notification_interrupt() static xen/arch/x86/hvm/vmx/vmx.c | 47

[Xen-devel] [v4 16/17] vmx: Add some scheduler hooks for VT-d posted interrupts

2015-07-23 Thread Feng Wu
: Kevin Tian kevin.t...@intel.com CC: George Dunlap george.dun...@eu.citrix.com CC: Dario Faggioli dario.faggi...@citrix.com Sugguested-by: Dario Faggioli dario.faggi...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Newly added xen/arch/x86/domain.c | 10 +++ xen/arch

[Xen-devel] [v4 17/17] VT-d: Dump the posted format IRTE

2015-07-23 Thread Feng Wu
Add the utility to dump the posted format IRTE. CC: Yang Zhang yang.z.zh...@intel.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Newly added xen/drivers/passthrough/vtd/utils.c | 41 - 1 file changed, 40 insertions

[Xen-devel] [v4 10/17] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-07-23 Thread Feng Wu
Extend struct iremap_entry according to VT-d Posted-Interrupts Spec. CC: Yang Zhang yang.z.zh...@intel.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com Acked-by: Kevin Tian kevin.t...@intel.com --- v4: - res_4 is not a bitfiled, correct it. - Expose 'im

[Xen-devel] [v4 15/17] arm: add a dummy arch hooks for scheduler

2015-07-23 Thread Feng Wu
Add a dummy arch hooks for scheduler to make the build successful in ARM. CC: Ian Campbell ian.campb...@citrix.com CC: Stefano Stabellini stefano.stabell...@citrix.com CC: Tim Deegan t...@xen.org Signed-off-by: Feng Wu feng...@intel.com --- v4: - Newly added xen/include/asm-arm/domain.h | 2

[Xen-devel] [v4 03/17] Add cmpxchg16b support for x86-64

2015-07-23 Thread Feng Wu
This patch adds cmpxchg16b support for x86-64, so software can perform 128-bit atomic write/read. CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Use pointer as the parameter

[Xen-devel] [v4 09/17] vmx: Suppress posting interrupts when 'SN' is set

2015-07-23 Thread Feng Wu
Signed-off-by: Feng Wu feng...@intel.com --- v4: - Coding style. - V3 removes a vcpu_kick() from the eoi_exitmap_changed path incorrectly, fix it. v3: - use cmpxchg to test SN/ON and set ON xen/arch/x86/hvm/vmx/vmx.c | 33 + 1 file changed, 29 insertions(+), 4

[Xen-devel] [v4 01/17] VT-d Posted-intterrupt (PI) design

2015-07-23 Thread Feng Wu
Add the design doc for VT-d PI. CC: Kevin Tian kevin.t...@intel.com CC: Yang Zhang yang.z.zh...@intel.com CC: Jan Beulich jbeul...@suse.com CC: Keir Fraser k...@xen.org CC: Andrew Cooper andrew.coop...@citrix.com CC: George Dunlap george.dun...@eu.citrix.com Signed-off-by: Feng Wu feng

[Xen-devel] [v4 02/17] Add helper macro for X86_FEATURE_CX16 feature detection

2015-07-23 Thread Feng Wu
Add macro cpu_has_cx16 to detect X86_FEATURE_CX16 feature. CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Kevin Tian kevin.t...@intel.com Reviewed

[Xen-devel] [v4 05/17] vt-d: VT-d Posted-Interrupts feature detection

2015-07-23 Thread Feng Wu
Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Correct a logic error when setting iommu_intpost to 0 v3: - Remove the if no intremap then no intpost logic in intel_vtd_setup(), it is covered in the iommu_setup(). - Add if no intremap then no intpost logic in the end

[Xen-devel] [v4 06/17] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-07-23 Thread Feng Wu
Extend struct pi_desc according to VT-d Posted-Interrupts Spec. CC: Kevin Tian kevin.t...@intel.com CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Andrew Cooper andrew.coop

[Xen-devel] [v4 04/17] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-07-23 Thread Feng Wu
' to control whether enable VT-d posted-interrupt or not in the generic IOMMU code. CC: Jan Beulich jbeul...@suse.com CC: Kevin Tian kevin.t...@intel.com Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Kevin Tian kevin.t...@intel.com --- v4: - No changes v3: - Remove pointless initializer

[Xen-devel] [v4 00/17] Add VT-d Posted-Interrupts support

2015-07-23 Thread Feng Wu
. in 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 (17): VT-d Posted-intterrupt (PI) design Add helper macro

[Xen-devel] [v4 07/17] vmx: Add some helper functions for Posted-Interrupts

2015-07-23 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. CC: Kevin Tian kevin.t...@intel.com CC: Keir Fraser k...@xen.org CC: Jan Beulich jbeul...@suse.com CC: Andrew Cooper andrew.coop...@citrix.com Signed-off-by: Feng Wu feng...@intel.com --- v4: - Newly added xen

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

2015-06-23 Thread Feng Wu
Enable VT-d Posted-Interrupts and add a command line parameter for it. Signed-off-by: Feng Wu feng...@intel.com --- v3: Remove the redundant no intremp then no intpost logic docs/misc/xen-command-line.markdown | 9 - xen/drivers/passthrough/iommu.c | 4 +++- 2 files changed, 11

[Xen-devel] [v3 14/15] Update Posted-Interrupts Descriptor during vCPU scheduling

2015-06-23 Thread Feng Wu
to 'Notification Vector' if needed. Signed-off-by: Feng Wu feng...@intel.com --- v3: * Use write_atomic() to update 'NV' and 'NDST' fileds. * Use MASK_INSR() to get the value for 'NDST' field * Add ASSERT_UNREACHABLE() for the break case in vmx_pi_desc_update() * Remove pointless NULL assignment

[Xen-devel] [v3 13/15] vmx: Properly handle notification event when vCPU is running

2015-06-23 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 feng...@intel.com --- v3: - Make

[Xen-devel] [v3 05/15] vt-d: VT-d Posted-Interrupts feature detection

2015-06-23 Thread Feng Wu
posted-interrupt. Signed-off-by: Feng Wu feng...@intel.com --- v3: - Remove the if no intremap then no intpost logic in intel_vtd_setup(), it is covered in the iommu_setup(). - Add if no intremap then no intpost logic in the end of init_vtd_hw() which is called by vtd_resume(). So the logic

[Xen-devel] [v3 02/15] Add helper macro for X86_FEATURE_CX16 feature detection

2015-06-23 Thread Feng Wu
Add macro cpu_has_cx16 to detect X86_FEATURE_CX16 feature. Signed-off-by: Feng Wu feng...@intel.com --- v3: - Newly added. We need to atomically update the IRTE in PI format via CMPXCHG16B which is only available with this feature. xen/include/asm-x86/cpufeature.h | 2 ++ 1 file changed, 2

[Xen-devel] [v3 12/15] vmx: posted-interrupt handling when vCPU is blocked

2015-06-23 Thread Feng Wu
vcpu_unblock cannot be called directly. - Define two per-cpu variables: * pi_blocked_vcpu: A list storing the vCPUs which were blocked on this pCPU. * pi_blocked_vcpu_lock: The spinlock to protect pi_blocked_vcpu. Signed-off-by: Feng Wu feng...@intel.com --- v3: - This patch

[Xen-devel] [v3 11/15] Update IRTE according to guest interrupt config changes

2015-06-23 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] [v3 09/15] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-06-23 Thread Feng Wu
Extend struct iremap_entry according to VT-d Posted-Interrupts Spec. Signed-off-by: Feng Wu feng...@intel.com --- v3: - Use u32 instead of u64 to define the bitfields in 'struct iremap_entry' - Limit using bitfield if possible xen/drivers/passthrough/vtd/intremap.c | 92

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

2015-06-23 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 feng...@intel.com --- v3: - Remove adding PDA_MASK() when updating 'pda_l' and 'pda_h' for IRTE. - Change the return type of pi_update_irte() to int

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

2015-06-23 Thread Feng Wu
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 struct pi_desc

[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 feng...@intel.com --- 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

[Xen-devel] [v3 04/15] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-06-23 Thread Feng Wu
' to control whether enable VT-d posted-interrupt or not in the generic IOMMU code. Signed-off-by: Feng Wu feng...@intel.com --- v3: - Remove pointless initializer for 'iommu_intpost'. - Some adjustment for if no intremap then no intpost logic. * For parse_iommu_param(), move it to the end

[Xen-devel] [v3 08/15] Suppress posting interrupts when 'SN' is set

2015-06-23 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 feng...@intel.com --- v3: use cmpxchg to test SN/ON and set ON xen/arch/x86/hvm/vmx/vmx.c | 32

[Xen-devel] [v3 06/15] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-06-23 Thread Feng Wu
Extend struct pi_desc according to VT-d Posted-Interrupts Spec. Signed-off-by: Feng Wu feng...@intel.com --- v3: - Use u32 instead of u64 for the bitfield in 'struct pi_desc' xen/include/asm-x86/hvm/vmx/vmcs.h | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git

[Xen-devel] [v3 03/15] Add cmpxchg16b support for x86-64

2015-06-23 Thread Feng Wu
This patch adds cmpxchg16b support for x86-64, so software can perform 128-bit atomic write/read. Signed-off-by: Feng Wu feng...@intel.com --- v3: Newly added. xen/include/asm-x86/x86_64/system.h | 28 xen/include/xen/types.h | 5 + 2 files changed

[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 feng...@intel.com --- xen/drivers/passthrough/vtd/intremap.c | 98 ++ xen/drivers/passthrough/vtd/iommu.h| 4 ++ xen

[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 feng...@intel.com --- xen/arch/x86/hvm/vmx/vmcs.c | 3 +++ xen/arch/x86/hvm/vmx/vmx.c

<    1   2   3   >