2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2013, Jack Lange <jacklange@cs.pitt.edu>
11 * Copyright (c) 2013, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jacklange@cs.pitt.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
21 #include <palacios/vmm.h>
22 #include <palacios/vm_guest.h>
23 #include <interfaces/vmm_numa.h>
24 #include <palacios/vm_guest_mem.h>
27 static struct v3_numa_hooks * numa_hooks = NULL;
29 void V3_Init_NUMA(struct v3_numa_hooks * hooks) {
31 V3_Print("V3 NUMA interface initialized\n");
35 int v3_numa_hpa_to_node(addr_t hpa) {
40 return numa_hooks->phys_addr_to_node((void *)hpa);
44 int v3_numa_gpa_to_node(struct v3_vm_info * vm, addr_t gpa) {
51 if (v3_gpa_to_hpa(&(vm->cores[0]), gpa, &hpa) == -1) {
52 PrintError("Tried to find NUMA node for invalid GPA (%p)\n", (void *)gpa);
56 return numa_hooks->phys_addr_to_node((void *)hpa);
60 int v3_numa_cpu_to_node(uint32_t cpu) {
66 return numa_hooks->cpu_to_node(cpu);
69 int v3_numa_get_distance(uint32_t node1, uint32_t node2) {
76 return numa_hooks->get_distance(node1, node2);