@@ -139,6 +139,7 @@ extern long hpagesize;
extern int nb_numa_nodes;
extern uint64_t node_mem[MAX_NODES];
extern uint64_t node_cpumask[MAX_NODES];
+extern int node_pin[MAX_NODES];
#define MAX_OPTION_ROMS 16
extern const char *option_rom[MAX_OPTION_ROMS];
@@ -234,6 +234,7 @@ int boot_menu;
int nb_numa_nodes;
uint64_t node_mem[MAX_NODES];
uint64_t node_cpumask[MAX_NODES];
+int node_pin[MAX_NODES];
static QEMUTimer *nographic_timer;
@@ -771,6 +772,22 @@ static void numa_add(const char *optarg)
node_cpumask[nodenr] = value;
}
nb_numa_nodes++;
+ } else if (!strcmp(option, "pin")) {
+ if (get_param_value(option, 128, "nodeid", optarg) == 0) {
+ fprintf(stderr, "error: need nodeid for -numa pin,...\n");
+ exit(1);
+ } else {
+ nodenr = strtoull(option, NULL, 10);
+ if (nodenr >= nb_numa_nodes) {
+ fprintf(stderr, "nodeid exceed specified NUMA nodes\n");
+ exit(1);
+ }
+ }
+ if (get_param_value(option, 128, "host", optarg) == 0) {
+ node_pin[nodenr] = -1;
+ } else {
+ node_pin[nodenr] = strtoull(option, NULL, 10);
+ }
}
return;
}
@@ -1873,6 +1890,7 @@ int main(int argc, char **argv, char **envp)
for (i = 0; i < MAX_NODES; i++) {
node_mem[i] = 0;
node_cpumask[i] = 0;
+ node_pin[i] = -1;
}
assigned_devices_index = 0;