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

Re: [PATCH 01/21] libxl: don't ignore the return value from xc_cpuid_apply_policy


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 31 Mar 2021 19:12:04 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EqJ82BC8tToa5rQwqn4fcXS2D7dcS2uhCCHczhIgWUc=; b=f4Q21wwW+6+/gdV6piNFBLi7CJW/f5PSG2C5EYbWQRHGKAESUFRA4nQUOMnK2sJOz6f1ZKuOyw6zy/t8wCSMylsdGYStl+gZf+H0pOxfjKTJM2Ut+v8RNtrNPxT6iL5ohwROj4uu/RXY6srlao2faCdZY49fJ2vP16Ma15X0bxMDvvpvlL3wdzImk0ggLln7Mz5ke7Jq394Dh7P7R9o4HqCMiZbItzNySvxSUj89QDFR/MCiSUtPYGAss6lTj7xjq/9T0muPyWBouYVWiL5LS5fMzp/+fLHCj6LyshPd7rFZHHhJB0ZjBxAnJbV1ZWUAa1McBmvf2wlrWnsp8XwXRQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KyvPJizSFtmCUEhLaV9gUEoY8Mag9i0s+/nzaJL2eacPbh5jSwOrDXudv+ibbk9Kz4cSRiHBY1ElDZT4hA1ycMLnNr3W4JjTRcunx6kMEVqr+TP5RtxbKfb9Lq21+eUfdYpO5WdDFuuw5eIGyQJQ71qfOlgCsSYUuK6AiMEr8f4KLC5s5PEku6h29VT9FowOPPS9kzG03XEZM2kDB6iR1g+jOSU+F73bRO7innya+sHRmrK17XpIqq7uQWOhdp73cBA8XVYEXNqTAQHEheR0EGWPX7KsUw6eswcIZNzGmbJ4ivCgNNnoUROWRMgFTDNySTKy1ubi8UPc34eT1+AotA==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 31 Mar 2021 18:12:24 +0000
  • Ironport-hdrordr: A9a23:J5wVjalmKOtZaLBPnXZ2GoYp2PvpDfOFj2dD5ilNYBxZY6Wkvu iUtrAyyQL0hDENWHsphNCHP+26TWnB8INuiLNxAZ6LZyOjnGezNolt4c/ZwzPmEzDj7eI178 ldWoBEIpnLAVB+5PyU3CCRGdwt2cTC1aiui/vXwXsFd3ARV4hL6QBlBgGHVmh/QwdbDZQ0fa Dsm/ZvjTymZHgRc4CHFmAINtKz6+HjubDHRVo9BxAh4BSTlj/A0t7HOjWRwxt2aUI2/Z4M6m 7A+jaJg5mLl9Ge5lvi23TI75JQ8eGRhedrIMCXkMAaJnHNp2+TFf9ccoaPtjw0v+2jgWxC+L KnzntQXLUQ11rqYmq3rRHxsjOQtwoG1n74xVeUxVvlrMDpLQhKcvZpuINDfhPVr3cnpdF3uZ g7uV6xipw/N2KloA3No/zzEz16nEu9pnQv1cQJiWZEbIcYYLhN6aQC4UJ8Cv47bWzHwbFiNN MrINDX5f5Qf1/fRWvepHNTzNulWWl2NguaQ3IFptee31Ft7TFE5npd4PZasmYL9Zo7RZUBzf /DKL5UmLZHSdJTSq5hGuEbQ4+SBnbWSRzBdEKeSG6XVJ0vCjbokdra8b817OaldNgj150pgq nMV1teqCo8YETrBcqS3IBa8xzETWmnNA6diP121txcgPnRVbDrOSqMRBQFiM27ucgSBcXdRr KyNfttcrreBFqrPbwM8xz1WpFUJ3VbetYSoMwHV1WH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q4kNYo78ZYfuPCbfFwCZTItdY6K/rnP8ZvJ5ec3L0AMd/UkeAYw4 egaiWHh0wvTBIod76wlSy280iRIBDkO88d/7p1Sn5pGBKdTuPm/SUFFyXVyRA4OR+tuUC4QOZi qt2W9S8L+YgY8SIiPBHeXJ818DMGevHIlGZPn6gYvY2lOvGa7O1fPcVgrIQp5p5V+wTyK6H9jM 5YU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23/03/2021 09:58, Roger Pau Monne wrote:
> @@ -462,8 +464,13 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, 
> bool restore,
>      itsc = (libxl_defbool_val(info->disable_migrate) ||
>              info->tsc_mode == LIBXL_TSC_MODE_ALWAYS_EMULATE);
>  
> -    xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
> -                          pae, itsc, nested_virt, info->cpuid);
> +    rc = xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
> +                               pae, itsc, nested_virt, info->cpuid);
> +    if (rc)
> +        LOGE(ERROR, "Failed to apply CPUID policy");

If we are planning to take this patch, then you need to convert from xc
errors (-errno) to libxl errors here, or the caller is going to receive
gibberish.

~Andrew

> +
> +    GC_FREE;
> +    return rc;
>  }




 


Rackspace

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