xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH] tools/libxc: Fix HVM_PARAM_PAE_ENABLED handling in xc_cpuid_apply_policy()
@ 2019-12-27 13:38 Andrew Cooper
  2019-12-27 13:54 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2019-12-27 13:38 UTC (permalink / raw)
  To: Xen-devel
  Cc: Andrew Cooper, Ian Jackson, Wei Liu, Jan Beulich, Roger Pau Monné

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@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Ian Jackson <Ian.Jackson@citrix.com>

Spotted while trying to come up with a less mad behaviour, and wondering
where the consumer had disappaered to.

This needs backporting to 4.13.

I was tempted to not fix it for the general security betterness of the
world (disabling PAE disables NX and 64bit), and while I could probably
get away with it, it would a little rude to do so.
---
 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
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Xen-devel] [PATCH] tools/libxc: Fix HVM_PARAM_PAE_ENABLED handling in xc_cpuid_apply_policy()
  2019-12-27 13:38 [Xen-devel] [PATCH] tools/libxc: Fix HVM_PARAM_PAE_ENABLED handling in xc_cpuid_apply_policy() Andrew Cooper
@ 2019-12-27 13:54 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2019-12-27 13:54 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Xen-devel, Ian Jackson, Wei Liu, Roger Pau Monné

On 27.12.2019 14:38, Andrew Cooper wrote:
> 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@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-27 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27 13:38 [Xen-devel] [PATCH] tools/libxc: Fix HVM_PARAM_PAE_ENABLED handling in xc_cpuid_apply_policy() Andrew Cooper
2019-12-27 13:54 ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).