2 * V3 memory movement control
19 int main(int argc, char* argv[]) {
22 struct v3_mem_move_cmd cmd;
25 printf("usage: v3_mem_move <vm_device> <guest_physical_addr> <target_physical_cpu>\n\n");
26 printf("Moves the memory region into which the guest_physical_addr is mapped\n");
27 printf("to host physical memory that has highest affinity for the target_physical_cpu.\n");
28 printf("you can find the current memory mapping via /proc/v3vee/v3-guests-details\n\n");
29 printf(" guest_physical_addr - hex address\n");
30 printf(" target_physical_cpu - base 10 cpuid (0..numcpus-1)\n\n");
35 cmd.gpa = strtoll(argv[2],0,16);
36 cmd.pcore_id = atoi(argv[3]);
38 printf("Migrating memory region of %p to memory with affinity for physical CPU %d\n", (void*)cmd.gpa, cmd.pcore_id);
40 vm_fd = open(vm_dev, O_RDONLY);
43 printf("Error opening VM device: %s\n", vm_dev);
47 int err = ioctl(vm_fd, V3_VM_MOVE_MEM, &cmd);
50 printf("Error write memory migrating command to vm\n");