]> git.proxmox.com Git - mirror_qemu.git/blame - include/sysemu/numa.h
numa: Extend CLI to provide initiator information for numa nodes
[mirror_qemu.git] / include / sysemu / numa.h
CommitLineData
e35704ba
EH
1#ifndef SYSEMU_NUMA_H
2#define SYSEMU_NUMA_H
3
e35704ba 4#include "qemu/bitmap.h"
a44432b4
MA
5#include "qapi/qapi-types-machine.h"
6#include "exec/cpu-common.h"
7
8struct CPUArchId;
e35704ba 9
b58c5c2d
MA
10#define MAX_NODES 128
11#define NUMA_NODE_UNASSIGNED MAX_NODES
12#define NUMA_DISTANCE_MIN 10
13#define NUMA_DISTANCE_DEFAULT 20
14#define NUMA_DISTANCE_MAX 254
15#define NUMA_DISTANCE_UNREACHABLE 255
16
aec90730 17struct NodeInfo {
e35704ba 18 uint64_t node_mem;
e35704ba
EH
19 struct HostMemoryBackend *node_memdev;
20 bool present;
244b3f44
TX
21 bool has_cpu;
22 uint16_t initiator;
0f203430 23 uint8_t distance[MAX_NODES];
3bfe5716 24};
fa9ea81d 25
31959e82
VG
26struct NumaNodeMem {
27 uint64_t node_mem;
28 uint64_t node_plugged_mem;
29};
30
aa570207
TX
31struct NumaState {
32 /* Number of NUMA nodes */
33 int num_nodes;
34
118154b7
TX
35 /* Allow setting NUMA distance for different NUMA nodes */
36 bool have_numa_distance;
7e721e7b 37
244b3f44
TX
38 /* Detect if HMAT support is enabled. */
39 bool hmat_enabled;
40
7e721e7b
TX
41 /* NUMA nodes information */
42 NodeInfo nodes[MAX_NODES];
aa570207
TX
43};
44typedef struct NumaState NumaState;
45
52924dea 46void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp);
ea089eeb 47void parse_numa_opts(MachineState *ms);
7a3099fc 48void numa_complete_configuration(MachineState *ms);
aa570207 49void query_numa_node_mem(NumaNodeMem node_mem[], MachineState *ms);
e35704ba 50extern QemuOptsList qemu_numa_opts;
3bfe5716
LV
51void numa_legacy_auto_assign_ram(MachineClass *mc, NodeInfo *nodes,
52 int nb_nodes, ram_addr_t size);
53void numa_default_auto_assign_ram(MachineClass *mc, NodeInfo *nodes,
54 int nb_nodes, ram_addr_t size);
a44432b4
MA
55void numa_cpu_pre_plug(const struct CPUArchId *slot, DeviceState *dev,
56 Error **errp);
57
e35704ba 58#endif