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

Re: [PATCH v2 1/3] xen/riscv: introduce setup_initial_pages



Hello Julien,

On Tue, 2023-03-21 at 17:58 +0000, Julien Grall wrote:
> > +        /* Setup level0 table */
> > +        if ( !pte_is_valid(&zeroeth[index0]) )
> 
> On the previous version, you said it should be checked for each
> level. 
> But here you still only check for a single level.
> 
> Furthermore, I would strongly suggest to also check the valid PTE is
> the 
> same as you intend to write to catch any override (they are a pain to
> debug).
> 
Do you mean that I have to get a virtual address, extract the page
table index bits from it, traverse the page table hierarchy to locate
the PTE for the virtual address and the compare the gotten PTE address
with zeroeh[index0]?

> > +        {
> > +            /* Update level0 table */
> > +            zeroeth[index0] = paddr_to_pte((page_addr - map_start)
> > + pa_start);
> > +            zeroeth[index0].pte |= flags;
> > +        }
> > +
> > +        /* Point to next page */
> > +        page_addr += XEN_PT_LEVEL_SIZE(0);
> > +    }
> > +}

~ Oleksii



 


Rackspace

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