[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



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?

> +    mod_base = mod_hi;
> +    mod_base = (0xFFFFFFFF00000000 & (mod_base << 32)) | mod_lo;
> +    init_hvm_modules(mod_base);
>  
>      /* Initialise hypercall stubs with RET, rendering them no-ops. */
>      memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */,
> PAGE_SIZE); 



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