Skip to contentSkip to conversation

Deprecating HVM_PARAM_PAE_ENABLED

DISCUSSION Andrew Cooper 4 participants 7 messages Jul 9, 2018 – Jul 10, 2018

lore
Share & tools
lore
#0 lore raw

Hello,

(I feel as if I've sent this email before, but I can't find any record of it).

The parameter was introduced in e661d66f51 (2006) and used in Xen, but removed from the hypervisor in c/s 5f14a87ce (2008) when CPUID calculations where moved from the hypervisor into libxc.

However, the field has always been propagated in the migration stream. AFAICT, the only use for the HVM_PARAM is as a function parameter to xc_cpuid_apply_policy(), which is a very very expensive way of passing a function parameter!

Another curiosity is that HVM and PVH guests treat the toplevel xl.cfg pae boolean differently.  HVM honour the request, while PVH blindly ignores it and sets it to true.  There is nothing wrong (in principle) with a PVH non-PAE guest, so the boolean should be honoured IMO.

A separate usability niggle is that there is no interlink between the toplevel pae boolean and passing some custom cpuid= configuration.  The latter appears to take priority but only due to the order in which libxl processes the data.

Does anyone see any reason to keep HVM_PARAM_PAE_ENABLED around?

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#1 lore raw
Quoted 14 lines · Andrew Cooper

Hello,

(I feel as if I've sent this email before, but I can't find any record of it).

The parameter was introduced in e661d66f51 (2006) and used in Xen, but removed from the hypervisor in c/s 5f14a87ce (2008) when CPUID calculations where moved from the hypervisor into libxc.

However, the field has always been propagated in the migration stream. AFAICT, the only use for the HVM_PARAM is as a function parameter to xc_cpuid_apply_policy(), which is a very very expensive way of passing a function parameter!

Quoted 4 lines

Another curiosity is that HVM and PVH guests treat the toplevel xl.cfg pae boolean differently.  HVM honour the request, while PVH blindly ignores it and sets it to true.  There is nothing wrong (in principle) with a PVH non-PAE guest, so the boolean should be honoured IMO.

Yes I think it should be honoured in PVH.

Quoted 6 lines

A separate usability niggle is that there is no interlink between the toplevel pae boolean and passing some custom cpuid= configuration.  The latter appears to take priority but only due to the order in which libxl processes the data.

I think we either make them interact properly or document which one takes precedence.

Quoted 1 line

Does anyone see any reason to keep HVM_PARAM_PAE_ENABLED around?

No, not really.

Wei.

Quoted 2 lines

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw
In reply to Andrew Cooper
Quoted 14 lines · Andrew Cooper

Hello,

(I feel as if I've sent this email before, but I can't find any record of it).

The parameter was introduced in e661d66f51 (2006) and used in Xen, but removed from the hypervisor in c/s 5f14a87ce (2008) when CPUID calculations where moved from the hypervisor into libxc.

However, the field has always been propagated in the migration stream. AFAICT, the only use for the HVM_PARAM is as a function parameter to xc_cpuid_apply_policy(), which is a very very expensive way of passing a function parameter!

Quoted 4 lines

Another curiosity is that HVM and PVH guests treat the toplevel xl.cfg pae boolean differently.  HVM honour the request, while PVH blindly ignores it and sets it to true.  There is nothing wrong (in principle) with a PVH non-PAE guest, so the boolean should be honoured IMO.

Yes, this seems like a bug to me. When fixing it could you also please amend xl.cfg(5) to add that the pae option is available to PVH guests?

Quoted 6 lines

A separate usability niggle is that there is no interlink between the toplevel pae boolean and passing some custom cpuid= configuration.  The latter appears to take priority but only due to the order in which libxl processes the data.

Does anyone see any reason to keep HVM_PARAM_PAE_ENABLED around?

Given the argument above, no.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw
In reply to Andrew Cooper
Quoted 15 lines
Quoted 1 line
Quoted 1 line · On 09.07.18 at 18:54, <[email protected]> wrote:

The parameter was introduced in e661d66f51 (2006) and used in Xen, but removed from the hypervisor in c/s 5f14a87ce (2008) when CPUID calculations where moved from the hypervisor into libxc.

However, the field has always been propagated in the migration stream. AFAICT, the only use for the HVM_PARAM is as a function parameter to xc_cpuid_apply_policy(), which is a very very expensive way of passing a function parameter!

