[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xen: domain_pirq_to_emuirq return IRQ_UNBOUND by default


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Sat, 26 May 2012 00:22:06 +0000
  • Delivery-date: Sat, 26 May 2012 00:22:22 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
# Date 1337930414 -3600
# Node ID 12f338152c48d979ae8b3c41ae78fbf091d4d0cd
# Parent  69c3ae25bb1ddcb0ea44b7566d36d34e9d6a70aa
xen: domain_pirq_to_emuirq return IRQ_UNBOUND by default

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@xxxxxxxxxxxxx>
Committed-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 69c3ae25bb1d -r 12f338152c48 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h Wed May 23 17:20:18 2012 +0200
+++ b/xen/include/asm-x86/irq.h Fri May 25 08:20:14 2012 +0100
@@ -173,13 +173,14 @@ void irq_set_affinity(struct irq_desc *,
 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);                            \
diff -r 69c3ae25bb1d -r 12f338152c48 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h     Wed May 23 17:20:18 2012 +0200
+++ b/xen/include/xen/irq.h     Fri May 25 08:20:14 2012 +0100
@@ -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 *);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.