And replace direct accesses in non-HVM subsystems to
hvm_funcs.hap_supported with the new function, to avoid accessing an
internal data structure of another subsystem directly.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
*p = host_cpuid_policy;
cpuid_policy_to_featureset(p, hvm_featureset);
- hvm_featuremask = hvm_funcs.hap_supported ?
+ hvm_featuremask = hvm_hap_supported() ?
hvm_hap_featuremask : hvm_shadow_featuremask;
for ( i = 0; i < ARRAY_SIZE(hvm_featureset); ++i )
/* Need to determine if HAP is enabled before initialising paging */
if ( is_hvm_domain(d) )
d->arch.hvm_domain.hap_enabled =
- hvm_funcs.hap_supported && (config->flags & XEN_DOMCTL_CDF_hap);
+ hvm_hap_supported() && (config->flags & XEN_DOMCTL_CDF_hap);
if ( (rc = paging_domain_init(d, config->flags)) != 0 )
goto fail;
if ( dom0_pvh )
{
dom0_cfg.flags |= (XEN_DOMCTL_CDF_hvm_guest |
- ((hvm_funcs.hap_supported && !opt_dom0_shadow) ?
+ ((hvm_hap_supported() && !opt_dom0_shadow) ?
XEN_DOMCTL_CDF_hap : 0));
dom0_cfg.arch.emulation_flags |=
hvm_funcs.is_singlestep_supported());
}
+static inline bool hvm_hap_supported(void)
+{
+ return hvm_funcs.hap_supported;
+}
+
/* returns true if hardware supports alternate p2m's */
static inline bool hvm_altp2m_supported(void)
{