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

[PATCH 3/4] x86/paging: allow the paging mempool size domctls for PV domains



To have a more generic interface for sizing a domain's paging pool,
replace XEN_DOMCTL_SHADOW_OP_{GET,SET}_ALLOCATION by
XEN_DOMCTL_{get,set}_paging_mempool_size. These functions works on both
x86 and ARM, and take an exact size in bytes instead of whole MBytes.

But on x86, the paging mempool domctls currently reject PV domains with
-EOPNOTSUPP. Toolstacks use SHADOW_OP_SET_ALLOCATION to size the shadow
pool of PV domains too. So, as long as this restriction exists, x86
toolstacks can't switch to the new interface.

The check is only needed on builds without CONFIG_SHADOW_PAGING, where
shadow_set_allocation() is a stub containing ASSERT_UNREACHABLE(). So,
only reject PV domains without CONFIG_SHADOW_PAGING.

Signed-off-by: Julian Vetter <julian.vetter@xxxxxxxxxx>
---
Changes in v2:
- New patch
---
 xen/arch/x86/mm/paging.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 4bb8d169de..2ea7a472ab 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -959,7 +959,7 @@ int arch_get_paging_mempool_size(struct domain *d, uint64_t 
*size)
 {
     unsigned long pages;
 
-    if ( is_pv_domain(d) )                 /* TODO: Relax in due course */
+    if ( is_pv_domain(d) && !IS_ENABLED(CONFIG_SHADOW_PAGING) )
         return -EOPNOTSUPP;
 
     pages  = d->arch.paging.total_pages;
@@ -976,7 +976,7 @@ int arch_set_paging_mempool_size(struct domain *d, uint64_t 
size)
     bool preempted = false;
     int rc;
 
-    if ( is_pv_domain(d) )                 /* TODO: Relax in due course */
+    if ( is_pv_domain(d) && !IS_ENABLED(CONFIG_SHADOW_PAGING) )
         return -EOPNOTSUPP;
 
     if ( size & ~PAGE_MASK ||              /* Non page-sized request? */
-- 
2.53.0



--
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

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