From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH 05/11] KVM: Add fields for MSI device assignment Date: Mon, 24 Nov 2008 09:51:14 +0800 Message-ID: <200811240951.14758.sheng@linux.intel.com> References: <1227095114-13792-1-git-send-email-sheng@linux.intel.com> <1227095114-13792-6-git-send-email-sheng@linux.intel.com> <49292C27.7030206@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mga07.intel.com ([143.182.124.22]:50746 "EHLO azsmga101.ch.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751570AbYKXBy4 (ORCPT ); Sun, 23 Nov 2008 20:54:56 -0500 In-Reply-To: <49292C27.7030206@redhat.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: 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.