Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virt: acrn: Mark the uuid field as unused

After the commits for userspace (see Link tags below) the uuid field
is not being used in the ACRN code. Update kernel to reflect these
changes, i.e. do the following:
- adding a comment explaining that it's not used anymore
- replacing the specific type by a raw buffer
- updating the example code accordingly

The advertised field confused users and actually never been used.
So the wrong part here is that kernel puts something which userspace
never used and hence this may confuse a reader of this code.

Note, that there is only a single tool that had been prepared a year
ago for these forthcoming changes in the kernel.

Link: https://github.com/projectacrn/acrn-hypervisor/commit/da0d24326ed6
Link: https://github.com/projectacrn/acrn-hypervisor/commit/bb0327e70097
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20221116162956.72658-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
1dbb4f02 e68a558f

+2 -6
+2 -3
include/uapi/linux/acrn.h
··· 12 12 #define _UAPI_ACRN_H 13 13 14 14 #include <linux/types.h> 15 - #include <linux/uuid.h> 16 15 17 16 #define ACRN_IO_REQUEST_MAX 16 18 17 ··· 185 186 * @reserved0: Reserved and must be 0 186 187 * @vcpu_num: Number of vCPU in the VM. Return from hypervisor. 187 188 * @reserved1: Reserved and must be 0 188 - * @uuid: UUID of the VM. Pass to hypervisor directly. 189 + * @uuid: Empty space never to be used again (used to be UUID of the VM) 189 190 * @vm_flag: Flag of the VM creating. Pass to hypervisor directly. 190 191 * @ioreq_buf: Service VM GPA of I/O request buffer. Pass to 191 192 * hypervisor directly. ··· 197 198 __u16 reserved0; 198 199 __u16 vcpu_num; 199 200 __u16 reserved1; 200 - guid_t uuid; 201 + __u8 uuid[16]; 201 202 __u64 vm_flag; 202 203 __u64 ioreq_buf; 203 204 __u64 cpu_affinity;
-3
samples/acrn/vm-sample.c
··· 29 29 30 30 __u16 vcpu_num; 31 31 __u16 vmid; 32 - /* POST_STANDARD_VM_UUID1, refer to https://github.com/projectacrn/acrn-hypervisor/blob/master/hypervisor/include/common/vm_uuids.h */ 33 - guid_t vm_uuid = GUID_INIT(0x385479d2, 0xd625, 0xe811, 0x86, 0x4e, 0xcb, 0x7a, 0x18, 0xb3, 0x46, 0x43); 34 32 35 33 int hsm_fd; 36 34 int is_running = 1; ··· 61 63 } 62 64 hsm_fd = open("/dev/acrn_hsm", O_RDWR|O_CLOEXEC); 63 65 64 - memcpy(&create_vm.uuid, &vm_uuid, 16); 65 66 create_vm.ioreq_buf = (__u64)io_req_buf; 66 67 ret = ioctl(hsm_fd, ACRN_IOCTL_CREATE_VM, &create_vm); 67 68 printf("Created VM! [%d]\n", ret);