]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mem_sharing: gate enabling on cpu_has_vmx
authorTamas K Lengyel <tamas@tklengyel.com>
Wed, 27 May 2020 07:50:55 +0000 (09:50 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 27 May 2020 07:50:55 +0000 (09:50 +0200)
It is unclear whether mem_sharing was ever made to work on other architectures
but at this time the only verified platform for it is vmx. No plans to support
or maintain it on other architectures. Make this explicit by checking during
initialization.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
Reviewed-by: Wei Liu <wl@xen.org>
xen/arch/x86/mm/mem_sharing.c

index 7271e5c90b431b30c8a5a77181774ebb75b5ccba..19922ab5d1640d711fe3debd06b6caa9e1c3e84b 100644 (file)
@@ -1444,7 +1444,7 @@ static inline int mem_sharing_control(struct domain *d, bool enable,
 {
     if ( enable )
     {
-        if ( unlikely(!is_hvm_domain(d)) )
+        if ( unlikely(!is_hvm_domain(d) || !cpu_has_vmx) )
             return -EOPNOTSUPP;
 
         if ( unlikely(!hap_enabled(d)) )