On 05/24/2018 09:22 AM, Jan Kiszka wrote:
> We need more distance to the loader binary as it is growing with the
> relocation of its command line parameter section. To account for future
> changes as well, increase the gap.
> 
> It's useless the make the address relative to the reset address because
> the x86 loader only supports reset address 0.
> 
> Signed-off-by: Jan Kiszka <[email protected]>
> ---
> 
> Ralf, I'm prepending this and patch 2 in next so that your series does
> not break x86 linux loading: HEAP_BASE moved...
> 
>  inmates/tools/x86/linux-loader.c | 2 +-
>  tools/jailhouse-cell-linux       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/inmates/tools/x86/linux-loader.c 
> b/inmates/tools/x86/linux-loader.c
> index cca6056b..18417a6b 100644
> --- a/inmates/tools/x86/linux-loader.c
> +++ b/inmates/tools/x86/linux-loader.c
> @@ -12,7 +12,7 @@
>  
>  #include <inmate.h>
>  
> -#define ZERO_PAGE_ADDR               HEAP_BASE
> +#define ZERO_PAGE_ADDR               0x10000

Hmm, for the x86 binary, stack_top is at 0x7000 at the moment. So
0x10000 is fine, but we should keep an eye on it.

Nevertheless, there might be another solution: what about overloading
the weak definition of the cmdline[] array for the linux-loader and
expand it to, let's say 2*PAGE_SIZE?

Then we could e.g., place the cmdline args at 0x1000 and the ZERO_PAGE
at 0x2000, and we ensure that this location won't move around.

  Ralf

>  
>  struct boot_params {
>       u8      padding1[0x230];
> diff --git a/tools/jailhouse-cell-linux b/tools/jailhouse-cell-linux
> index df9b9212..ecc24bd1 100755
> --- a/tools/jailhouse-cell-linux
> +++ b/tools/jailhouse-cell-linux
> @@ -288,7 +288,7 @@ jailhouse cell load %s linux-loader.bin -a 0x%x %s -a 
> 0x%x ' %
>          return self._cpu_reset_address
>  
>      def params_address(self):
> -        return self._cpu_reset_address + 0x6000
> +        return 0x10000
>  
>      def kernel_address(self):
>          return self._zero_page.kernel_load_addr
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to