mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
This commit is contained in:
1 parent
ba1d4290de
commit
ff3315cdeb
2 files changed
+7
-6
No files matched your search
@@ -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); \
|
||||
|
||||
@@ -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 *);
|
||||
|
||||
|
||||