Isaku Yamahata
2008-Sep-12 10:09 UTC
[Xen-devel] [PATCH] fix "translate Xen-provided PIRQs" patch.
fix "translate Xen-provided PIRQs" patch. This patch fixes the ia64 breakage caused by 660:7886619f623e. The change set is very x86 specific. So the functions, evtchn_map_pirq(), evtchn_get_xen_pirq() should be arch specific. However the pulling out those function out from evntchan would be very ugly because they use static functions in the file. Eventually the issue in the upstream linux will be addressed by pv_ops, and it doesn''t matter much on 2.6.18-xen for ia64. So I keep this patch as small as possible for now. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> diff -r 035670ec617c drivers/xen/core/evtchn.c --- a/drivers/xen/core/evtchn.c Tue Sep 09 15:13:29 2008 +0100 +++ b/drivers/xen/core/evtchn.c Fri Sep 12 18:10:16 2008 +0900 @@ -761,9 +761,13 @@ irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0); } +#ifndef CONFIG_X86 +#define IO_APIC_IRQ(irq) (0) +#else #ifndef CONFIG_X86_IO_APIC #undef IO_APIC_IRQ #define IO_APIC_IRQ(irq) ((irq) >= pirq_to_irq(16)) +#endif #endif int evtchn_map_pirq(int irq, int xen_pirq) -- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Fixes an (unlikely) memory leak where mapped VT-d root entries are not unmapped on allocation failure code path. Signed-off-by: Ross Philipson <ross.philipson@citrix.com> diff -Nur a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c 2008-09-12 08:40:15.000000000 -0400 +++ b/xen/drivers/passthrough/vtd/iommu.c 2008-09-12 15:13:36.000000000 -0400 @@ -152,6 +152,7 @@ maddr = alloc_pgtable_maddr(); if ( maddr == 0 ) { + unmap_vtd_domain_page(root_entries); spin_unlock_irqrestore(&iommu->lock, flags); return 0; } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Isaku Yamahata
2008-Sep-16 02:38 UTC
Re: [Xen-devel] [PATCH] fix "translate Xen-provided PIRQs" patch.
Hi Keir. The c/s of 660:7886619f623e in linux-2.6.18-xen breaks ia64. Should I make the related functions arch-specific moving them to linux/arch/x86/kernel/io_apic-xen.c? Please consider applying the following patch or give me a suggestion. IA64 doesn''t have IO APIC so that the macro, IO_APIC_IRQ(), doesn''t make sense. Instead, it has IO SAPIC which differs from IO APIC. thanks, On Fri, Sep 12, 2008 at 07:09:48PM +0900, Isaku Yamahata wrote:> fix "translate Xen-provided PIRQs" patch. > > This patch fixes the ia64 breakage caused by 660:7886619f623e. > The change set is very x86 specific. So the functions, evtchn_map_pirq(), > evtchn_get_xen_pirq() should be arch specific. > > However the pulling out those function out from evntchan would be > very ugly because they use static functions in the file. > Eventually the issue in the upstream linux will be addressed by pv_ops, > and it doesn''t matter much on 2.6.18-xen for ia64. So I keep this patch > as small as possible for now. > > Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> > > diff -r 035670ec617c drivers/xen/core/evtchn.c > --- a/drivers/xen/core/evtchn.c Tue Sep 09 15:13:29 2008 +0100 > +++ b/drivers/xen/core/evtchn.c Fri Sep 12 18:10:16 2008 +0900 > @@ -761,9 +761,13 @@ > irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0); > } > > +#ifndef CONFIG_X86 > +#define IO_APIC_IRQ(irq) (0) > +#else > #ifndef CONFIG_X86_IO_APIC > #undef IO_APIC_IRQ > #define IO_APIC_IRQ(irq) ((irq) >= pirq_to_irq(16)) > +#endif > #endif > > int evtchn_map_pirq(int irq, int xen_pirq) > >-- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Sep-16 06:57 UTC
Re: [Xen-devel] [PATCH] fix "translate Xen-provided PIRQs" patch.
I''ll apply something like your patch. -- Keir On 16/9/08 03:38, "Isaku Yamahata" <yamahata@valinux.co.jp> wrote:> Hi Keir. > > The c/s of 660:7886619f623e in linux-2.6.18-xen breaks ia64. > Should I make the related functions arch-specific moving them > to linux/arch/x86/kernel/io_apic-xen.c? > Please consider applying the following patch or give me a suggestion. > > IA64 doesn''t have IO APIC so that the macro, IO_APIC_IRQ(), > doesn''t make sense. > Instead, it has IO SAPIC which differs from IO APIC. > > thanks, > > On Fri, Sep 12, 2008 at 07:09:48PM +0900, Isaku Yamahata wrote: >> fix "translate Xen-provided PIRQs" patch. >> >> This patch fixes the ia64 breakage caused by 660:7886619f623e. >> The change set is very x86 specific. So the functions, evtchn_map_pirq(), >> evtchn_get_xen_pirq() should be arch specific. >> >> However the pulling out those function out from evntchan would be >> very ugly because they use static functions in the file. >> Eventually the issue in the upstream linux will be addressed by pv_ops, >> and it doesn''t matter much on 2.6.18-xen for ia64. So I keep this patch >> as small as possible for now. >> >> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> >> >> diff -r 035670ec617c drivers/xen/core/evtchn.c >> --- a/drivers/xen/core/evtchn.c Tue Sep 09 15:13:29 2008 +0100 >> +++ b/drivers/xen/core/evtchn.c Fri Sep 12 18:10:16 2008 +0900 >> @@ -761,9 +761,13 @@ >> irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0); >> } >> >> +#ifndef CONFIG_X86 >> +#define IO_APIC_IRQ(irq) (0) >> +#else >> #ifndef CONFIG_X86_IO_APIC >> #undef IO_APIC_IRQ >> #define IO_APIC_IRQ(irq) ((irq) >= pirq_to_irq(16)) >> +#endif >> #endif >> >> int evtchn_map_pirq(int irq, int xen_pirq) >> >>_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Isaku Yamahata
2008-Sep-16 12:00 UTC
Re: [Xen-devel] [PATCH] fix "translate Xen-provided PIRQs" patch.
Thank you for the quick commit. Here is the patch to make xenLinux/ia64 boot. evnchn: fix to 669:0ba49e9e74f9. To keep the previous behavior of event channel for ia64, set identity_mapped_irq() true. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> diff -r 59d3dee69ddf drivers/xen/core/evtchn.c --- a/drivers/xen/core/evtchn.c Tue Sep 16 20:43:24 2008 +0900 +++ b/drivers/xen/core/evtchn.c Tue Sep 16 21:03:27 2008 +0900 @@ -764,7 +764,7 @@ #elif defined(CONFIG_X86) #define identity_mapped_irq(irq) (((irq) - PIRQ_BASE) < 16) #else -#define identity_mapped_irq(irq) (0) +#define identity_mapped_irq(irq) (1) #endif int evtchn_map_pirq(int irq, int xen_pirq) On Tue, Sep 16, 2008 at 07:57:31AM +0100, Keir Fraser wrote:> I''ll apply something like your patch. > > -- Keir > > On 16/9/08 03:38, "Isaku Yamahata" <yamahata@valinux.co.jp> wrote: > > > Hi Keir. > > > > The c/s of 660:7886619f623e in linux-2.6.18-xen breaks ia64. > > Should I make the related functions arch-specific moving them > > to linux/arch/x86/kernel/io_apic-xen.c? > > Please consider applying the following patch or give me a suggestion. > > > > IA64 doesn''t have IO APIC so that the macro, IO_APIC_IRQ(), > > doesn''t make sense. > > Instead, it has IO SAPIC which differs from IO APIC. > > > > thanks, > > > > On Fri, Sep 12, 2008 at 07:09:48PM +0900, Isaku Yamahata wrote: > >> fix "translate Xen-provided PIRQs" patch. > >> > >> This patch fixes the ia64 breakage caused by 660:7886619f623e. > >> The change set is very x86 specific. So the functions, evtchn_map_pirq(), > >> evtchn_get_xen_pirq() should be arch specific. > >> > >> However the pulling out those function out from evntchan would be > >> very ugly because they use static functions in the file. > >> Eventually the issue in the upstream linux will be addressed by pv_ops, > >> and it doesn''t matter much on 2.6.18-xen for ia64. So I keep this patch > >> as small as possible for now. > >> > >> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> > >> > >> diff -r 035670ec617c drivers/xen/core/evtchn.c > >> --- a/drivers/xen/core/evtchn.c Tue Sep 09 15:13:29 2008 +0100 > >> +++ b/drivers/xen/core/evtchn.c Fri Sep 12 18:10:16 2008 +0900 > >> @@ -761,9 +761,13 @@ > >> irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0); > >> } > >> > >> +#ifndef CONFIG_X86 > >> +#define IO_APIC_IRQ(irq) (0) > >> +#else > >> #ifndef CONFIG_X86_IO_APIC > >> #undef IO_APIC_IRQ > >> #define IO_APIC_IRQ(irq) ((irq) >= pirq_to_irq(16)) > >> +#endif > >> #endif > >> > >> int evtchn_map_pirq(int irq, int xen_pirq) > >> > >> > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >-- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel