Re: [PATCH v4 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-09-11 Thread Robin Murphy
On 03/08/15 11:21, Yong Wu wrote: This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Signed-off-by: Yong Wu --- [...] +/* + * There is only one iommu domain called the m4u domain that + * all Multimedia modules share. + */ +static struct mtk_iommu_domain *m4udom;

Re: [PATCH v7 15/17] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > 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: F

Re: [PATCH v7 17/17] iommu/vt-d: Add a command line parameter for VT-d posted-interrupts

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > 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

Re: [PATCH v7 16/17] KVM: Warn if 'SN' is set during posting interrupts by software

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > Currently, we don't support urgent interrupt, all interrupts > are recognized as non-urgent interrupt, so we cannot post > interrupts when 'SN' is set. > > If the vcpu is in guest mode, it cannot have been scheduled out, > and that's the only case when SN is

Re: [PATCH v7 14/17] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > 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 >

Re: [PATCH v7 08/17] vfio: Select IRQ_BYPASS_MANAGER for vfio PCI devices

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > Enable irq bypass manager for vfio PCI devices. > > Signed-off-by: Feng Wu > --- > drivers/vfio/pci/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig > index 579d83b..02912f1 100644 > ---

Re: [PATCH v7 07/17] KVM: make kvm_set_msi_irq() public

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > 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/a

Re: [PATCH v7 06/17] KVM: Make struct kvm_irq_routing_table accessible

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > 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 | 14 ++ > virt/kvm/irqchip.c | 10 -- > 2 files changed, 14 inse

Re: [PATCH v7 04/17] KVM: Get Posted-Interrupts descriptor address from 'struct kvm_vcpu'

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > Define an interface to get PI descriptor address from the vCPU structure. > > Signed-off-by: Feng Wu See the later review, this interface and the one in patch 5 is too low-level. Paolo > --- > arch/x86/include/asm/kvm_host.h | 2 ++ > arch/x86/kvm/vmx.

Re: [PATCH v7 11/17] KVM: Define two weak arch callbacks for irq bypass manager

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > Define two weak arch callbacks so that archs that don't need > them don't need define them. > > Signed-off-by: Feng Wu > --- > virt/kvm/eventfd.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c

Re: [PATCH v7 13/17] KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > +void kvm_arch_irqfd_init(struct kvm_kernel_irqfd *irqfd) > +{ > + irqfd->arch_update = kvm_arch_update_pi_irte; > +} > + > EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_exit); > EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_inj_virq); > EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_page_fa

Re: [PATCH v7 12/17] KVM: Implement IRQ bypass consumer callbacks for x86

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > + struct kvm_kernel_irqfd *irqfd = > + container_of(cons, struct kvm_kernel_irqfd, consumer); > + > + irqfd->producer = prod; This assignment should be under "if (kvm_x86_ops->update_pi_irte)". > + return kvm_arch_update_pi_irte(irqf

Re: [PATCH v7 10/17] KVM: x86: Update IRTE for posted-interrupts

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > +int kvm_arch_update_pi_irte(struct kvm *kvm, unsigned int host_irq, > + uint32_t guest_irq, bool set) Please move all of this code to a vmx.c callback instead of adding get_pi_desc_addr. Check if this makes the pi_set_sn and pi_clear

Re: [PATCH v7 03/17] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > This patch defines a new interface kvm_intr_is_single_vcpu(), > which can returns whether the interrupt is for single-CPU or not. > > It is used by VT-d PI, since now we only support single-CPU > interrupts, For lowest-priority interrupts, if user configures

Re: [PATCH v7 02/17] KVM: Add some helper functions for Posted-Interrupts

2015-09-11 Thread Paolo Bonzini
On 25/08/2015 10:50, Feng Wu wrote: > 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/x8