Re: [PATCH 05/11] KVM: Add fields for MSI device assignment

2008-11-25 Thread Avi Kivity

Sheng Yang wrote:

union {
+   struct {
+   __u32 addr_lo;
+   __u32 addr_hi;
  

__u64 addr;

?



Here I followed the spec that distinguish the Message Address and Message 
Upper address. And the native Linux structure:


struct msi_msg {
u32 address_lo; /* low 32 bits of msi message address */
u32 address_hi; /* high 32 bits of msi message address */
u32 data;   /* 16 bits of msi message data */
};

For now, we needn't care about address_hi. I can only see address_hi used in 
hypertransport part... So I think keep it independence here is OK.


  


Fair enough, documentation wins.

(In fact, PCI spec defined message data length is u64, but as you see, now 
msi_msg for whole Linux only have u32...)
  


Well in that case please define data as __u64, so we don't have 
surprises later on.


--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 05/11] KVM: Add fields for MSI device assignment

2008-11-25 Thread Avi Kivity

Avi Kivity wrote:
(In fact, PCI spec defined message data length is u64, but as you 
see, now msi_msg for whole Linux only have u32...)
  


Well in that case please define data as __u64, so we don't have 
surprises later on.




btw, if you agree with this, don't resend; I'll edit the patch.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 05/11] KVM: Add fields for MSI device assignment

2008-11-25 Thread Sheng Yang
On Tue, Nov 25, 2008 at 04:49:49PM +0200, Avi Kivity wrote:
 Avi Kivity wrote:
 (In fact, PCI spec defined message data length is u64, but as you  
 see, now msi_msg for whole Linux only have u32...)
   

 Well in that case please define data as __u64, so we don't have  
 surprises later on.


 btw, if you agree with this, don't resend; I'll edit the patch.

Sorry, I found I made a mistake. Intel SDM 3A misleaded me... The PCI spec
defined message data as u16(!!), but Intel SDM 3A got a figure(Figure 8-25) that
reserved all bits up to bit 63, so I thought message data got u64 long...(At
last moment, I remembered the figure on PCI spec and felt something
strange...)

Now I think the latest patchset(v6) is OK to apply.
--
regards
Yang, Sheng


 -- 
 error compiling committee.c: too many arguments to function

 --
 To unsubscribe from this list: send the line unsubscribe kvm in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 05/11] KVM: Add fields for MSI device assignment

2008-11-23 Thread Sheng Yang
On Sunday 23 November 2008 18:10:47 Avi Kivity wrote:
 Sheng Yang wrote:
  Prepared for kvm_arch_assigned_device_msi_dispatch().
 
  @@ -507,10 +507,17 @@ struct kvm_assigned_irq {
  __u32 guest_irq;
  __u32 flags;
  union {
  +   struct {
  +   __u32 addr_lo;
  +   __u32 addr_hi;

 __u64 addr;

 ?

Here I followed the spec that distinguish the Message Address and Message 
Upper address. And the native Linux structure:

struct msi_msg {
u32 address_lo; /* low 32 bits of msi message address */
u32 address_hi; /* high 32 bits of msi message address */
u32 data;   /* 16 bits of msi message data */
};

For now, we needn't care about address_hi. I can only see address_hi used in 
hypertransport part... So I think keep it independence here is OK.

(In fact, PCI spec defined message data length is u64, but as you see, now 
msi_msg for whole Linux only have u32...)

-- 
regards
Yang, Sheng


  +   __u32 data;
 
 
 
  @@ -307,8 +308,11 @@ struct kvm_assigned_dev_kernel {
  int host_devfn;
  int host_irq;
  int guest_irq;
  +   struct msi_msg guest_msi;
   #define KVM_ASSIGNED_DEV_GUEST_INTX(1  0)
  +#define KVM_ASSIGNED_DEV_GUEST_MSI (1  1)
   #define KVM_ASSIGNED_DEV_HOST_INTX (1  8)
  +#define KVM_ASSIGNED_DEV_HOST_MSI  (1  9)

 Okay, I see the reason for non sequential assignment.

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html