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

Re: [PATCH v3 1/3] tools/xenctrl: add xc_get_cpu_version()


  • To: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 21 Mar 2023 12:57:34 +0000
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sNFyh/9oxcyVIn2jiben5GD1DjE53W2DkVAi1UAnoE8=; b=I3l6vulGmzxKEoi+ZFAd0Ruz9mx8hTncF5e4NNNlIqVh5usv/QZ9LFNyw5vMzmQgQxiMtj3/zkcqQ3aAFu0NwVvcox9bSvQBJAsHcjjrz/1qedbPpqKuVAppHYklqhtZHi1tJYouUoSiH2NbmXuYkued5b4f+DYBebi5ZeIc4itKpTbmjE5piLpmOelHPol7HGQXqqYnRjdWJKNjDICak45Vy6KsloLwoYEKLX6BqXV2f3B3uHBsZJRrfYM5wIASLYcb+56AWXzBf5F0eXkRqS61zZohytVIrx/cOqzMvwqXxx5o8uUWeg4hMrON0/qcMYviE4G/FDiQbHA5k1okLQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ev4kVfNGOQo74V6n21J+vWxWq32XxmPRLQVDXm5qbyqGOQ5CZ8VivGnPCaVhPVXiVqEQWcqACccJLd5LLD3sbBjxzLy3N2P7pP0VRFI3EVVedwlCsnAzILgViDK0I1LZIqkrzQLzTd1O9/aQp6xRzXZVW+34pUa14fqmg0V3+K4fOdX15rhP4+1vs9nOtQRxO4pTrNTRJpqz4HvOiGIvai1c3VbGQqhaijQT7qLLKhTaPLrRaJphyp7w60Mijt3t9PLE/T3xoA73aj83JrilUseCwn4MNb1c451H1ecXidZFdwMgz/EbGmBekJ9epUB+qMxrQLVTUVWppxi4DTQUbg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Tue, 21 Mar 2023 12:58:28 +0000
  • Ironport-data: A9a23:xzSH+KIbzVdqptSXFE+RNZQlxSXFcZb7ZxGr2PjKsXjdYENS0mRSz DAdXG2PaamPNmv9KY11PY/i9BgGvJ/WzIIyTAdlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpJrfPTwP9TlK6q4mhA5QZnPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5oBE1V0 fgzLgtKdx2+pf2L+b6CQONj05FLwMnDZOvzu1lG5BSAVLMNZsmGRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dppTGMlGSd05C0WDbRUvWMSd9YgQCzo WXe8n6iKhobKMae2XyO9XfEaurnxHuiBttLT+LgnhJsqFGz6zY6VSwwbF+ijtLhg3T5WvRid 2VBr0LCqoB3riRHVOLVTxC+5XKJoBMYc95RCPEhrhGAzLLO5ASUDXRCSSROAPQkvsIrQT0h1 neSgsjkQzdotdW9Vna15rqS6zSoNkA9L2AYYjQfZRAY+NSlq4Y25jrNU9JiHaidntDzXzbqz FiitzMijr8eicoK0aST/l3dhT+o4J/TQWYICh7/W2uk6kZyY9ejbonxsFzDt68fdMCeU0WLu 2UCl46G9ucSAJqRlSuLBuIQALWu4PXDOzrZ6bJyI6QcG/2W0ybLVehtDPtWei+F7u5slefVX XLu
  • Ironport-hdrordr: A9a23:mZJ7LazokMygj7EgB6JmKrPw/b1zdoMgy1knxilNoHtuA66lfq GV7ZcmPHrP41wssR4b9OxoR5PwJk80maQY3WBzB9eftWvd1ldARbsKhbcKqAeAJ8SRzIFgPK 5bAs5DIcy1BVxoydz8+k29H8w7yNeKtKCk7N2uqktFXEVjb7Il9QBiThyGGVd9XwleGJo+E9 6V/c0vnUvFRUgq
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21/03/2023 11:47 am, Sergey Dyasli wrote:
> diff --git a/tools/libs/ctrl/xc_misc.c b/tools/libs/ctrl/xc_misc.c
> index 265f15ec2d..f2f6e4348e 100644
> --- a/tools/libs/ctrl/xc_misc.c
> +++ b/tools/libs/ctrl/xc_misc.c
> @@ -226,6 +226,26 @@ int xc_microcode_update(xc_interface *xch, const void 
> *buf, size_t len)
>      return ret;
>  }
>  
> +int xc_get_cpu_version(xc_interface *xch, struct xenpf_pcpu_version *cpu_ver)
> +{
> +    int ret;
> +    DECLARE_PLATFORM_OP;
> +
> +    if ( !xch || !cpu_ver )
> +        return -1;

We don't check parameters like this anywhere else.  It's library code,
and the caller is required to DTRT.

Also, we're phasing out the use of the DECLARE macros.  This wants to
change to

struct xen_platform_op op = {
    .cmd = XENPF_get_cpu_version,
    .u.pcpu_version.xen_cpuid = cpu_ver->xen_cpuid,
};

Both can be fixed on commit, if you're happy.

~Andrew



 


Rackspace

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