[PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-13 Thread Sheng Yang
Avi's purpose, to use single kvm_set_irq() to deal with all interrupt, including MSI. So here is it. struct gsi_route_entry is a mapping from a special gsi(with KVM_GSI_MSG_ENTRY_MASK) to MSI/MSI-X message address/data. And the struct can also be extended for other purpose. Now we support up to 1

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-11 Thread Sheng Yang
On Sunday 11 January 2009 17:38:22 Avi Kivity wrote: > Sheng Yang wrote: > > After reconsidering, I must say I prefer add/remove ioctls. > > > > About the code size, I don't think it would increase much. I've rewritten > > the code twice, I think I know the difference is little. > > > :( sorry abou

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-11 Thread Avi Kivity
Avi Kivity wrote: 1. add/remove ioctls The advantage is that very little work needs to be done when something changes, but the code size (and bug count) doubles. One disadvantage of add/remove is that we cannot effect a change atomically. Probably not a big deal, but something to keep in

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-11 Thread Avi Kivity
Sheng Yang wrote: After reconsidering, I must say I prefer add/remove ioctls. About the code size, I don't think it would increase much. I've rewritten the code twice, I think I know the difference is little. :( sorry about that. For the option 2 route table ioctl, we got a array from use

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-11 Thread Avi Kivity
Sheng Yang wrote: On Fri, Jan 09, 2009 at 08:06:01PM +0200, Avi Kivity wrote: Sheng Yang wrote: +struct kvm_gsi_route_entry_guest { what does _guest mean here? almost all kvm stuff is _guest related. Because I can't think of a good name... kvm_gsi_route_

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-10 Thread Sheng Yang
On Fri, Jan 09, 2009 at 08:06:01PM +0200, Avi Kivity wrote: > Sheng Yang wrote: >> I just use it as #ifdef in userspace now, for no user other than >> MSI/MSI-X now. And if we keep maintaining it in kernel, we would return >> free size instead of maximum size.. >> > > We need to allow userspac

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-10 Thread Sheng Yang
On Fri, Jan 09, 2009 at 08:06:01PM +0200, Avi Kivity wrote: > Sheng Yang wrote: +struct kvm_gsi_route_entry_guest { >>> what does _guest mean here? almost all kvm stuff is _guest related. >>> >> >> Because I can't think of a good name... kvm_gsi_route_entry_guest? >> kvm_gsi

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-09 Thread Avi Kivity
Sheng Yang wrote: +struct kvm_gsi_route_entry_guest { what does _guest mean here? almost all kvm stuff is _guest related. Because I can't think of a good name... kvm_gsi_route_entry_guest? kvm_gsi_kernel_route_entry? What's your favorite? :) kvm_gsi_route_entry? Since we

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-08 Thread Sheng Yang
On Thursday 08 January 2009 23:08:25 Avi Kivity wrote: > Sheng Yang wrote: > > Avi's purpose, to use single kvm_set_irq() to deal with all interrupt, > > including MSI. So here is it. > > > > struct gsi_route_entry is a mapping from a special gsi(with > > KVM_GSI_MSG_MASK) to MSI/MSI-X message addr

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-08 Thread Sheng Yang
On Thursday 08 January 2009 22:20:22 Marcelo Tosatti wrote: > On Thu, Jan 08, 2009 at 06:45:29PM +0800, Sheng Yang wrote: > > * ioctls for VM fds > > @@ -433,6 +436,8 @@ struct kvm_trace_rec { > > #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ > > struct kvm_assigned_irq) > >

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-08 Thread Avi Kivity
Sheng Yang wrote: Avi's purpose, to use single kvm_set_irq() to deal with all interrupt, including MSI. So here is it. struct gsi_route_entry is a mapping from a special gsi(with KVM_GSI_MSG_MASK) to MSI/MSI-X message address/data. And the struct can also be extended for other purpose. Now we s

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-08 Thread Marcelo Tosatti
On Thu, Jan 08, 2009 at 06:45:29PM +0800, Sheng Yang wrote: > * ioctls for VM fds > @@ -433,6 +436,8 @@ struct kvm_trace_rec { > #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ > struct kvm_assigned_irq) > #define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) > +#define KVM_RE

[PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-08 Thread Sheng Yang
Avi's purpose, to use single kvm_set_irq() to deal with all interrupt, including MSI. So here is it. struct gsi_route_entry is a mapping from a special gsi(with KVM_GSI_MSG_MASK) to MSI/MSI-X message address/data. And the struct can also be extended for other purpose. Now we support up to 256 gsi