2015-02-08 21:51:16 +03:00
|
|
|
#ifndef SYSEMU_NUMA_H
|
|
|
|
#define SYSEMU_NUMA_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "qemu/bitmap.h"
|
|
|
|
#include "qemu/option.h"
|
|
|
|
#include "sysemu/sysemu.h"
|
|
|
|
#include "sysemu/hostmem.h"
|
2015-03-19 20:09:21 +03:00
|
|
|
#include "hw/boards.h"
|
2015-02-08 21:51:16 +03:00
|
|
|
|
|
|
|
extern int nb_numa_nodes; /* Number of NUMA nodes */
|
|
|
|
|
2015-06-29 11:20:25 +03:00
|
|
|
struct numa_addr_range {
|
|
|
|
ram_addr_t mem_start;
|
|
|
|
ram_addr_t mem_end;
|
|
|
|
QLIST_ENTRY(numa_addr_range) entry;
|
|
|
|
};
|
|
|
|
|
2015-02-08 21:51:16 +03:00
|
|
|
typedef struct node_info {
|
|
|
|
uint64_t node_mem;
|
|
|
|
DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS);
|
|
|
|
struct HostMemoryBackend *node_memdev;
|
|
|
|
bool present;
|
2015-06-29 11:20:25 +03:00
|
|
|
QLIST_HEAD(, numa_addr_range) addr; /* List to store address ranges */
|
2015-02-08 21:51:16 +03:00
|
|
|
} NodeInfo;
|
2015-06-29 11:20:25 +03:00
|
|
|
|
2015-02-08 21:51:16 +03:00
|
|
|
extern NodeInfo numa_info[MAX_NODES];
|
2015-03-19 20:09:21 +03:00
|
|
|
void parse_numa_opts(MachineClass *mc);
|
2015-02-08 21:51:22 +03:00
|
|
|
void numa_post_machine_init(void);
|
2015-02-08 21:51:16 +03:00
|
|
|
void query_numa_node_mem(uint64_t node_mem[]);
|
|
|
|
extern QemuOptsList qemu_numa_opts;
|
2015-06-29 11:20:25 +03:00
|
|
|
void numa_set_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node);
|
|
|
|
void numa_unset_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node);
|
2015-06-29 11:20:27 +03:00
|
|
|
uint32_t numa_get_node(ram_addr_t addr, Error **errp);
|
2015-02-08 21:51:16 +03:00
|
|
|
|
|
|
|
#endif
|