Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-21 Thread Radim Kr?má?
2015-01-20 23:04+0200, Nadav Amit: Radim Kr?má? rkrc...@redhat.com wrote: 2015-01-14 01:27+, Wu, Feng: the new hardware even doesn't consider the TPR for lowest priority interrupts delivery. A bold move ... what hardware was the first to do so? I think it was starting with

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-20 Thread Nadav Amit
Radim Kr?má? rkrc...@redhat.com wrote: 2015-01-14 01:27+, Wu, Feng: the new hardware even doesn't consider the TPR for lowest priority interrupts delivery. A bold move ... what hardware was the first to do so? I think it was starting with Nehalem. Thanks, (Could be that QPI

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-14 Thread Radim Kr?má?
2015-01-14 01:27+, Wu, Feng: the new hardware even doesn't consider the TPR for lowest priority interrupts delivery. A bold move ... what hardware was the first to do so? I think it was starting with Nehalem. Thanks, (Could be that QPI can't inform about TPR changes anymore

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-14 Thread Paolo Bonzini
On 14/01/2015 02:27, Wu, Feng wrote: As discussed with Paolo before, as the first stage, we only support single-CPU lowest priority for PI, since this is a new hardware feature enabling, Paolo trends to do simple things in the beginning. :) Nice way to sum it up! Paolo Then we will

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-13 Thread Wu, Feng
...@redhat.com; jiang@linux.intel.com; eric.au...@linaro.org; linux-ker...@vger.kernel.org; io...@lists.linux-foundation.org; kvm@vger.kernel.org Subject: Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI 2015-01-13 00:27+, Wu, Feng: On 09/01/2015 15:54

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-13 Thread Radim Kr?má?
2015-01-13 00:27+, Wu, Feng: On 09/01/2015 15:54, Radim Krčmář wrote: There are two points relevant to this patch in new KVM's implementation, (KVM: x86: amend APIC lowest priority arbitration, https://lkml.org/lkml/2015/1/9/362) 1) lowest priority depends on TPR 2) there

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-12 Thread Wu, Feng
...@redhat.com; jiang@linux.intel.com; eric.au...@linaro.org; linux-ker...@vger.kernel.org; io...@lists.linux-foundation.org; kvm@vger.kernel.org Subject: Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI On 09/01/2015 15:54, Radim Krčmář wrote: There are two

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-09 Thread Paolo Bonzini
On 09/01/2015 16:12, Radim Krčmář wrote: The chipset doesn't support it. :( I meant that we need to recompute PI entries for lowest priority interrupts every time guest's TPR changes. Luckily, Linux doesn't use TPR, but other OS might be a reason to drop lowest priority from PI

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-09 Thread Radim Krčmář
2015-01-09 15:56+0100, Paolo Bonzini: On 09/01/2015 15:54, Radim Krčmář wrote: There are two points relevant to this patch in new KVM's implementation, (KVM: x86: amend APIC lowest priority arbitration, https://lkml.org/lkml/2015/1/9/362) 1) lowest priority depends on TPR 2)

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-09 Thread Radim Krčmář
2015-01-09 16:18+0100, Paolo Bonzini: On 09/01/2015 16:12, Radim Krčmář wrote: The chipset doesn't support it. :( I meant that we need to recompute PI entries for lowest priority interrupts every time guest's TPR changes. Luckily, Linux doesn't use TPR, but other OS might be a

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-09 Thread Radim Krčmář
2014-12-12 23:14+0800, Feng Wu: This patch defines a new interface kvm_find_dest_vcpu for VT-d PI, which can returns the destination vCPU of the interrupt for guests. Since VT-d PI cannot handle broadcast/multicast interrupt, Here we only handle Fixed and Lowest priority interrupts. The

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-09 Thread Paolo Bonzini
On 09/01/2015 15:54, Radim Krčmář wrote: There are two points relevant to this patch in new KVM's implementation, (KVM: x86: amend APIC lowest priority arbitration, https://lkml.org/lkml/2015/1/9/362) 1) lowest priority depends on TPR 2) there is no need for balancing (1) has to be

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-22 Thread Paolo Bonzini
On 22/12/2014 05:48, Wu, Feng wrote: Do you mean we don't support Lowest priority interrupts? As I mentioned before, Lowest priority interrupts is widely used in Linux, so I think supporting lowest priority interrupts is very important for Linux guest OS. Do you have any

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-22 Thread Wu, Feng
: io...@lists.linux-foundation.org; linux-ker...@vger.kernel.org; KVM list; Eric Auger Subject: Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI On 22/12/2014 05:48, Wu, Feng wrote: Do you mean we don't support Lowest priority interrupts? As I mentioned before

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-22 Thread Paolo Bonzini
On 22/12/2014 12:04, Wu, Feng wrote: Can you support them only if the destination is a single CPU? Sorry, I am not quite understand this. I still don't understand the single CPU here. Lowest priority interrupts always have a cpumask which contains multiple CPU. Yes, and those need not be

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-22 Thread Wu, Feng
: io...@lists.linux-foundation.org; linux-ker...@vger.kernel.org; KVM list; Eric Auger Subject: Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI On 22/12/2014 12:04, Wu, Feng wrote: Can you support them only if the destination is a single CPU? Sorry, I am

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-22 Thread Paolo Bonzini
On 22/12/2014 12:17, Wu, Feng wrote: Yes, and those need not be accelerated. But what if you set affinity to a single CPU? How do I set affinity to a single CPU if guest configure a lowest priority interrupt? Thanks a lot! I mean if the guest (via irqbalance and /proc/irq/) configures

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-22 Thread Yong Wang
On Mon, Dec 22, 2014 at 12:23:36PM +0100, Paolo Bonzini wrote: On 22/12/2014 12:17, Wu, Feng wrote: Yes, and those need not be accelerated. But what if you set affinity to a single CPU? How do I set affinity to a single CPU if guest configure a lowest priority interrupt? Thanks a

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-22 Thread Zhang, Yang Z
Paolo Bonzini wrote on 2014-12-23: The problem is we still need to support PI with lowest priority delivery mode even if guest does not configure irq affinity via /proc/irq/. Don't we? Yes, but we can get the basic support working first. I and Feng talked on irc and agreed to start with a

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-21 Thread Wu, Feng
; j...@8bytes.org; Alex Williamson; Jiang Liu Cc: io...@lists.linux-foundation.org; linux-ker...@vger.kernel.org; KVM list; Eric Auger Subject: Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI On 20/12/2014 00:48, Wu, Feng wrote: In my understanding, lowest

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-20 Thread Paolo Bonzini
On 20/12/2014 00:48, Wu, Feng wrote: In my understanding, lowest priority interrupts are always delivered to a Single CPU, we need to find the right destination CPU from the cpumask. Yes, but which CPU however differs every time the interrupt is delivered. So the emulation here is a bit

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-19 Thread Paolo Bonzini
On 19/12/2014 02:30, Wu, Feng wrote: How this can work well? All subsequent interrupts are delivered to one vCPU? It shouldn't be the best solution, need more consideration. Well, it's a hardware limitation. The alternative (which is easy to implement) is to only do PI for single-CPU

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-19 Thread Wu, Feng
; j...@8bytes.org; Alex Williamson; Jiang Liu Cc: io...@lists.linux-foundation.org; linux-ker...@vger.kernel.org; KVM list; Eric Auger Subject: Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI On 19/12/2014 02:30, Wu, Feng wrote: How this can work well? All

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-18 Thread Zhang, Yang Z
Feng Wu wrote on 2014-12-12: This patch defines a new interface kvm_find_dest_vcpu for VT-d PI, which can returns the destination vCPU of the interrupt for guests. Since VT-d PI cannot handle broadcast/multicast interrupt, Here we only handle Fixed and Lowest priority interrupts. The

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-18 Thread Paolo Bonzini
On 18/12/2014 15:49, Zhang, Yang Z wrote: Here, we introduce a similar way with 'apic_arb_prio' to handle guest lowest priority interrtups when VT-d PI is used. Here is the ideas: - Each vCPU has a counter 'round_robin_counter'. - When guests sets an interrupts to lowest priority, we choose

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-18 Thread Zhang, Yang Z
Paolo Bonzini wrote on 2014-12-19: On 18/12/2014 15:49, Zhang, Yang Z wrote: Here, we introduce a similar way with 'apic_arb_prio' to handle guest lowest priority interrtups when VT-d PI is used. Here is the ideas: - Each vCPU has a counter 'round_robin_counter'. - When guests sets an

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-18 Thread Wu, Feng
@linux.intel.com Cc: eric.au...@linaro.org; linux-ker...@vger.kernel.org; io...@lists.linux-foundation.org; kvm@vger.kernel.org Subject: RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI Paolo Bonzini wrote on 2014-12-19: On 18/12/2014 15:49, Zhang, Yang Z wrote: Here

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-18 Thread Wu, Feng
...@redhat.com; jiang@linux.intel.com Cc: eric.au...@linaro.org; linux-ker...@vger.kernel.org; io...@lists.linux-foundation.org; kvm@vger.kernel.org Subject: Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI On 18/12/2014 15:49, Zhang, Yang Z wrote: Here, we

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-18 Thread Zhang, Yang Z
Wu, Feng wrote on 2014-12-19: Paolo Bonzini wrote on 2014-12-19: jiang@linux.intel.com Cc: eric.au...@linaro.org; linux-ker...@vger.kernel.org; io...@lists.linux-foundation.org; kvm@vger.kernel.org Subject: Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

[v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-12 Thread Feng Wu
This patch defines a new interface kvm_find_dest_vcpu for VT-d PI, which can returns the destination vCPU of the interrupt for guests. Since VT-d PI cannot handle broadcast/multicast interrupt, Here we only handle Fixed and Lowest priority interrupts. The current method of handling guest lowest