mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
xen/x86: move d->arch.physaddr_bitsize field handling into pv32
The d->arch.physaddr_bitsize field is used only by PV32 code, so move d->arch.physaddr_bitsize field under PV32 ifdef into struct pv_domain. Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
c37bcb35f9
commit
7d2e057368
4 files changed
+11
-8
No files matched your search
@@ -290,6 +290,9 @@ struct pv_domain
|
||||
|
||||
#ifdef CONFIG_PV32
|
||||
unsigned int hv_compat_vstart;
|
||||
|
||||
/* Maximum physical-address bitwidth supported by this guest. */
|
||||
unsigned int physaddr_bitsize;
|
||||
#endif
|
||||
|
||||
/* map_domain_page() mapping cache. */
|
||||
@@ -319,9 +322,6 @@ struct arch_domain
|
||||
{
|
||||
struct page_info *perdomain_l3_pg;
|
||||
|
||||
/* Maximum physical-address bitwidth supported by this guest. */
|
||||
unsigned int physaddr_bitsize;
|
||||
|
||||
/* I/O-port admin-specified access capabilities. */
|
||||
struct rangeset *ioport_caps;
|
||||
uint32_t pci_cf8;
|
||||
|
||||
@@ -623,8 +623,8 @@ extern int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm);
|
||||
#define domain_clamp_alloc_bitsize(d, bits) ({ \
|
||||
const struct domain *_d = (d); \
|
||||
\
|
||||
((_d && _d->arch.physaddr_bitsize) \
|
||||
? min_t(unsigned int, _d->arch.physaddr_bitsize, bits) \
|
||||
((_d && _d->arch.pv.physaddr_bitsize) \
|
||||
? min_t(unsigned int, _d->arch.pv.physaddr_bitsize, bits) \
|
||||
: (bits)); \
|
||||
})
|
||||
#endif
|
||||
|
||||
@@ -626,8 +626,10 @@ static int __init dom0_construct(const struct boot_domain *bd)
|
||||
initrd_mfn = paddr_to_pfn(initrd->start);
|
||||
mfn = initrd_mfn;
|
||||
count = PFN_UP(initrd_len);
|
||||
if ( d->arch.physaddr_bitsize &&
|
||||
((mfn + count - 1) >> (d->arch.physaddr_bitsize - PAGE_SHIFT)) )
|
||||
|
||||
#ifdef CONFIG_PV32
|
||||
if ( d->arch.pv.physaddr_bitsize &&
|
||||
((mfn + count - 1) >> (d->arch.pv.physaddr_bitsize - PAGE_SHIFT)) )
|
||||
{
|
||||
order = get_order_from_pages(count);
|
||||
page = alloc_domheap_pages(d, order, MEMF_no_scrub);
|
||||
@@ -650,6 +652,7 @@ static int __init dom0_construct(const struct boot_domain *bd)
|
||||
initrd->start = pfn_to_paddr(initrd_mfn);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
while ( count-- )
|
||||
if ( assign_pages(mfn_to_page(_mfn(mfn++)), 1, d, 0) )
|
||||
|
||||
@@ -257,7 +257,7 @@ int switch_compat(struct domain *d)
|
||||
d->arch.pv.hv_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
|
||||
|
||||
if ( MACH2PHYS_COMPAT_NR_ENTRIES(d) < max_page )
|
||||
d->arch.physaddr_bitsize =
|
||||
d->arch.pv.physaddr_bitsize =
|
||||
/* 2^n entries can be contained in guest's p2m mapping space */
|
||||
fls(MACH2PHYS_COMPAT_NR_ENTRIES(d)) - 1 + PAGE_SHIFT;
|
||||
|
||||
|
||||