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

Re: [Xen-devel] [PATCH v3 2/4] libxl: Move libxl__arch_domain_construct_memmap() earlier



On 03/16/2018 02:12 PM, Roger Pau Monné wrote:
> On Thu, Mar 15, 2018 at 02:35:16PM -0700, Maran Wilson wrote:
>> From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
>>
>> Since hvm_start_info has now been expanded to include PVH guest's
>> memory map (i.e. e820) we need to know size of this map by the time we
>> create dom->start_info_seg in alloc_magic_pages_hvm().
>>
>> To do so we have to call libxl__arch_domain_construct_memmap() earlier,
>> before xc_dom_build_image().
>>
>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
>> ---
>>  tools/libxl/libxl_create.c   |  2 +-
>>  tools/libxl/libxl_dom.c      | 12 +++++++++---
>>  tools/libxl/libxl_internal.h |  1 +
>>  tools/libxl/libxl_x86.c      |  3 +++
>>  4 files changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
>> index c498135..5dce3df 100644
>> --- a/tools/libxl/libxl_create.c
>> +++ b/tools/libxl/libxl_create.c
>> @@ -488,7 +488,7 @@ int libxl__domain_build(libxl__gc *gc,
>>  
>>          break;
>>      case LIBXL_DOMAIN_TYPE_PV:
>> -        ret = libxl__build_pv(gc, domid, info, state);
>> +        ret = libxl__build_pv(gc, domid, d_config, info, state);
>>          if (ret)
>>              goto out;
>>  
>> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
>> index 2e29b52..917b45e 100644
>> --- a/tools/libxl/libxl_dom.c
>> +++ b/tools/libxl/libxl_dom.c
>> @@ -698,6 +698,7 @@ static int set_vnuma_info(libxl__gc *gc, uint32_t domid,
>>  }
>>  
>>  static int libxl__build_dom(libxl__gc *gc, uint32_t domid,
>> +             libxl_domain_config *d_config,
>>               libxl_domain_build_info *info, libxl__domain_build_state 
>> *state,
>>               struct xc_dom_image *dom)
>>  {
>> @@ -737,6 +738,11 @@ static int libxl__build_dom(libxl__gc *gc, uint32_t 
>> domid,
>>          LOGE(ERROR, "libxl__arch_domain_finalise_hw_description failed");
>>          goto out;
>>      }
>> +    ret = libxl__arch_domain_construct_memmap(gc, d_config, domid, dom);
>> +    if (ret != 0) {
>> +        LOG(ERROR, "setting domain memory map failed");
>> +        goto out;
>> +    }
> If you add this call here, shouldn't you remove the same one from
> libxl__build_hvm?

Hmm... I thought I removed it but apparently I didn't.

>
> Does it make sense to place this in the
> libxl__arch_domain_finalise_hw_description hook?
>
> On ARM libxl__arch_domain_construct_memmap it's just an empty wrapper
> anyway.

Yes, I can do that. And then remove ARM's
libxl__arch_domain_construct_memmap altogether.

-boris


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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