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

Re: [Xen-devel] [PATCH 03/07] HVM firmware passthrough: hvmloader init module support



At 10:30 +0100 on 04 Apr (1333535447), Ian Campbell wrote:
> On Mon, 2012-03-19 at 22:04 +0000, Ross Philipson wrote:
> > diff -r 45d2dcc22c18 tools/firmware/hvmloader/hvmloader.c
> > --- a/tools/firmware/hvmloader/hvmloader.c      Mon Mar 19 16:42:36
> > 2012 -0400
> > +++ b/tools/firmware/hvmloader/hvmloader.c      Mon Mar 19 16:45:12
> > 2012 -0400
> > @@ -23,6 +23,7 @@
> >  #include "util.h"
> >  #include "hypercall.h"
> >  #include "config.h"
> > +#include "modules.h"
> >  #include "pci_regs.h"
> >  #include "apic_regs.h"
> >  #include "acpi/acpi2_0.h"
> > @@ -257,6 +258,17 @@ int main(void)
> >  {
> >      const struct bios_config *bios;
> >      int acpi_enabled;
> > +    uint32_t mod_lo, mod_hi;
> > +    uint64_t mod_base;
> > +
> > +    /* First get the modules base address passed in ECX:EDC and init
> > +     * module support.
> > +     */
> > +    asm volatile ( "mov %%ecx, %0;" : "=r"(mod_hi));
> > +    asm volatile ( "mov %%edx, %0;" : "=r"(mod_lo));
> 
> I'm not sure you can rely on %ecx and %edx not having been clobbered
> here. I think you probably need to save away the value in the ASM block
> at the head of hvmloader.c if we continue down this path.
> 
> In fact, it looks like that ASM block deliberately zeroes ecx and edx so how
> does this work?

The asm header clears them after calling main().  But yes, you can't
rely on their being still valid; the asm header would have to push them
to the stack as arguments to main().

In any case, this all goes away if the module info is passed in xenstore.

Cheers,

Tim.

_______________________________________________
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®.