[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86: move PIRQ EOI map fields to arch_domain
commit bd04059b1179df29c431e7cba17000052ea8e15c Author: Roger Pau Monné <roger.pau@xxxxxxxxxx> AuthorDate: Wed Apr 9 12:18:10 2014 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Wed Apr 9 12:18:10 2014 +0200 x86: move PIRQ EOI map fields to arch_domain This is done so PVH guests can use PHYSDEVOP_pirq_eoi_gmfn_v{1/2}. Update users of this fields, to reflect that this has been moved and it is now also available to other kind of guests. Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> Move auto_unmask ahead of the other two fields, to reduce padding. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- xen/arch/x86/domain.c | 15 +++++++-------- xen/arch/x86/hvm/hvm.c | 6 ------ xen/arch/x86/irq.c | 8 ++++---- xen/arch/x86/physdev.c | 13 ++++++------- xen/include/asm-x86/domain.h | 14 +++++++------- 5 files changed, 24 insertions(+), 32 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 796b775..8d9c883 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1934,15 +1934,14 @@ int domain_relinquish_resources(struct domain *d) */ destroy_gdt(v); } + } - if ( d->arch.pv_domain.pirq_eoi_map != NULL ) - { - unmap_domain_page_global(d->arch.pv_domain.pirq_eoi_map); - put_page_and_type( - mfn_to_page(d->arch.pv_domain.pirq_eoi_map_mfn)); - d->arch.pv_domain.pirq_eoi_map = NULL; - d->arch.pv_domain.auto_unmask = 0; - } + if ( d->arch.pirq_eoi_map != NULL ) + { + unmap_domain_page_global(d->arch.pirq_eoi_map); + put_page_and_type(mfn_to_page(d->arch.pirq_eoi_map_mfn)); + d->arch.pirq_eoi_map = NULL; + d->arch.auto_unmask = 0; } d->arch.relmem = RELMEM_shared; diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 38c491e..8c3797e 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -3446,12 +3446,6 @@ static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) case PHYSDEVOP_irq_status_query: case PHYSDEVOP_get_free_pirq: return do_physdev_op(cmd, arg); - - /* pvh fixme: coming soon */ - case PHYSDEVOP_pirq_eoi_gmfn_v1: - case PHYSDEVOP_pirq_eoi_gmfn_v2: - return -ENOSYS; - } } diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 88444be..60b1a506 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1068,14 +1068,14 @@ bool_t cpu_has_pending_apic_eoi(void) static inline void set_pirq_eoi(struct domain *d, unsigned int irq) { - if ( is_pv_domain(d) && d->arch.pv_domain.pirq_eoi_map ) - set_bit(irq, d->arch.pv_domain.pirq_eoi_map); + if ( d->arch.pirq_eoi_map ) + set_bit(irq, d->arch.pirq_eoi_map); } static inline void clear_pirq_eoi(struct domain *d, unsigned int irq) { - if ( is_pv_domain(d) && d->arch.pv_domain.pirq_eoi_map ) - clear_bit(irq, d->arch.pv_domain.pirq_eoi_map); + if ( d->arch.pirq_eoi_map ) + clear_bit(irq, d->arch.pirq_eoi_map); } static void set_eoi_ready(void *data); diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index bc0634c..f178315 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -310,8 +310,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) spin_unlock(&v->domain->event_lock); break; } - if ( is_pv_domain(v->domain) && - v->domain->arch.pv_domain.auto_unmask ) + if ( v->domain->arch.auto_unmask ) evtchn_unmask(pirq->evtchn); if ( is_pv_domain(v->domain) || domain_pirq_to_irq(v->domain, eoi.irq) > 0 ) @@ -354,7 +353,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) } mfn = page_to_mfn(page); - if ( cmpxchg(&v->domain->arch.pv_domain.pirq_eoi_map_mfn, + if ( cmpxchg(&v->domain->arch.pirq_eoi_map_mfn, 0, mfn) != 0 ) { put_page_and_type(mfn_to_page(mfn)); @@ -362,16 +361,16 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) break; } - v->domain->arch.pv_domain.pirq_eoi_map = map_domain_page_global(mfn); - if ( v->domain->arch.pv_domain.pirq_eoi_map == NULL ) + v->domain->arch.pirq_eoi_map = map_domain_page_global(mfn); + if ( v->domain->arch.pirq_eoi_map == NULL ) { - v->domain->arch.pv_domain.pirq_eoi_map_mfn = 0; + v->domain->arch.pirq_eoi_map_mfn = 0; put_page_and_type(mfn_to_page(mfn)); ret = -ENOSPC; break; } if ( cmd == PHYSDEVOP_pirq_eoi_gmfn_v1 ) - v->domain->arch.pv_domain.auto_unmask = 1; + v->domain->arch.auto_unmask = 1; ret = 0; break; diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h index 4ff89f0..bb28fc4 100644 --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -225,13 +225,6 @@ struct pv_domain { l1_pgentry_t **gdt_ldt_l1tab; - /* Shared page for notifying that explicit PIRQ EOI is required. */ - unsigned long *pirq_eoi_map; - unsigned long pirq_eoi_map_mfn; - /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically - * unmask the event channel */ - bool_t auto_unmask; - /* map_domain_page() mapping cache. */ struct mapcache_domain mapcache; }; @@ -313,6 +306,13 @@ struct arch_domain spinlock_t e820_lock; struct e820entry *e820; unsigned int nr_e820; + + /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically + * unmask the event channel */ + bool_t auto_unmask; + /* Shared page for notifying that explicit PIRQ EOI is required. */ + unsigned long *pirq_eoi_map; + unsigned long pirq_eoi_map_mfn; } __cacheline_aligned; #define has_arch_pdevs(d) (!list_empty(&(d)->arch.pdev_list)) -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |