Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-18 Thread Avi Kivity
On 11/18/2010 04:22 AM, Sheng Yang wrote: On Wednesday 17 November 2010 22:01:41 Avi Kivity wrote: On 11/15/2010 11:15 AM, Sheng Yang wrote: We need to query the entry later. +int kvm_get_irq_routing_entry(struct kvm *kvm, int gsi, + struct kvm_kernel_irq_routing_entry

Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-18 Thread Michael S. Tsirkin
On Thu, Nov 18, 2010 at 11:30:47AM +0200, Avi Kivity wrote: *entry may be stale after rcu_read_unlock(). Is this a problem? I suppose not. All MSI-X MMIO accessing would be executed without delay, so no re- order issue would happen. If the guest is reading and writing the field at

Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-18 Thread Sheng Yang
On Thu, Nov 18, 2010 at 5:41 PM, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Nov 18, 2010 at 11:30:47AM +0200, Avi Kivity wrote:  *entry may be stale after rcu_read_unlock().  Is this a problem? I suppose not. All MSI-X MMIO accessing would be executed without delay, so no re-

Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-18 Thread Michael S. Tsirkin
On Thu, Nov 18, 2010 at 07:59:10PM +0800, Sheng Yang wrote: On Thu, Nov 18, 2010 at 5:41 PM, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Nov 18, 2010 at 11:30:47AM +0200, Avi Kivity wrote:  *entry may be stale after rcu_read_unlock().  Is this a problem? I suppose not. All

Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-18 Thread Sheng Yang
On Thu, Nov 18, 2010 at 8:33 PM, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Nov 18, 2010 at 07:59:10PM +0800, Sheng Yang wrote: On Thu, Nov 18, 2010 at 5:41 PM, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Nov 18, 2010 at 11:30:47AM +0200, Avi Kivity wrote:  *entry may be

Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-17 Thread Avi Kivity
On 11/15/2010 11:15 AM, Sheng Yang wrote: We need to query the entry later. +int kvm_get_irq_routing_entry(struct kvm *kvm, int gsi, + struct kvm_kernel_irq_routing_entry *entry) +{ + int count = 0; + struct kvm_kernel_irq_routing_entry *ei = NULL; + struct

Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-17 Thread Sheng Yang
On Wednesday 17 November 2010 22:01:41 Avi Kivity wrote: On 11/15/2010 11:15 AM, Sheng Yang wrote: We need to query the entry later. +int kvm_get_irq_routing_entry(struct kvm *kvm, int gsi, + struct kvm_kernel_irq_routing_entry *entry) +{ + int count = 0; + struct