Another curiosity is that HVM and PVH guests treat the toplevel xl.cfg pae boolean differently. HVM honour the request, while PVH blindly ignores it and sets it to true. There is nothing wrong (in principle) with a PVH non-PAE guest, so the boolean should be honoured IMO.

Quoted 6 lines

A separate usability niggle is that there is no interlink between the toplevel pae boolean and passing some custom cpuid= configuration. The latter appears to take priority but only due to the order in which libxl processes the data.

Does anyone see any reason to keep HVM_PARAM_PAE_ENABLED around?

Fundamentally - no. What is the plan to communicate the guest config "pae=" value from libxl to libxc then?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
In reply to Wei Liu
Quoted 21 lines · Wei Liu
Quoted 14 lines · Andrew Cooper

Hello,

(I feel as if I've sent this email before, but I can't find any record of it).

The parameter was introduced in e661d66f51 (2006) and used in Xen, but removed from the hypervisor in c/s 5f14a87ce (2008) when CPUID calculations where moved from the hypervisor into libxc.

However, the field has always been propagated in the migration stream. AFAICT, the only use for the HVM_PARAM is as a function parameter to xc_cpuid_apply_policy(), which is a very very expensive way of passing a function parameter!

Quoted 4 lines

Another curiosity is that HVM and PVH guests treat the toplevel xl.cfg pae boolean differently.  HVM honour the request, while PVH blindly ignores it and sets it to true.  There is nothing wrong (in principle) with a PVH non-PAE guest, so the boolean should be honoured IMO.

Yes I think it should be honoured in PVH.

Quoted 7 lines
Quoted 5 lines

A separate usability niggle is that there is no interlink between the toplevel pae boolean and passing some custom cpuid= configuration.  The latter appears to take priority but only due to the order in which libxl processes the data.

I think we either make them interact properly or document which one takes precedence.

Actually, I'd opt for formally deprecating the toplevel boolean.  We will have to leave it working, but we should discourage its use.

In the past, it was used to hide PSE36 from 32bit HVM guests, as the shadow code doesn't support PSE36 (This questionable use has since been fixed differently).  It is also my understanding that shadowing 2-on-3 was easier than shadowing 3-on-3 back in the days of the 32bit hypervisor build, so hiding the PAE bit was a legitimate performance tradeoff.

However, PAE is a direct prerequisite for NX and 64bit support, so I don't expect anyone has used this option in the past 10 years.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw
In reply to Jan Beulich
Quoted 15 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line
Quoted 1 line · On 09.07.18 at 18:54, <[email protected]> wrote:

The parameter was introduced in e661d66f51 (2006) and used in Xen, but removed from the hypervisor in c/s 5f14a87ce (2008) when CPUID calculations where moved from the hypervisor into libxc.

However, the field has always been propagated in the migration stream. AFAICT, the only use for the HVM_PARAM is as a function parameter to xc_cpuid_apply_policy(), which is a very very expensive way of passing a function parameter!

Another curiosity is that HVM and PVH guests treat the toplevel xl.cfg pae boolean differently. HVM honour the request, while PVH blindly ignores it and sets it to true. There is nothing wrong (in principle) with a PVH non-PAE guest, so the boolean should be honoured IMO.

Quoted 8 lines
Quoted 6 lines

A separate usability niggle is that there is no interlink between the toplevel pae boolean and passing some custom cpuid= configuration. The latter appears to take priority but only due to the order in which libxl processes the data.

Does anyone see any reason to keep HVM_PARAM_PAE_ENABLED around?

Fundamentally - no. What is the plan to communicate the guest config "pae=" value from libxl to libxc then?

This is very pre-release atm (and I believe, a little out of date, but it does illustrate the point):

tools/libxc/include/xenctrl.h +41 -0
index 92ec0c6..61832ee 100644
@@ -1838,6 +1838,47 @@ int xc_cpuid_apply_policy(xc_interface *xch,
                           uint32_t domid,
                           uint32_t *featureset,
                           unsigned int nr_features);
