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

Re: [Embedded-pv-devel] [Xen-devel] [PATCH RFC 04/18] libxl: add ability to set rambase_pfn via cfg file



On Wed, May 18, 2016 at 07:32:27PM +0300, Andrii Anisov wrote:
> From: Oleksandr Tyshchenko <oleksandr.tyshchenko@xxxxxxxxxxxxxxx>
> 
> In case of missing required property in cfg file
> the default value (0x40000) should be used.

Assuming this is absolutely needed (whether it is the case I don't
know, I will leave that to ARM maintainers)...

> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@xxxxxxxxxxxxxxx>
> Signed-off-by: Iurii Konovalenko <iurii.konovalenko@xxxxxxxxxxxxxxx>
> Signed-off-by: Iurii Mykhalskyi <iurii.mykhalskyi@xxxxxxxxxxxxxxx>
[...]
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 1699f32..5b0b50a 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -100,6 +100,7 @@
>  #define LIBXL_HVM_EXTRA_MEMORY 2048
>  #define LIBXL_MIN_DOM0_MEM (128*1024)
>  #define LIBXL_INVALID_GFN (~(uint64_t)0)
> +#define LIBXL_INVALID_RAM_BASE (~(uint64_t)0)
>  /* use 0 as the domid of the toolstack domain for now */
>  #define LIBXL_TOOLSTACK_DOMID 0
>  #define QEMU_SIGNATURE "DeviceModelRecord0002"
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 502a148..b6cc8d2 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -416,6 +416,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
>      ("target_memkb",    MemKB),
>      ("video_memkb",     MemKB),
>      ("shadow_memkb",    MemKB),
> +    ("rambase",         uint64, {'init_val': 'LIBXL_INVALID_RAM_BASE'}),

Please make this ARM specific.

You would also need to provide a LIBXL_HAVE macro in libxl.h. See
various examples there.


>      ("rtc_timeoffset",  uint32),
>      ("exec_ssidref",    uint32),
>      ("exec_ssid_label", string),
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 9a2870e..28d57c3 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -31,6 +31,7 @@
>  #include <sys/select.h>
>  #include <sys/utsname.h> /* for utsname in xl info */
>  #include <xentoollog.h>
> +#include <xenctrl.h>

I don't think you need this. In fact, please don't do this. :-)

>  #include <ctype.h>
>  #include <inttypes.h>
>  #include <limits.h>
> @@ -1352,6 +1353,18 @@ static void parse_config_data(const char 
> *config_source,
>      if (!xlu_cfg_get_long (config, "maxmem", &l, 0))
>          b_info->max_memkb = l * 1024;
>  
> +#ifdef GUEST_RAM_BASE
> +    if (!xlu_cfg_get_long (config, "rambase_pfn", &l, 0)) {
> +        /* TODO add more detailed check for valid value */
> +        uint64_t rambase = (uint64_t)l << XC_PAGE_SHIFT;
> +        if (rambase > (GUEST_RAM0_BASE + GUEST_RAM0_SIZE)) {
> +            fprintf(stderr, "ERROR: invalid value 0x%lx for 
> \"rambase_pfn\"\n", l);
> +            exit (1);
> +        }
> +        b_info->rambase = rambase;
> +    }
> +#endif
> +
>      if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
>          vcpus = l;
>          if (libxl_cpu_bitmap_alloc(ctx, &b_info->avail_vcpus, l)) {
> -- 
> 2.8.2
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Embedded-pv-devel mailing list
Embedded-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/embedded-pv-devel

 


Rackspace

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