[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 3 of 4] x86/mm: Check sharing/paging/access have been enabled before processing a memop
xen/arch/x86/mm/mem_access.c | 3 +++ xen/arch/x86/mm/mem_event.c | 6 ++++-- xen/arch/x86/mm/mem_paging.c | 3 +++ xen/arch/x86/mm/mem_sharing.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx> diff -r b03a10be1428 -r 7a1d415a71d0 xen/arch/x86/mm/mem_access.c --- a/xen/arch/x86/mm/mem_access.c +++ b/xen/arch/x86/mm/mem_access.c @@ -29,6 +29,9 @@ int mem_access_memop(struct domain *d, x { int rc; + if ( unlikely(!d->mem_event->access.ring_page) ) + return -ENODEV; + switch( meo->op ) { case XENMEM_access_op_resume: diff -r b03a10be1428 -r 7a1d415a71d0 xen/arch/x86/mm/mem_event.c --- a/xen/arch/x86/mm/mem_event.c +++ b/xen/arch/x86/mm/mem_event.c @@ -452,13 +452,15 @@ int mem_event_claim_slot(struct domain * /* Registered with Xen-bound event channel for incoming notifications. */ static void mem_paging_notification(struct vcpu *v, unsigned int port) { - p2m_mem_paging_resume(v->domain); + if ( likely(v->domain->mem_event->paging.ring_page != NULL) ) + p2m_mem_paging_resume(v->domain); } /* Registered with Xen-bound event channel for incoming notifications. */ static void mem_access_notification(struct vcpu *v, unsigned int port) { - p2m_mem_access_resume(v->domain); + if ( likely(v->domain->mem_event->access.ring_page != NULL) ) + p2m_mem_access_resume(v->domain); } struct domain *get_mem_event_op_target(uint32_t domain, int *rc) diff -r b03a10be1428 -r 7a1d415a71d0 xen/arch/x86/mm/mem_paging.c --- a/xen/arch/x86/mm/mem_paging.c +++ b/xen/arch/x86/mm/mem_paging.c @@ -27,6 +27,9 @@ int mem_paging_memop(struct domain *d, xen_mem_event_op_t *mec) { + if ( unlikely(!d->mem_event->paging.ring_page) ) + return -ENODEV; + switch( mec->op ) { case XENMEM_paging_op_nominate: diff -r b03a10be1428 -r 7a1d415a71d0 xen/arch/x86/mm/mem_sharing.c --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -1021,7 +1021,7 @@ int mem_sharing_memop(struct domain *d, int rc = 0; /* Only HAP is supported */ - if ( !hap_enabled(d) ) + if ( !hap_enabled(d) || !d->arch.hvm_domain.mem_sharing_enabled ) return -ENODEV; switch(mec->op) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |