static unsigned long *shadow_io_bitmap[3];
-/* Nested HVM on/off per domain */
-bool nestedhvm_enabled(const struct domain *d)
-{
- return is_hvm_domain(d) && d->arch.hvm_domain.params &&
- d->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM];
-}
-
/* Nested VCPU */
bool_t
nestedhvm_vcpu_in_guestmode(struct vcpu *v)
cpumask_clear(p2m->dirty_cpumask);
}
-bool_t
-nestedhvm_is_n2(struct vcpu *v)
-{
- if (!nestedhvm_enabled(v->domain)
- || nestedhvm_vmswitch_in_progress(v)
- || !nestedhvm_paging_mode_hap(v))
- return 0;
-
- if (nestedhvm_vcpu_in_guestmode(v))
- return 1;
-
- return 0;
-}
-
/* Common shadow IO Permission bitmap */
/* There four global patterns of io bitmap each guest can
p2m->np2m_generation++;
/* Make sure nobody else is using this p2m table */
- nestedhvm_vmcx_flushtlb(p2m);
+ if ( nestedhvm_enabled(d) )
+ nestedhvm_vmcx_flushtlb(p2m);
/* Zap the top level of the trie */
mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
};
/* Nested HVM on/off per domain */
-bool nestedhvm_enabled(const struct domain *d);
+static inline bool nestedhvm_enabled(const struct domain *d)
+{
+ return is_hvm_domain(d) && d->arch.hvm_domain.params &&
+ d->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM];
+}
/* Nested VCPU */
int nestedhvm_vcpu_initialise(struct vcpu *v);
void nestedhvm_vmcx_flushtlb(struct p2m_domain *p2m);
-bool_t nestedhvm_is_n2(struct vcpu *v);
+static inline bool nestedhvm_is_n2(struct vcpu *v)
+{
+ if ( !nestedhvm_enabled(v->domain) ||
+ nestedhvm_vmswitch_in_progress(v) ||
+ !nestedhvm_paging_mode_hap(v) )
+ return false;
+
+ return nestedhvm_vcpu_in_guestmode(v);
+}
static inline void nestedhvm_set_cr(struct vcpu *v, unsigned int cr,
unsigned long value)