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

Re: [Xen-devel] [PATCH v3 09/16] hvmloader: Check modules whereabouts



On Mon, Feb 29, 2016 at 09:58:29AM -0700, Jan Beulich wrote:
> >>> On 25.02.16 at 15:56, <anthony.perard@xxxxxxxxxx> wrote:
> > --- a/tools/firmware/hvmloader/hvmloader.c
> > +++ b/tools/firmware/hvmloader/hvmloader.c
> > @@ -303,6 +303,15 @@ int main(void)
> >  
> >      smp_initialise();
> >  
> > +    /* Check that tests does not use memory where modules are stored */
> > +    BUG_ON( ((uint32_t)hvm_start_info + sizeof(struct hvm_start_info)) >= 
> > 4 << 20 );
> > +    for ( unsigned i = 0; i < hvm_start_info->nr_modules; i++ )
> > +    {
> > +        const struct hvm_modlist_entry *modlist =
> > +            (struct hvm_modlist_entry *)hvm_start_info->modlist_paddr;
> > +        if ( modlist[i].size )
> > +            BUG_ON( modlist[i].paddr + modlist[i].size >= 4ul << 20 );
> > +    }
> 
> First of all both checks should use > instead of >=. And then
> expecting all modules to live below 4Mb doesn't seem very
> reasonable.

Yes, and this can be an issue with OVMF, it's a 2MB binary. I'm not sure
what to do about this, should I ignore perform_tests() if it going to
clear the memory used by the modules?

I should probably check that the modules are outside the memory region that
is going to be used by perform_tests(), instead of just checking that they
are bellow 4MB.

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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