From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH] external modules: Fix pre-2.6.18 kernels Date: Thu, 29 Jan 2009 22:38:52 +0800 Message-ID: <20090129143852.GA6758@yukikaze> References: <497F365D.7000302@siemens.com> <20090127175108.GA9002@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kiszka , "Yang, Sheng" , Avi Kivity , kvm-devel To: Marcelo Tosatti Return-path: Received: from wf-out-1314.google.com ([209.85.200.173]:53074 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753306AbZA2Oi4 (ORCPT ); Thu, 29 Jan 2009 09:38:56 -0500 Received: by wf-out-1314.google.com with SMTP id 27so8715475wfd.4 for ; Thu, 29 Jan 2009 06:38:55 -0800 (PST) Content-Disposition: inline In-Reply-To: <20090127175108.GA9002@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jan 27, 2009 at 03:51:08PM -0200, Marcelo Tosatti wrote: > On Tue, Jan 27, 2009 at 05:29:17PM +0100, Jan Kiszka wrote: > > pci_dev.msi_enabled was introduced in 2.6.18, thus building against > > older kernels now fail. Fix via a compat wrapper. > > > > Signed-off-by: Jan Kiszka > > --- > > > > kernel/external-module-compat-comm.h | 7 +++++++ > > kernel/x86/hack-module.awk | 2 ++ > > 2 files changed, 9 insertions(+), 0 deletions(-) > > > > diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h > > index 06af36d..937ba12 100644 > > --- a/kernel/external-module-compat-comm.h > > +++ b/kernel/external-module-compat-comm.h > > @@ -718,3 +718,10 @@ static inline void cpumask_clear_cpu(int cpu, cpumask_var_t mask) > > #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) > > #define marker_synchronize_unregister() synchronize_sched() > > #endif > > + > > +/* pci_dev.msi_enable was introduced in 2.6.18 */ > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) > > +#define kvm_pcidev_msi_enabled(dev) 1 > > +#else > > +#define kvm_pcidev_msi_enabled(dev) (dev)->msi_enabled > > +#endif > > I think this will break device assignment for if the device is not MSI > capable (if works at all in such older kernels). > > Need some other way to check if the device is MSI enabled. Perhaps > PCI_MSI_FLAGS_ENABLE bit? Sheng? Yes. I checked 2.6.17's code, seems if we indeed need this, the only way is converting it to a function which read from PCI configuration space and check PCI_MSI_FLAGS_ENABLE bit... (Or we can simply disable it for the old ones, but I think it's not desired). -- regards Yang, Sheng |Intel Opensource Technology Center