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

[xen staging-4.13] tools/libxc: Fix HVM_PARAM_PAE_ENABLED handling in xc_cpuid_apply_policy()



commit 19e6009e5fd481ec6e3a4d7e464299076db4616b
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Dec 20 15:26:00 2019 +0000
Commit:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CommitDate: Tue May 5 15:48:05 2020 +0100

    tools/libxc: Fix HVM_PARAM_PAE_ENABLED handling in xc_cpuid_apply_policy()
    
    Despite as suggested in c/s 685e922d6f3, not all HVM_PARAMs are handled
    in the same way.  HVM_PARAM_PAE_ENABLED is a toolstack-only value, and
    the xc_cpuid_apply_policy() used to be the only consumer.
    
    Reinstate the old behaviour (mad as it is) to avoid regressions.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    (cherry picked from commit d79cc6bc2bac1cfba239e5b3e28a851fb22901dc)
---
 tools/libxc/xc_cpuid_x86.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index 519d6d8bd0..2540aa1e1c 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -579,6 +579,8 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid,
     }
     else
     {
+        uint64_t val;
+
         /*
          * Topology for HVM guests is entirely controlled by Xen.  For now, we
          * hardcode APIC_ID = vcpu_id * 2 to give the illusion of no SMT.
@@ -633,6 +635,16 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t 
domid,
         }
 
         /*
+         * HVM_PARAM_PAE_ENABLED is a parameter to this function, stashed in
+         * Xen.  Nothing else has ever taken notice of the value.
+         */
+        rc = xc_hvm_param_get(xch, domid, HVM_PARAM_PAE_ENABLED, &val);
+        if ( rc )
+            goto out;
+
+        p->basic.pae = val;
+
+        /*
          * These settings are necessary to cause earlier HVM_PARAM_NESTEDHVM /
          * XEN_DOMCTL_disable_migrate settings to be reflected correctly in
          * CPUID.  Xen will discard these bits if configuration hasn't been
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13



 


Rackspace

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