[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping



On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote:
> > +            unsigned long load_end = LINK_TO_LOAD(_end);
> > +            unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i -
> > 1);
> > +            unsigned long xen_size = ROUNDUP(load_end -
> > load_start, pt_level_size);
> > +            unsigned long page_entries_num = xen_size /
> > pt_level_size;
> > +
> > +            while ( page_entries_num-- )
> > +                pgtbl[index++].pte = 0;
> > +
> > +            break;
> 
> Unless there's a "not crossing a 2Mb boundary" guarantee somewhere
> that I've missed, this "break" is still too early afaict.
If I will add a '2 MB boundary check' for load_start and linker_start
could it be an upstreamable solution?

Something like:
    if ( !IS_ALIGNED(load_start, MB(2) )
        printk("load_start should be 2Mb algined\n");
and
    ASSERT( !IS_ALIGNED(XEN_VIRT_START, MB(2) )
in xen.lds.S.

Then we will have completely different L0 tables for identity mapping
and not identity and the code above will be correct.

~ Oleksii





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.