* Re: config dependency in stable-2.6.32.x @ 2010-05-13 18:07 eXeC001er 2010-05-13 18:33 ` Pasi Kärkkäinen 0 siblings, 1 reply; 5+ messages in thread From: eXeC001er @ 2010-05-13 18:07 UTC (permalink / raw) To: Xen-devel [-- Attachment #1.1: Type: text/plain, Size: 433 bytes --] Hello. I tried to build stable-2.6.32.x (CONFIG_XEN_PLATFORM_PCI=y), but ... :>$ git branch xen/master * xen/stable-2.6.32.x drivers/built-in.o: In function `do_hvm_suspend': /opt/src/xen/linux-2.6-xen/drivers/xen/manage.c:124: undefined reference to `xenbus_suspend' /opt/src/xen/linux-2.6-xen/drivers/xen/manage.c:138: undefined reference to `xenbus_resume' make[1]: *** [.tmp_vmlinux1] Error 1 make: *** [sub-make] Error 2 [-- Attachment #1.2: Type: text/html, Size: 701 bytes --] [-- Attachment #2: Type: text/plain, Size: 138 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: config dependency in stable-2.6.32.x 2010-05-13 18:07 config dependency in stable-2.6.32.x eXeC001er @ 2010-05-13 18:33 ` Pasi Kärkkäinen 0 siblings, 0 replies; 5+ messages in thread From: Pasi Kärkkäinen @ 2010-05-13 18:33 UTC (permalink / raw) To: eXeC001er; +Cc: Xen-devel On Thu, May 13, 2010 at 10:07:12PM +0400, eXeC001er wrote: > Hello. > I tried to build stable-2.6.32.x (CONFIG_XEN_PLATFORM_PCI=y), but ... > :>$ git branch > Â Â xen/master > * xen/stable-2.6.32.x > drivers/built-in.o: In function `do_hvm_suspend': > /opt/src/xen/linux-2.6-xen/drivers/xen/manage.c:124: undefined reference > to `xenbus_suspend' > /opt/src/xen/linux-2.6-xen/drivers/xen/manage.c:138: undefined reference > to `xenbus_resume' > make[1]: *** [.tmp_vmlinux1] Error 1 > make: *** [sub-make] Error 2 Others have reported this problem aswell.. so it's a known issue atm. -- Pasi ^ permalink raw reply [flat|nested] 5+ messages in thread
* config dependency in stable-2.6.32.x @ 2010-05-06 20:45 M A Young 2010-05-06 22:02 ` M A Young 0 siblings, 1 reply; 5+ messages in thread From: M A Young @ 2010-05-06 20:45 UTC (permalink / raw) To: Jeremy Fitzhardinge; +Cc: xen-devel I was building a kernel and got the error drivers/built-in.o: In function `do_hvm_suspend': /builddir/build/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/drivers/xen/manage.c:124: undefined reference to `xenbus_suspend' /builddir/build/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/drivers/xen/manage.c:138: undefined reference to `xenbus_resume' As manage.c is built if CONFIG_XEN is selected and the do_hvm_suspend code segment is active if CONFIG_PM_SLEEP (which is on by default) is selected, this means that the current kernel won't build in this case unless CONFIG_XEN_XENBUS_FRONTEND=y as well to supply the xenbus references. Michael Young ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: config dependency in stable-2.6.32.x 2010-05-06 20:45 M A Young @ 2010-05-06 22:02 ` M A Young 2010-05-07 14:33 ` Stefano Stabellini 0 siblings, 1 reply; 5+ messages in thread From: M A Young @ 2010-05-06 22:02 UTC (permalink / raw) To: Jeremy Fitzhardinge; +Cc: xen-devel [-- Attachment #1: Type: TEXT/PLAIN, Size: 1712 bytes --] On Thu, 6 May 2010, M A Young wrote: > I was building a kernel and got the error > drivers/built-in.o: In function `do_hvm_suspend': > /builddir/build/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/drivers/xen/manage.c:124: > undefined reference to `xenbus_suspend' > /builddir/build/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/drivers/xen/manage.c:138: > undefined reference to `xenbus_resume' > > As manage.c is built if CONFIG_XEN is selected and the do_hvm_suspend code > segment is active if CONFIG_PM_SLEEP (which is on by default) is selected, > this means that the current kernel won't build in this case unless > CONFIG_XEN_XENBUS_FRONTEND=y as well to supply the xenbus references. The attached patch is a quick fix for the problem as CONFIG_XEN_XENBUS_FRONTEND can't be set directly. Having done this I get the error below so it looks like there are some problems with the XEN_PLATFORM_PCI code (I was building it with CONFIG_XEN_PLATFORM_PCI=m ). Michael Young drivers/xen/platform-pci.c:50: error: redefinition of 'alloc_xen_mmio' include/xen/platform_pci.h:38: note: previous definition of 'alloc_xen_mmio' was here drivers/xen/platform-pci.c:94: error: redefinition of 'platform_pci_disable_irq' include/xen/platform_pci.h:43: note: previous definition of 'platform_pci_disable_irq' was here drivers/xen/platform-pci.c:100: error: redefinition of 'platform_pci_enable_irq' include/xen/platform_pci.h:44: note: previous definition of 'platform_pci_enable_irq' was here drivers/xen/platform-pci.c:106: error: redefinition of 'platform_pci_resume' include/xen/platform_pci.h:42: note: previous definition of 'platform_pci_resume' was here make[2]: *** [drivers/xen/platform-pci.o] Error 1 [-- Attachment #2: Type: TEXT/PLAIN, Size: 391 bytes --] --- linux-2.6.32.x86_64/arch/x86/xen/Kconfig.orig 2010-05-06 21:14:55.000000000 +0100 +++ linux-2.6.32.x86_64/arch/x86/xen/Kconfig 2010-05-06 22:11:32.000000000 +0100 @@ -6,6 +6,7 @@ bool "Xen guest support" select PARAVIRT select PARAVIRT_CLOCK + select XEN_XENBUS_FRONTEND depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS) depends on X86_CMPXCHG && X86_TSC help [-- Attachment #3: Type: text/plain, Size: 138 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: config dependency in stable-2.6.32.x 2010-05-06 22:02 ` M A Young @ 2010-05-07 14:33 ` Stefano Stabellini 2010-05-07 16:00 ` Stefano Stabellini 2010-05-13 18:40 ` M A Young 0 siblings, 2 replies; 5+ messages in thread From: Stefano Stabellini @ 2010-05-07 14:33 UTC (permalink / raw) To: M A Young; +Cc: Jeremy Fitzhardinge, xen-devel@lists.xensource.com On Thu, 6 May 2010, M A Young wrote: > On Thu, 6 May 2010, M A Young wrote: > > > I was building a kernel and got the error > > drivers/built-in.o: In function `do_hvm_suspend': > > /builddir/build/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/drivers/xen/manage.c:124: > > undefined reference to `xenbus_suspend' > > /builddir/build/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/drivers/xen/manage.c:138: > > undefined reference to `xenbus_resume' > > > > As manage.c is built if CONFIG_XEN is selected and the do_hvm_suspend code > > segment is active if CONFIG_PM_SLEEP (which is on by default) is selected, > > this means that the current kernel won't build in this case unless > > CONFIG_XEN_XENBUS_FRONTEND=y as well to supply the xenbus references. > > The attached patch is a quick fix for the problem as > CONFIG_XEN_XENBUS_FRONTEND can't be set directly. Having done this I get > the error below so it looks like there are some problems with the > XEN_PLATFORM_PCI code (I was building it with CONFIG_XEN_PLATFORM_PCI=m ). > this is due to the newly added pv on hvm support, the root cause of the issue is that I am working on 2.6.32 and there is no CONFIG_XEN_XENBUS_FRONTEND there: xenbus_suspend and xenbus_resume are implemented in drivers/xen/xenbus/xenbus_probe.c that is always compiled when CONFIG_XEN is selected. I think that on pvops "select CONFIG_XEN_XENBUS_FRONTEND" needs to be added to XEN_PLATFORM_PCI rather than to CONFIG_XEN. > drivers/xen/platform-pci.c:50: error: redefinition of > 'alloc_xen_mmio' > include/xen/platform_pci.h:38: note: previous definition of > 'alloc_xen_mmio' was here > drivers/xen/platform-pci.c:94: error: redefinition of > 'platform_pci_disable_irq' > include/xen/platform_pci.h:43: note: previous definition of > 'platform_pci_disable_irq' was here > drivers/xen/platform-pci.c:100: error: redefinition of > 'platform_pci_enable_irq' > include/xen/platform_pci.h:44: note: previous definition of > 'platform_pci_enable_irq' was here > drivers/xen/platform-pci.c:106: error: redefinition of > 'platform_pci_resume' > include/xen/platform_pci.h:42: note: previous definition of > 'platform_pci_resume' was here > make[2]: *** [drivers/xen/platform-pci.o] Error 1 > I knew that xen platform pci device couldn't be compile as a module, now I fixed the problem and pushed the fix (also appended here). --- commit ace451e4ef87cfe749d06d51db09f662447e4934 Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Date: Fri May 7 15:25:30 2010 +0100 Allow xen platform pci device to be compiled as a module Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 92f393e..9dc2cbd 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -80,6 +80,7 @@ struct shared_info xen_dummy_shared_info; void *xen_initial_gdt; int xen_have_vector_callback; +EXPORT_SYMBOL_GPL(xen_have_vector_callback); int unplug; /* @@ -1327,6 +1328,7 @@ int xen_set_callback_via(uint64_t via) a.value = via; return HYPERVISOR_hvm_op(HVMOP_set_param, &a); } +EXPORT_SYMBOL_GPL(xen_set_callback_via); void do_hvm_pv_evtchn_intr(void) { diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 197ccbc..dc36943 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c @@ -686,6 +686,7 @@ void xen_hvm_evtchn_do_upcall(struct pt_regs *regs) { __xen_evtchn_do_upcall(regs); } +EXPORT_SYMBOL_GPL(xen_hvm_evtchn_do_upcall); /* Rebind a new event channel to an existing irq. */ void rebind_evtchn_irq(int evtchn, int irq) diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 3b43013..741ffa2 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -54,6 +54,9 @@ #define GNTTAB_LIST_END 0xffffffff #define GREFS_PER_GRANT_FRAME (PAGE_SIZE / sizeof(struct grant_entry)) +unsigned long (*alloc_xen_mmio_hook)(unsigned long len); +EXPORT_SYMBOL_GPL(alloc_xen_mmio_hook); + static grant_ref_t **gnttab_list; static unsigned int nr_grant_frames; static unsigned int boot_max_nr_grant_frames; @@ -512,7 +515,7 @@ int gnttab_resume(void) return gnttab_map(0, nr_grant_frames - 1); if (!hvm_pv_resume_frames) { - hvm_pv_resume_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); + hvm_pv_resume_frames = alloc_xen_mmio_hook(PAGE_SIZE * max_nr_gframes); shared = ioremap(hvm_pv_resume_frames, PAGE_SIZE * max_nr_gframes); if (shared == NULL) { printk(KERN_WARNING @@ -598,6 +601,7 @@ int gnttab_init(void) kfree(gnttab_list); return -ENOMEM; } +EXPORT_SYMBOL_GPL(gnttab_init); static int __devinit __gnttab_init(void) { diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 9d57194..9b54305 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -32,6 +32,13 @@ enum shutdown_state { SHUTDOWN_HALT = 4, }; +void (*platform_pci_resume_hook)(void); +EXPORT_SYMBOL_GPL(platform_pci_resume_hook); +void (*platform_pci_disable_irq_hook)(void); +EXPORT_SYMBOL_GPL(platform_pci_disable_irq_hook); +void (*platform_pci_enable_irq_hook)(void); +EXPORT_SYMBOL_GPL(platform_pci_enable_irq_hook); + /* Ignore multiple shutdown requests. */ static enum shutdown_state shutting_down = SHUTDOWN_INVALID; @@ -50,7 +57,7 @@ static int xen_hvm_suspend(void *data) if (!*cancelled) { xen_irq_resume(); - platform_pci_resume(); + platform_pci_resume_hook(); xen_timer_resume(); } @@ -126,7 +133,7 @@ static void do_hvm_suspend(void) printk(KERN_DEBUG "suspending xenstore... "); xenbus_suspend(); printk(KERN_DEBUG "xenstore suspended\n"); - platform_pci_disable_irq(); + platform_pci_disable_irq_hook(); err = stop_machine(xen_hvm_suspend, &cancelled, cpumask_of(0)); if (err) { @@ -134,7 +141,7 @@ static void do_hvm_suspend(void) cancelled = 1; } - platform_pci_enable_irq(); + platform_pci_enable_irq_hook(); if (!cancelled) { xen_arch_resume(); @@ -354,5 +361,6 @@ int xen_setup_shutdown_event(void) return 0; } +EXPORT_SYMBOL_GPL(xen_setup_shutdown_event); subsys_initcall(__setup_shutdown_event); diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c index f4818b3..9a4e5d6 100644 --- a/drivers/xen/platform-pci.c +++ b/drivers/xen/platform-pci.c @@ -29,6 +29,7 @@ #include <xen/grant_table.h> #include <xen/platform_pci.h> +#include <xen/platform_pci.h> #include <xen/interface/platform_pci.h> #include <xen/xenbus.h> #include <xen/events.h> @@ -251,6 +252,11 @@ static int __init platform_pci_module_init(void) ": No platform pci device model found\n"); return rc; } + + alloc_xen_mmio_hook = alloc_xen_mmio; + platform_pci_resume_hook = platform_pci_resume; + platform_pci_disable_irq_hook = platform_pci_disable_irq; + platform_pci_enable_irq_hook = platform_pci_enable_irq; return 0; } diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 867cb9f..13b2b6e 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c @@ -883,6 +883,7 @@ int xenbus_probe_init(void) out_error: return err; } +EXPORT_SYMBOL_GPL(xenbus_probe_init); postcore_initcall(__xenbus_probe_init); diff --git a/include/xen/platform_pci.h b/include/xen/platform_pci.h index ced434d..c3c2527 100644 --- a/include/xen/platform_pci.h +++ b/include/xen/platform_pci.h @@ -29,19 +29,9 @@ #define XEN_IOPORT_LINUX_PRODNUM 0xffff #define XEN_IOPORT_LINUX_DRVVER ((LINUX_VERSION_CODE << 8) + 0x0) -#ifdef CONFIG_XEN_PLATFORM_PCI -unsigned long alloc_xen_mmio(unsigned long len); -void platform_pci_resume(void); -void platform_pci_disable_irq(void); -void platform_pci_enable_irq(void); -#else -static inline unsigned long alloc_xen_mmio(unsigned long len) -{ - return ~0UL; -} -static inline void platform_pci_resume(void) {} -static inline void platform_pci_disable_irq(void) {} -static inline void platform_pci_enable_irq(void) {} -#endif +extern unsigned long (*alloc_xen_mmio_hook)(unsigned long len); +extern void (*platform_pci_resume_hook)(void); +extern void (*platform_pci_disable_irq_hook)(void); +extern void (*platform_pci_enable_irq_hook)(void); #endif /* _XEN_PLATFORM_PCI_H */ ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: Re: config dependency in stable-2.6.32.x 2010-05-07 14:33 ` Stefano Stabellini @ 2010-05-07 16:00 ` Stefano Stabellini 2010-05-13 18:40 ` M A Young 1 sibling, 0 replies; 5+ messages in thread From: Stefano Stabellini @ 2010-05-07 16:00 UTC (permalink / raw) To: Stefano Stabellini Cc: Jeremy Fitzhardinge, xen-devel@lists.xensource.com, M A Young On Fri, 7 May 2010, Stefano Stabellini wrote: > diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c > index f4818b3..9a4e5d6 100644 > --- a/drivers/xen/platform-pci.c > +++ b/drivers/xen/platform-pci.c > @@ -29,6 +29,7 @@ > > #include <xen/grant_table.h> > #include <xen/platform_pci.h> > +#include <xen/platform_pci.h> > #include <xen/interface/platform_pci.h> > #include <xen/xenbus.h> > #include <xen/events.h> > @@ -251,6 +252,11 @@ static int __init platform_pci_module_init(void) > ": No platform pci device model found\n"); > return rc; > } > + > + alloc_xen_mmio_hook = alloc_xen_mmio; > + platform_pci_resume_hook = platform_pci_resume; > + platform_pci_disable_irq_hook = platform_pci_disable_irq; > + platform_pci_enable_irq_hook = platform_pci_enable_irq; > > return 0; > } Actually I moved the hook initialization in platform_pci_init to cover the built-in case too. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: config dependency in stable-2.6.32.x 2010-05-07 14:33 ` Stefano Stabellini 2010-05-07 16:00 ` Stefano Stabellini @ 2010-05-13 18:40 ` M A Young 1 sibling, 0 replies; 5+ messages in thread From: M A Young @ 2010-05-13 18:40 UTC (permalink / raw) To: Stefano Stabellini; +Cc: Jeremy Fitzhardinge, xen-devel@lists.xensource.com On Fri, 7 May 2010, Stefano Stabellini wrote: > On Thu, 6 May 2010, M A Young wrote: >> On Thu, 6 May 2010, M A Young wrote: >>> As manage.c is built if CONFIG_XEN is selected and the do_hvm_suspend code >>> segment is active if CONFIG_PM_SLEEP (which is on by default) is selected, >>> this means that the current kernel won't build in this case unless >>> CONFIG_XEN_XENBUS_FRONTEND=y as well to supply the xenbus references. >> >> The attached patch is a quick fix for the problem as >> CONFIG_XEN_XENBUS_FRONTEND can't be set directly. Having done this I get >> the error below so it looks like there are some problems with the >> XEN_PLATFORM_PCI code (I was building it with CONFIG_XEN_PLATFORM_PCI=m ). >> > > this is due to the newly added pv on hvm support, the root cause of the > issue is that I am working on 2.6.32 and there is no > CONFIG_XEN_XENBUS_FRONTEND there: xenbus_suspend and xenbus_resume are > implemented in drivers/xen/xenbus/xenbus_probe.c that is always compiled > when CONFIG_XEN is selected. > I think that on pvops "select CONFIG_XEN_XENBUS_FRONTEND" needs to be > added to XEN_PLATFORM_PCI rather than to CONFIG_XEN. That doesn't help you on stable-2.6.32.x if XEN_PLATFORM_PCI=m or =n because the relevant lines in manage.c drivers/xen/manage.c are conditional on CONFIG_XEN and CONFIG_PM_SLEEP, and not on XEN_PLATFORM_PCI . Michael Young ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-13 18:40 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-05-13 18:07 config dependency in stable-2.6.32.x eXeC001er 2010-05-13 18:33 ` Pasi Kärkkäinen -- strict thread matches above, loose matches on Subject: below -- 2010-05-06 20:45 M A Young 2010-05-06 22:02 ` M A Young 2010-05-07 14:33 ` Stefano Stabellini 2010-05-07 16:00 ` Stefano Stabellini 2010-05-13 18:40 ` M A Young
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).