]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
xen: domain_pirq_to_emuirq return IRQ_UNBOUND by default
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 25 May 2012 07:20:14 +0000 (08:20 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 25 May 2012 07:20:14 +0000 (08:20 +0100)
domain_pirq_to_emuirq should return IRQ_UNBOUND rather than 0 on
missing entries.  Add a default parameter to pirq_field, so that
callers can set any default return value they want; use IRQ_UNBOUND in
domain_pirq_to_emuirq.

This patch fixes a regression introduced by 23573: save/restore
failing on upstream QEMU with PV on HVM guests.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/include/asm-x86/irq.h
xen/include/xen/irq.h

index ccc013e25c2b6386d14e2a874fa32c0b26d2ec31..40e22452d62c9fb036eb0e30080f49ce234703db 100644 (file)
@@ -173,13 +173,14 @@ void irq_set_affinity(struct irq_desc *, const cpumask_t *mask);
 int init_domain_irq_mapping(struct domain *);
 void cleanup_domain_irq_mapping(struct domain *);
 
-#define domain_pirq_to_irq(d, pirq) pirq_field(d, pirq, arch.irq)
+#define domain_pirq_to_irq(d, pirq) pirq_field(d, pirq, arch.irq, 0)
 #define domain_irq_to_pirq(d, irq) ({                           \
     void *__ret = radix_tree_lookup(&(d)->arch.irq_pirq, irq);  \
     __ret ? radix_tree_ptr_to_int(__ret) : 0;                   \
 })
 #define PIRQ_ALLOCATED -1
-#define domain_pirq_to_emuirq(d, pirq) pirq_field(d, pirq, arch.hvm.emuirq)
+#define domain_pirq_to_emuirq(d, pirq) pirq_field(d, pirq,              \
+    arch.hvm.emuirq, IRQ_UNBOUND)
 #define domain_emuirq_to_pirq(d, emuirq) ({                             \
     void *__ret = radix_tree_lookup(&(d)->arch.hvm_domain.emuirq_pirq,  \
                                     emuirq);                            \
index 852e038d5ad1d10df59ae6c3277d09816cff7ce8..cbe1dbc220ed42602475c5e57ecea3d7c111611b 100644 (file)
@@ -133,12 +133,12 @@ struct pirq {
 /* Use this instead of pirq_info() if the structure may need allocating. */
 extern struct pirq *pirq_get_info(struct domain *, int pirq);
 
-#define pirq_field(d, p, f) ({ \
+#define pirq_field(d, p, f, def) ({ \
     const struct pirq *__pi = pirq_info(d, p); \
-    __pi ? __pi->f : 0; \
+    __pi ? __pi->f : def; \
 })
-#define pirq_to_evtchn(d, pirq) pirq_field(d, pirq, evtchn)
-#define pirq_masked(d, pirq) pirq_field(d, pirq, masked)
+#define pirq_to_evtchn(d, pirq) pirq_field(d, pirq, evtchn, 0)
+#define pirq_masked(d, pirq) pirq_field(d, pirq, masked, 0)
 
 void pirq_cleanup_check(struct pirq *, struct domain *);