]> xenbits.xensource.com Git - xen.git/commitdiff
tools/xenctrl: add xc_get_cpu_version()
authorSergey Dyasli <sergey.dyasli@citrix.com>
Mon, 17 Apr 2023 13:53:33 +0000 (14:53 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 3 May 2023 17:36:46 +0000 (18:36 +0100)
As a wrapper for XENPF_get_cpu_version platform op.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/include/xenctrl.h
tools/libs/ctrl/xc_misc.c

index 752fc8758068e3df609574410f6ca06632e3d499..a82d8bc73bb2f00f5fc170203de430a216caad3d 100644 (file)
@@ -1215,6 +1215,7 @@ int xc_physinfo(xc_interface *xch, xc_physinfo_t *info);
 int xc_cputopoinfo(xc_interface *xch, unsigned *max_cpus,
                    xc_cputopo_t *cputopo);
 int xc_microcode_update(xc_interface *xch, const void *buf, size_t len);
+int xc_get_cpu_version(xc_interface *xch, struct xenpf_pcpu_version *cpu_ver);
 int xc_numainfo(xc_interface *xch, unsigned *max_nodes,
                 xc_meminfo_t *meminfo, uint32_t *distance);
 int xc_pcitopoinfo(xc_interface *xch, unsigned num_devs,
index 265f15ec2da344e948cbbe532d6d456a09accfc0..90d50faa4fc84cddc7a117ea79d75d416dbbdb10 100644 (file)
@@ -226,6 +226,23 @@ 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;
+    struct xen_platform_op op = {
+        .cmd = XENPF_get_cpu_version,
+        .u.pcpu_version.xen_cpuid = cpu_ver->xen_cpuid,
+    };
+
+    ret = do_platform_op(xch, &op);
+    if ( ret != 0 )
+        return ret;
+
+    *cpu_ver = op.u.pcpu_version;
+
+    return 0;
+}
+
 int xc_cputopoinfo(xc_interface *xch, unsigned *max_cpus,
                    xc_cputopo_t *cputopo)
 {