On Wed, Jan 30, 2019 at 11:36:39AM +0100, Roger Pau Monne wrote: > Due to the recent changes in the iommu mapping logic, the start > addresses provided need to be aligned to the order intended to be > mapped. >
Can you reference some commits here? What would happen if the address is not aligned? > dom0 PVH domain builder didn't take this into account when populating > the p2m, fix this by making sure the order is chosen so that the start > address is aligned to it. > > Signed-off-by: Roger Pau Monné <roger....@citrix.com> > --- > Cc: Jan Beulich <jbeul...@suse.com> > Cc: Andrew Cooper <andrew.coop...@citrix.com> > Cc: Wei Liu <wei.l...@citrix.com> > --- > Without this patch trying to create a PVH dom0 will trigger an assert > on certain hardware depending on the memory map. > --- > xen/arch/x86/hvm/dom0_build.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c > index 51cf490811..a571d15c13 100644 > --- a/xen/arch/x86/hvm/dom0_build.c > +++ b/xen/arch/x86/hvm/dom0_build.c > @@ -152,6 +152,8 @@ static int __init pvh_populate_memory_range(struct domain > *d, > > order = get_order_from_pages(end - start + 1); > order = min(order ? order - 1 : 0, max_order); > + /* The order allocated and populated must be aligned to the address. > */ > + order = min(order, start ? find_first_set_bit(start) : MAX_ORDER); Isn't max_order better here? > page = alloc_domheap_pages(d, order, dom0_memflags | MEMF_no_scrub); > if ( page == NULL ) > { > -- > 2.20.1 > _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel