diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c index 6cb805c162..1e6baf98f6 100644 --- a/tools/misc/xen-cpuid.c +++ b/tools/misc/xen-cpuid.c @@ -233,10 +233,12 @@ static const struct { #define COL_ALIGN "18" static const char *const fs_names[] = { - [XEN_SYSCTL_cpu_featureset_host] = "Host", - [XEN_SYSCTL_cpu_featureset_raw] = "Raw", - [XEN_SYSCTL_cpu_featureset_pv] = "PV", - [XEN_SYSCTL_cpu_featureset_hvm] = "HVM", + [XEN_SYSCTL_cpu_featureset_raw] = "Raw", + [XEN_SYSCTL_cpu_featureset_host] = "Host", + [XEN_SYSCTL_cpu_featureset_pv] = "PV Default", + [XEN_SYSCTL_cpu_featureset_hvm] = "HVM Default", + [XEN_SYSCTL_cpu_featureset_pv_max] = "PV Max", + [XEN_SYSCTL_cpu_featureset_hvm_max] = "HVM Max", }; static void dump_leaf(uint32_t leaf, const char *const *strs) diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml index 497ded7ce2..780cc71278 100644 --- a/tools/ocaml/libs/xc/xenctrl.ml +++ b/tools/ocaml/libs/xc/xenctrl.ml @@ -274,7 +274,13 @@ external version_changeset: handle -> string = "stub_xc_version_changeset" external version_capabilities: handle -> string = "stub_xc_version_capabilities" -type featureset_index = Featureset_raw | Featureset_host | Featureset_pv | Featureset_hvm +type featureset_index = + | Featureset_raw + | Featureset_host + | Featureset_pv + | Featureset_hvm + | Featureset_pv_max + | Featureset_hvm_max external get_cpu_featureset : handle -> featureset_index -> int64 array = "stub_xc_get_cpu_featureset" external watchdog : handle -> int -> int32 -> int diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli index 26ec7e59b1..508f4ae829 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli @@ -212,7 +212,13 @@ external version_changeset : handle -> string = "stub_xc_version_changeset" external version_capabilities : handle -> string = "stub_xc_version_capabilities" -type featureset_index = Featureset_raw | Featureset_host | Featureset_pv | Featureset_hvm +type featureset_index = + | Featureset_raw + | Featureset_host + | Featureset_pv + | Featureset_hvm + | Featureset_pv_max + | Featureset_hvm_max external get_cpu_featureset : handle -> featureset_index -> int64 array = "stub_xc_get_cpu_featureset" external pages_to_kib : int64 -> int64 = "stub_pages_to_kib" diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index b0cb1b57e7..dc105cb463 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -357,14 +357,16 @@ long arch_do_sysctl( case XEN_SYSCTL_get_cpu_featureset: { - static const struct cpuid_policy *const policy_table[4] = { + static const struct cpuid_policy *const policy_table[6] = { [XEN_SYSCTL_cpu_featureset_raw] = &raw_cpuid_policy, [XEN_SYSCTL_cpu_featureset_host] = &host_cpuid_policy, #ifdef CONFIG_PV [XEN_SYSCTL_cpu_featureset_pv] = &pv_def_cpuid_policy, + [XEN_SYSCTL_cpu_featureset_pv_max] = &pv_max_cpuid_policy, #endif #ifdef CONFIG_HVM [XEN_SYSCTL_cpu_featureset_hvm] = &hvm_def_cpuid_policy, + [XEN_SYSCTL_cpu_featureset_hvm_max] = &hvm_max_cpuid_policy, #endif }; const struct cpuid_policy *p = NULL; diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h index 7439cc154f..9091b469e2 100644 --- a/xen/include/public/sysctl.h +++ b/xen/include/public/sysctl.h @@ -804,6 +804,8 @@ struct xen_sysctl_cpu_featureset { #define XEN_SYSCTL_cpu_featureset_host 1 #define XEN_SYSCTL_cpu_featureset_pv 2 #define XEN_SYSCTL_cpu_featureset_hvm 3 +#define XEN_SYSCTL_cpu_featureset_pv_max 4 +#define XEN_SYSCTL_cpu_featureset_hvm_max 5 uint32_t index; /* IN: Which featureset to query? */ uint32_t nr_features; /* IN/OUT: Number of entries in/written to * 'features', or the maximum number of features if