+/*
+ * Combined CPUID and MSR policy interface.  The internal representation is
+ * opaque but can be serialised to an x86 architectural representation.
+ */
+typedef struct xc_cpu_policy xc_cpu_policy_t;
+
+/* Create and free a xc_cpu_policy object. */
+xc_cpu_policy_t *xc_cpu_policy_init(void);
+void xc_cpu_policy_free(xc_cpu_policy_t *policy);
+
+/* Retrieve a system policy, or get/set a domains policy. */
+int xc_cpu_policy_get_system(xc_interface *xch, unsigned int idx,
+                             xc_cpu_policy_t *policy);
+int xc_cpu_policy_get_domain(xc_interface *xch, uint32_t domid,
+                             xc_cpu_policy_t *policy);
+int xc_cpu_policy_set_domain(xc_interface *xch, uint32_t domid,
+                             const xc_cpu_policy_t *policy);
+
+/* Manipulate a policy via architectural representations. */
+int xc_cpu_policy_max_sizes(size_t *nr_cpuid, size_t *nr_msrs);
+int xc_cpu_policy_serialise(const xc_cpu_policy_t *policy,
+                            xen_cpuid_leaf_t *leaves, size_t *nr_leaves,
+                            xen_msr_entry_t *msrs, size_t *nr_msrs);
+int xc_cpu_policy_get_cpuid(const xc_cpu_policy_t *policy,
+                            unsigned int leaf, unsigned int subleaf,
+                            xen_cpuid_leaf_t *out);
+int xc_cpu_policy_get_msr(const xc_cpu_policy_t *policy,
+                          unsigned int msr, xen_msr_entry_t *out);
+int xc_cpu_policy_update_cpuid(xc_cpu_policy_t *policy,
+                               const xen_cpuid_leaf_t *leaves,
+                               size_t nr_leaves);
+int xc_cpu_policy_update_msrs(xc_cpu_policy_t *policy,
+                              const xen_msr_entry_t *msrs, size_t nr_msrs);
+
+/* Compatibility calculations. */
+bool xc_cpu_policy_is_compatible(const xc_cpu_policy_t *p1,
+                                 const xc_cpu_policy_t *p2);
+void xc_cpu_policy_calc_compatible(const xc_cpu_policy_t *p1,
+                                   const xc_cpu_policy_t *p2,
+                                   xc_cpu_policy_t *out);
+
 int xc_mca_op(xc_interface *xch, struct xen_mc *mc);
 int xc_mca_op_inject_v2(xc_interface *xch, unsigned int flags,
                         xc_cpumap_t cpumap, unsigned int nr_cpus);

This is the current proposed interface for the users of libxc to interact with the policy infrastructure.

In particular, xc_cpu_policy_{get,update}_cpuid() is intended for libxl to use to process the cpuid=[] configuration, which operates on a single leaf at any one time.  Implementing the toplevel pae boolean in terms of cpuid=["pae"] is trivial to arrange.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
In reply to Andrew Cooper
Quoted 40 lines · Andrew Cooper
Quoted 21 lines · Wei Liu
Quoted 14 lines · Andrew Cooper

Hello,

(I feel as if I've sent this email before, but I can't find any record of it).

The parameter was introduced in e661d66f51 (2006) and used in Xen, but removed from the hypervisor in c/s 5f14a87ce (2008) when CPUID calculations where moved from the hypervisor into libxc.

However, the field has always been propagated in the migration stream. AFAICT, the only use for the HVM_PARAM is as a function parameter to xc_cpuid_apply_policy(), which is a very very expensive way of passing a function parameter!

Quoted 4 lines

Another curiosity is that HVM and PVH guests treat the toplevel xl.cfg pae boolean differently.  HVM honour the request, while PVH blindly ignores it and sets it to true.  There is nothing wrong (in principle) with a PVH non-PAE guest, so the boolean should be honoured IMO.

Yes I think it should be honoured in PVH.

Quoted 7 lines
Quoted 5 lines

A separate usability niggle is that there is no interlink between the toplevel pae boolean and passing some custom cpuid= configuration.  The latter appears to take priority but only due to the order in which libxl processes the data.

I think we either make them interact properly or document which one takes precedence.

Actually, I'd opt for formally deprecating the toplevel boolean.  We will have to leave it working, but we should discourage its use.

In the past, it was used to hide PSE36 from 32bit HVM guests, as the shadow code doesn't support PSE36 (This questionable use has since been fixed differently).  It is also my understanding that shadowing 2-on-3 was easier than shadowing 3-on-3 back in the days of the 32bit hypervisor build, so hiding the PAE bit was a legitimate performance tradeoff.

Quoted 2 lines

However, PAE is a direct prerequisite for NX and 64bit support, so I don't expect anyone has used this option in the past 10 years.

Deprecating it is fine. We still need to document which takes precedence if user happens to specify top-level option and CPUID policy, or document its behaviour is implementation defined.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel