1e35704baSEduardo Habkost #ifndef SYSEMU_NUMA_H 2e35704baSEduardo Habkost #define SYSEMU_NUMA_H 3e35704baSEduardo Habkost 4e35704baSEduardo Habkost #include <stdint.h> 5e35704baSEduardo Habkost #include "qemu/bitmap.h" 6e35704baSEduardo Habkost #include "qemu/option.h" 7e35704baSEduardo Habkost #include "sysemu/sysemu.h" 8e35704baSEduardo Habkost #include "sysemu/hostmem.h" 957924bcdSIgor Mammedov #include "hw/boards.h" 10e35704baSEduardo Habkost 11e35704baSEduardo Habkost extern int nb_numa_nodes; /* Number of NUMA nodes */ 12e35704baSEduardo Habkost 13fa9ea81dSBharata B Rao struct numa_addr_range { 14fa9ea81dSBharata B Rao ram_addr_t mem_start; 15fa9ea81dSBharata B Rao ram_addr_t mem_end; 16fa9ea81dSBharata B Rao QLIST_ENTRY(numa_addr_range) entry; 17fa9ea81dSBharata B Rao }; 18fa9ea81dSBharata B Rao 19e35704baSEduardo Habkost typedef struct node_info { 20e35704baSEduardo Habkost uint64_t node_mem; 21e35704baSEduardo Habkost DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS); 22e35704baSEduardo Habkost struct HostMemoryBackend *node_memdev; 23e35704baSEduardo Habkost bool present; 24fa9ea81dSBharata B Rao QLIST_HEAD(, numa_addr_range) addr; /* List to store address ranges */ 25e35704baSEduardo Habkost } NodeInfo; 26fa9ea81dSBharata B Rao 27e35704baSEduardo Habkost extern NodeInfo numa_info[MAX_NODES]; 2857924bcdSIgor Mammedov void parse_numa_opts(MachineClass *mc); 29dde11116SEduardo Habkost void numa_post_machine_init(void); 30e35704baSEduardo Habkost void query_numa_node_mem(uint64_t node_mem[]); 31e35704baSEduardo Habkost extern QemuOptsList qemu_numa_opts; 32fa9ea81dSBharata B Rao void numa_set_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node); 33fa9ea81dSBharata B Rao void numa_unset_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node); 34*e75e2a14SBharata B Rao uint32_t numa_get_node(ram_addr_t addr, Error **errp); 35e35704baSEduardo Habkost 36e35704baSEduardo Habkost #endif 37