Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-28 Thread Avi Kivity
On 06/25/2009 04:19 PM, Gregory Haskins wrote: Indeed. I will put something together. We should consider merging the io_bus cleanup I have for deregister support ASAP as well. If it makes things easier, we can also introduce a rwsem as an intermediary step. -- error compiling

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-25 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Wed, Jun 24, 2009 at 11:49:01AM +0300, Michael S. Tsirkin wrote: On Tue, Jun 23, 2009 at 09:43:31PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: Remove in_range from kvm_io_device and ask read/write callbacks, if supplied, to perform

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-25 Thread Michael S. Tsirkin
On Wed, Jun 24, 2009 at 11:49:01AM +0300, Michael S. Tsirkin wrote: On Tue, Jun 23, 2009 at 09:43:31PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: Remove in_range from kvm_io_device and ask read/write callbacks, if supplied, to perform range checks internally. This allows

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-25 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Wed, Jun 24, 2009 at 11:49:01AM +0300, Michael S. Tsirkin wrote: On Tue, Jun 23, 2009 at 09:43:31PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: Remove in_range from kvm_io_device and ask read/write callbacks, if supplied, to perform

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-25 Thread Michael S. Tsirkin
On Thu, Jun 25, 2009 at 07:27:36AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Wed, Jun 24, 2009 at 11:49:01AM +0300, Michael S. Tsirkin wrote: On Tue, Jun 23, 2009 at 09:43:31PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: Remove in_range

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-25 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Thu, Jun 25, 2009 at 07:27:36AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Wed, Jun 24, 2009 at 11:49:01AM +0300, Michael S. Tsirkin wrote: On Tue, Jun 23, 2009 at 09:43:31PM -0400, Gregory Haskins wrote:

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-25 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Thu, Jun 25, 2009 at 08:08:04AM -0400, Gregory Haskins wrote: The patch has been in circulation for weeks, is well tested/reviewed (and I hope its considered well written), and I want to get on with my life ;). Hey, I feel your pain, I've been reviewing

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-25 Thread Michael S. Tsirkin
On Thu, Jun 25, 2009 at 09:02:28AM -0400, Gregory Haskins wrote: Here's what I have in mind: kvm does lock dev = find unlock -- at this point group device is removed write access to device that has been removed Hmm...you are right. This

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-24 Thread Michael S. Tsirkin
On Tue, Jun 23, 2009 at 09:43:31PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: Remove in_range from kvm_io_device and ask read/write callbacks, if supplied, to perform range checks internally. This allows aliasing (mostly for in-kernel virtio), as well as better error handling

[PATCH] kvm: remove in_range from kvm_io_device

2009-06-23 Thread Michael S. Tsirkin
Remove in_range from kvm_io_device and ask read/write callbacks, if supplied, to perform range checks internally. This allows aliasing (mostly for in-kernel virtio), as well as better error handling by making it possible to pass errors up to userspace. And it's enough to look at the diffstat to

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-23 Thread Gregory Haskins
Michael S. Tsirkin wrote: Remove in_range from kvm_io_device and ask read/write callbacks, if supplied, to perform range checks internally. This allows aliasing (mostly for in-kernel virtio), as well as better error handling by making it possible to pass errors up to userspace. And it's enough

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-23 Thread Michael S. Tsirkin
On Tue, Jun 23, 2009 at 11:21:53AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: Remove in_range from kvm_io_device and ask read/write callbacks, if supplied, to perform range checks internally. This allows aliasing (mostly for in-kernel virtio), as well as better error handling

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-23 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Tue, Jun 23, 2009 at 11:21:53AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: Remove in_range from kvm_io_device and ask read/write callbacks, if supplied, to perform range checks internally. This allows aliasing (mostly for in-kernel virtio),

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-23 Thread Michael S. Tsirkin
On Tue, Jun 23, 2009 at 11:44:57AM -0400, Gregory Haskins wrote: This proposed approach forces us into a potential O(256) algorithm in the hotpath (all MMIO/PIO exits will hit this, not just in-kernel users). How would you address this? Two ideas that come to mind: - add

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-23 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Tue, Jun 23, 2009 at 11:44:57AM -0400, Gregory Haskins wrote: This proposed approach forces us into a potential O(256) algorithm in the hotpath (all MMIO/PIO exits will hit this, not just in-kernel users). How would you address this? Two

Re: [PATCH] kvm: remove in_range from kvm_io_device

2009-06-23 Thread Gregory Haskins
Michael S. Tsirkin wrote: Remove in_range from kvm_io_device and ask read/write callbacks, if supplied, to perform range checks internally. This allows aliasing (mostly for in-kernel virtio), as well as better error handling by making it possible to pass errors up to userspace. And it's enough