 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v5 10/16] tools: implement the new libxc get hw info interface
 On Sat, Sep 30, 2017 at 01:39:20AM +0000, Yi Sun wrote:
> This patch implements a new libxc get hw info interface and corresponding
> data structures. It also changes libxl_psr.c to call this new interface.
> 
> Signed-off-by: Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx>
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Provided that my comment and Wei's comment are fixed.
> diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
> index d4f5f67..e8d62e1 100644
> --- a/tools/libxl/libxl_psr.c
> +++ b/tools/libxl/libxl_psr.c
> @@ -361,6 +361,29 @@ int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
>      return rc;
>  }
>  
> +static xc_psr_feat_type libxl__feat_type_to_libxc_feat_type(
> +                            libxl_psr_feat_type type, unsigned int lvl)
> +{
> +    xc_psr_feat_type xc_type;
> +
> +    switch (type) {
> +    case LIBXL_PSR_FEAT_TYPE_CAT:
This needs:
assert(lvl == 3 || lvl == 2);
Or else you return stack garbage to the caller.
Or alternatively:
switch (lvl) {
case 2:
    xc_type = XC_PSR_CAT_L2;
    break;
case 3:
    xc_type = XC_PSR_CAT_L3;
default:
    assert(0);
}
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |