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

Re: [Xen-devel] [v6][PATCH 5/7] hvmloader: introduce hypercall for xc_reserved_device_memory_map



>>> On 10.09.14 at 07:49, <tiejun.chen@xxxxxxxxx> wrote:
> We will introduce that hypercall xc_reserved_device_memory_map
> to hvmloader.

Title and text: What does a libxc name do here?

Also I don't think this warrants a separate patch - introduce the
function along with the code needing it.

> Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>
> 
> diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
> index 80d822f..90dbb6e 100644
> --- a/tools/firmware/hvmloader/util.c
> +++ b/tools/firmware/hvmloader/util.c
> @@ -828,6 +828,28 @@ int hpet_exists(unsigned long hpet_base)
>      return ((hpet_id >> 16) == 0x8086);
>  }
>  
> +int get_reserved_device_memory_map(struct xen_mem_reserved_device_memory 
> entries[],
> +                                   uint32_t max_entries)
> +{
> +    static int map_done = 0;
> +    struct xen_mem_reserved_device_memory_map memmap = {
> +        .nr_entries = max_entries
> +    };
> +
> +    if ( map_done )
> +        return 0;
> +
> +    set_xen_guest_handle(memmap.buffer, entries);
> +
> +    if ( hypercall_memory_op(XENMEM_reserved_device_memory_map,
> +                             &memmap) != 0 )
> +        BUG();

I don't think there's any harm in not BUG()ing here - just return the
error to the caller (and let it assume there are no entries). In the
worst case guest startup will subsequently fail (instead of here).

> +
> +    map_done = 1;

The map_done variable if completely bogus here, but I think
someone else already pointed this out.

Jan


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