|   xen-ia64-devel
[Xen-ia64-devel] Re: [PATCH 11/15] ia64/pv_ops: paravirtualize	NR_IRQS 
| On Tue, Apr 22, 2008 at 05:08:22AM -0400, Jes Sorensen wrote:
> 
> > Make NR_IRQ overridable by each pv instances.
> > Pv instance may need each own number of irqs so that
> > NR_IRQS should be the maximum number of nr_irqs each
> > pv instances need.
> 
> This really looks dodgy.
> 
> +#ifdef CONFIG_PARAVIRT
> +
> +/* Determine the maximal NR_IRQ which each pv instances require.
> + * i.e. NR_IRQS = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, ...)
> + */
> +
> +#define NR_IRQS 1
> +
> +#if IA64_NATIVE_NR_IRQS > NR_IRQS
> +#undef NR_IRQS
> +#define NR_IRQS IA64_NATIVE_NR_IRQS
> +#endif
> +
> +#ifdef CONFIG_XEN
> +#include <asm/xen/irq.h>
> +#if XEN_NR_IRQS > NR_IRQS
> +#undef NR_IRQS
> +#define NR_IRQS XEN_NR_IRQS
> +#endif
> +#endif /* CONFIG_XEN */
> 
> I don't see why Xen needs special casing here, it really makes the
> code gross. Please use one typedef for this, like PARAVIRT_NR_IRQS or
> something like that, so we don't end up with a KVM special case, an
> LGUEST special case and a Xen special case.
I'm willing to introduce something like PARAVIRT_NR_IRQS,
but I don't see how PARAVIRT_NR_IRQS solves the issues.
What I want here is to define by cpp
#define PARAVIRT_NR_IRQS                                                \
        max(                                                            \
                IA64_NATIVE_NR_IRQS,                                    \
                XEN_NR_IRQS,            /* only if CONFIG_XEN */        \
                LGUSET_NR_IRQS,         /* only if CONFIG_LGUSET */     \
                KVM_GUEST_NR_IRQS,      /* only if CONFIG_KVM_GUEST */  \
                MORE_FUTURE_VM_NR_IRQS, /* only if ...*/                \
                ....    \
        )
Probably I'm missing something.
Could you suggest more concretly? Hopefully (pseudo) code snippet.
-- 
yamahata
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
 | 
 
| <Prev in Thread] | Current Thread | [Next in Thread> |  | [Xen-ia64-devel] [PATCH 01/15] ia64: preparation: remove extern in	irq_ia64.c, Isaku Yamahata
[Xen-ia64-devel] [PATCH 06/15] ia64/pv_ops: preparation for	paravirtulization of hand written assembly code., Isaku Yamahata
[Xen-ia64-devel] [PATCH 05/15] ia64/pv_ops: introduce pv_cpu_ops to	paravirtualize privileged instructions., Isaku Yamahata
[Xen-ia64-devel] [PATCH 14/15] ia64/pv_ops: add hooks, pv_irq_ops,	to paravirtualized irq related operations., Isaku Yamahata
[Xen-ia64-devel] [PATCH 08/15] ia64/pv_ops: paravirtualize	minstate.h., Isaku Yamahata
[Xen-ia64-devel] [PATCH 11/15] ia64/pv_ops: paravirtualize NR_IRQS, Isaku Yamahata
[Xen-ia64-devel] [PATCH 15/15] ia64/pv_ops: add to hooks,	pv_time_ops, for steal time accounting., Isaku Yamahata
[Xen-ia64-devel] [PATCH 12/15] ia64/pv_ops: define initialization	hooks, pv_init_ops, for paravirtualized environment., Isaku Yamahata
[Xen-ia64-devel] [PATCH 07/15] ia64/pv_ops: define paravirtualized	instructions for native., Isaku Yamahata
[Xen-ia64-devel] [PATCH 13/15] ia64/pv_ops: add hooks,	pv_iosapic_ops, to paravirtualize iosapic., Isaku Yamahata |  |  |