From: Olaf Hering Date: Thu, 20 Oct 2011 10:25:58 +0000 (+0100) Subject: xenpaging: disallow paging in a PoD guest X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6123e225555d46d9f2666416f93ef9e3d3e1a7cc;p=xen.git xenpaging: disallow paging in a PoD guest Disallow xenpaging in a PoD guest until coexistance between the two features is properly implemented. Signed-off-by: Olaf Hering Acked-by: Tim Deegan Committed-by: Tim Deegan --- diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c index 7fbb177c70..8de1f368b3 100644 --- a/tools/xenpaging/xenpaging.c +++ b/tools/xenpaging/xenpaging.c @@ -246,6 +246,9 @@ static xenpaging_t *xenpaging_init(domid_t domain_id, int num_pages) case ENODEV: ERROR("EPT not supported for this guest"); break; + case EXDEV: + ERROR("xenpaging not supported in a PoD guest"); + break; default: ERROR("Error initialising shared page: %s", strerror(errno)); break; diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c index c6c864dbd5..2a3b5f596b 100644 --- a/xen/arch/x86/mm/mem_event.c +++ b/xen/arch/x86/mm/mem_event.c @@ -253,6 +253,7 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec, case XEN_DOMCTL_MEM_EVENT_OP_PAGING: { struct mem_event_domain *med = &d->mem_paging; + struct p2m_domain *p2m = p2m_get_hostp2m(d); rc = -ENODEV; /* Only HAP is supported */ if ( !hap_enabled(d) ) @@ -262,6 +263,11 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec, if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL ) break; + rc = -EXDEV; + /* Disallow paging in a PoD guest */ + if ( p2m->pod.entry_count ) + break; + switch( mec->op ) { case XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE: