[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 1/3] tools/xenctrl: add xc_get_cpu_version()
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
- Date: Tue, 4 Apr 2023 17:06:53 +0100
- Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
- Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, 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>, Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
- Delivery-date: Tue, 04 Apr 2023 16:07:35 +0000
- Ironport-data: A9a23:yu8CZ6pwY/cYEdn6ykTvBwmglPVeBmIuZRIvgKrLsJaIsI4StFCzt garIBmGPKuDYzCgctEjO4u0pkIEsZXQzIRiGQc9rylgQSJE8puZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKm06WNwUmAWP6gR5weCzyVNVvrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXAGtSLQDTreG3+ZSQEeJz3fYlc8boI5xK7xmMzRmBZRonaZXKQqGM7t5ExjYgwMtJGJ4yZ eJAN2ApNk6ZJUQSZBFOUslWcOSA3xETdxVDpUiaqLtx73na1whw+LPsLMDUapqBQsA9ckOw/ zqYoD6lW0pCXDCZ4SSP9i20qPGVpgzmSr4rNrK47rl4iWTGkwT/DzVJDADm8JFVkHWWS99Zb kAZ5Ccqhawz71CwCMnwWQWip3yJtQJaXMBfe8U44gyQzqvf4y6CG3MJCDVGbbQOq8seVTEsk FiTkLvBBzN1t6aOYWmA7brSpjS3UQAXMGsDaCksXQYDpd75r+kblQnTR9xuFKq0iNzdGjzqx T2O6i8kiN0uYdUjjvvhuwqd2nT1+8aPF1RujunKYo67xlgmJ571TY+p0H7wtv1fd7SfEVaCo 2dRzqBy89sy4YGxeD2lGbtdRO/xu63UbFUwknY0QcB/qm3FF2qLONkJvWogfBoB3tMsI2eBX aPFhe9GCHa/1lOOZLQ/XY++At9CIUPIRYW8DaC8gjajj/FMmO67EMJGPxT4M5jFyhRErE3GE c7znTyQJXgbE7976zG9Wv0Q17QmrghnmzOLGMylnk78i+TODJJwdVviGALWBt3VEYve+FmFm zqhH5DiJ+pjvB3WPXCMrN97waEiJnknH5Hmw/Fqmhq4ClM+QgkJUqaBqY7NjqQ5x8y5YM+Up CDiMqKZoXKj7UD6xfKiMSo8Mum3Ac4u9RrW/0UEZD6V5pTqWq73hI93Snf9VeJ4nAC/5ZaYl 8U4Rvg=
- Ironport-hdrordr: A9a23:g3P7gK99tCdBf+9fU7Juk+DzI+orL9Y04lQ7vn2ZKCYlF/Bw8v rF8cjzuiWZtN98Yh4dcKm7SdC9qBDnhPxICOsqXYtKNTOO0FdASrsN0WKI+UyCJ8SRzI9gPJ BbAsxD4Y3LZmSSVfyKmzVQyexQpuVvLZrY4ts2E00dNT2CtZsQlTtENg==
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
As a wrapper for XENPF_get_cpu_version platform op.
Signed-off-by: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
---
v3 --> v4:
- Replaced DECLARE_PLATFORM_OP
- Removed NULL checks
---
tools/include/xenctrl.h | 1 +
tools/libs/ctrl/xc_misc.c | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 05967ecc92..34b3b25289 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1186,6 +1186,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,
diff --git a/tools/libs/ctrl/xc_misc.c b/tools/libs/ctrl/xc_misc.c
index 265f15ec2d..90d50faa4f 100644
--- a/tools/libs/ctrl/xc_misc.c
+++ b/tools/libs/ctrl/xc_misc.c
@@ -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)
{
--
2.17.1
|