Re: [PATCH v3] kvm: Use a bitmap for tracking used GSIs

2009-05-17 Thread Avi Kivity
Alex Williamson wrote: On Wed, 2009-05-13 at 10:04 +0300, Michael S. Tsirkin wrote: On Tue, May 12, 2009 at 04:07:15PM -0600, Alex Williamson wrote: @@ -286,6 +289,9 @@ kvm_context_t kvm_init(struct kvm_callbacks *callbacks, int fd; kvm_context_t kvm; int r;

Re: [PATCH v3] kvm: Use a bitmap for tracking used GSIs

2009-05-13 Thread Michael S. Tsirkin
On Tue, May 12, 2009 at 04:07:15PM -0600, Alex Williamson wrote: We're currently using a counter to track the most recent GSI we've handed out. This quickly hits KVM_MAX_IRQ_ROUTES when using device assignment with a driver that regularly toggles the MSI enable bit. BTW, dwhich driver does

Re: [PATCH v3] kvm: Use a bitmap for tracking used GSIs

2009-05-13 Thread Michael S. Tsirkin
On Tue, May 12, 2009 at 04:07:15PM -0600, Alex Williamson wrote: We're currently using a counter to track the most recent GSI we've handed out. This quickly hits KVM_MAX_IRQ_ROUTES when using device assignment with a driver that regularly toggles the MSI enable bit. This can mean only a few

Re: [PATCH v3] kvm: Use a bitmap for tracking used GSIs

2009-05-13 Thread Alex Williamson
On Wed, 2009-05-13 at 10:03 +0300, Michael S. Tsirkin wrote: On Tue, May 12, 2009 at 04:07:15PM -0600, Alex Williamson wrote: We're currently using a counter to track the most recent GSI we've handed out. This quickly hits KVM_MAX_IRQ_ROUTES when using device assignment with a driver that

Re: [PATCH v3] kvm: Use a bitmap for tracking used GSIs

2009-05-13 Thread Alex Williamson
On Wed, 2009-05-13 at 10:04 +0300, Michael S. Tsirkin wrote: On Tue, May 12, 2009 at 04:07:15PM -0600, Alex Williamson wrote: @@ -286,6 +289,9 @@ kvm_context_t kvm_init(struct kvm_callbacks *callbacks, int fd; kvm_context_t kvm; int r; +#ifdef KVM_CAP_IRQ_ROUTING Let's

Re: [PATCH v3] kvm: Use a bitmap for tracking used GSIs

2009-05-12 Thread Alex Williamson
On Tue, 2009-05-12 at 21:42 -0600, Alex Williamson wrote: On Wed, 2009-05-13 at 11:30 +0800, Yang, Sheng wrote: + kvm-used_gsi_bitmap = malloc(gsi_bytes); + if (!kvm-used_gsi_bitmap) { + pthread_mutex_unlock(kvm-gsi_mutex); + goto out_close; + } +

Re: [PATCH v3] kvm: Use a bitmap for tracking used GSIs

2009-05-12 Thread Yang, Sheng
On Wednesday 13 May 2009 12:10:34 Alex Williamson wrote: On Tue, 2009-05-12 at 21:42 -0600, Alex Williamson wrote: On Wed, 2009-05-13 at 11:30 +0800, Yang, Sheng wrote: + kvm-used_gsi_bitmap = malloc(gsi_bytes); + if (!kvm-used_gsi_bitmap) { +