@@ -864,7 +864,7 @@ void recalculate_cpuid_policy(struct domain *d)
p->extd.maxphysaddr = min(p->extd.maxphysaddr, max->extd.maxphysaddr);
p->extd.maxphysaddr = min_t(uint8_t, p->extd.maxphysaddr,
- paging_max_paddr_bits(d));
+ domain_max_paddr_bits(d));
p->extd.maxphysaddr = max_t(uint8_t, p->extd.maxphysaddr,
(p->basic.pae || p->basic.pse36) ? 36 : 32);
@@ -2552,6 +2552,27 @@ static int __init cf_check init_vcpu_kick_softirq(void)
}
__initcall(init_vcpu_kick_softirq);
+unsigned int domain_max_paddr_bits(const struct domain *d)
+{
+ unsigned int bits = paging_mode_hap(d) ? hap_paddr_bits : paddr_bits;
+
+ if ( paging_mode_external(d) )
+ {
+ if ( !IS_ENABLED(CONFIG_BIGMEM) && paging_mode_shadow(d) )
+ {
+ /* Shadowed superpages store GFNs in 32-bit page_info fields. */
+ bits = min(bits, 32U + PAGE_SHIFT);
+ }
+ else
+ {
+ /* Both p2m-ept and p2m-pt only support 4-level page tables. */
+ bits = min(bits, 48U);
+ }
+ }
+
+ return bits;
+}
+
/*
* Local variables:
* mode: C
@@ -777,6 +777,9 @@ static inline void pv_inject_sw_interrupt(unsigned int vector)
struct arch_vcpu_io {
};
+/* Maxphysaddr supportable by the paging infrastructure. */
+unsigned int domain_max_paddr_bits(const struct domain *d);
+
#endif /* __ASM_DOMAIN_H__ */
/*
@@ -336,28 +336,6 @@ static inline bool gfn_valid(const struct domain *d, gfn_t gfn)
return !(gfn_x(gfn) >> (d->arch.cpuid->extd.maxphysaddr - PAGE_SHIFT));
}
-/* Maxphysaddr supportable by the paging infrastructure. */
-static always_inline unsigned int paging_max_paddr_bits(const struct domain *d)
-{
- unsigned int bits = paging_mode_hap(d) ? hap_paddr_bits : paddr_bits;
-
- if ( paging_mode_external(d) )
- {
- if ( !IS_ENABLED(CONFIG_BIGMEM) && paging_mode_shadow(d) )
- {
- /* Shadowed superpages store GFNs in 32-bit page_info fields. */
- bits = min(bits, 32U + PAGE_SHIFT);
- }
- else
- {
- /* Both p2m-ept and p2m-pt only support 4-level page tables. */
- bits = min(bits, 48U);
- }
- }
-
- return bits;
-}
-
#endif /* XEN_PAGING_H */
/*