Build ACPI Heterogeneous Memory Attribute Table (HMAT)
v10 cover Build ACPI Heterogeneous Memory Attribute Table (HMAT)
This series of patches will build Heterogeneous Memory Attribute Table (HMAT) according to the command line. The ACPI HMAT describes the memory attributes, such as memory side cache attributes and bandwidth and latency details, related to the Memory Proximity Domain.
The software is expected to use HMAT information as hint for optimization.
In the linux kernel, the codes in drivers/acpi/hmat/hmat.c parse and report the platform's HMAT tables.
These patches depend on:
https://patchwork.kernel.org/project/qemu-devel/list/?series=166701
The V9 patches link:
https://patchwork.kernel.org/cover/11085475/
Changelog:
v10:
- Add qemu_strtotime_ps() to convert strings with time suffixes to numbers, and add some tests for it.
- Add qapi buildin type time, and add some tests for it.
- Add machine oprion properties "-machine hmat=on|off" for enabling or disabling HMAT in QEMU.
v9:
- change the CLI input way, make it more user firendly (Daniel Black) use latency=NUM[p|n|u]s and bandwidth=NUM[M|G|P](B/s) as input and drop the base-lat and base-bw input.
v8:
- rebase to upstream
- Add check if numa->numa_state is NULL in pxb_dev_realize_common
- Use nb_nodes in spapr_populate_memory() (RESEND to fix) (Igor)
Liu Jingqi (5):
hmat acpi: Build Memory Proximity Domain Attributes Structure(s) hmat acpi: Build System Locality Latency and Bandwidth Information
Structure(s)
hmat acpi: Build Memory Side Cache Information Structure(s)
numa: Extend CLI to provide memory latency and bandwidth information
numa: Extend CLI to provide memory side cache information
Tao Xu (6):
util/cutils: Add qemu_strtotime_ps()
tests/cutils: Add test for qemu_strtotime_ps()
qapi: Add builtin type time
tests: Add test for QAPI builtin type time
numa: Extend CLI to provide initiator information for numa nodes tests/bios-tables-test: add test cases for ACPI HMAT
hw/acpi/Kconfig | 5 + hw/acpi/Makefile.objs | 1 + hw/acpi/hmat.c | 256 +++++++++++++++++++++++++++++ hw/acpi/hmat.h | 103 ++++++++++++ hw/core/machine.c | 72 ++++++++ hw/core/numa.c | 242 +++++++++++++++++++++++++++ hw/i386/acpi-build.c | 3 + include/qapi/visitor-impl.h | 4 + include/qapi/visitor.h | 9 + include/qemu/cutils.h | 1 + include/qemu/typedefs.h | 2 + include/sysemu/numa.h | 39 +++++ qapi/machine.json | 182 +++++++++++++++++++- qapi/opts-visitor.c | 22 +++ qapi/qapi-visit-core.c | 12 ++ qapi/qobject-input-visitor.c | 18 ++ qapi/trace-events | 1 + qemu-options.hx | 96 ++++++++++- scripts/qapi/common.py | 2 + tests/bios-tables-test.c | 44 +++++ tests/test-cutils.c | 199 ++++++++++++++++++++++ tests/test-keyval.c | 125 ++++++++++++++ tests/test-qobject-input-visitor.c | 29 ++++ util/cutils.c | 82 +++++++++ 24 files changed, 1540 insertions(+), 9 deletions(-) create mode 100644 hw/acpi/hmat.c create mode 100644 hw/acpi/hmat.h
Signature · 1 line
2.20.1
PATCH v10 1/11 util/cutils: Add qemu_strtotime_ps()
To convert strings with time suffixes to numbers, support time unit are "ps" for picosecond, "ns" for nanosecond, "us" for microsecond, "ms" for millisecond or "s" for second.
---
New patch in v10.
--- include/qemu/cutils.h | 1 + util/cutils.c | 82 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+)
include/qemu/cutils.h +1 -0
@@ -180,5 +180,6 @@ int uleb128_decode_small(const uint8_t *in, uint32_t *n);* *str1 is <, == or > than *str2. */ int qemu_pstrcmp0 (const char **str1,const char **str2); +int qemu_strtotime_ps (const char *nptr,const char **end,uint64_t *result);#endif
util/cutils.c +82 -0
85 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH v10 2/11 tests/cutils: Add test for qemu_strtotime_ps()
In reply to Tao XuTest the input of basic, time suffixes, float, invaild, trailing and overflow.
---
New patch in v10.
--- tests/test-cutils.c | 199 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+)
tests/test-cutils.c +199 -0
@@ -2179,6 +2179,193 @@ static void test_qemu_strtosz_metric(void)g_assert (endptr == str +6 ); } +static void test_qemu_strtotime_ps_simple (void ) +{ +const char *str; +const char *endptr; +int err; +uint64_t res =0xbaadf00d ; + + str ="0" ; + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0); +g_assert (endptr == str +1 ); + + str ="56789" ; + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 56789); +g_assert (endptr == str +5 ); + + err =qemu_strtotime_ps (str,NULL , &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 56789); + +/* Note: precision is 53 bits since we're parsing with strtod() */ + + str ="9007199254740991" ;/* 2^53-1 */ + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0x1fffffffffffff); +g_assert (endptr == str +16 ); + + str ="9007199254740992" ;/* 2^53 */ + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0x20000000000000); +g_assert (endptr == str +16 ); + + str ="9007199254740993" ;/* 2^53+1 */ + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0x20000000000000); /* rounded to 53 bits */ +g_assert (endptr == str +16 ); + + str ="18446744073709549568" ;/* 0xfffffffffffff800 (53 msbs set) */ + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0xfffffffffffff800); +g_assert (endptr == str +20 ); + + str ="18446744073709550591" ;/* 0xfffffffffffffbff */ + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 0xfffffffffffff800); /* rounded to 53 bits */ +g_assert (endptr == str +20 ); + +/* 0x7ffffffffffffe00..0x7fffffffffffffff get rounded to +* 0x8000000000000000, thus -ERANGE; see test_qemu_strtosz_erange() */ +} + +static void test_qemu_strtotime_ps_units (void ) +{ +const char *ps ="1ps" ; +const char *ns ="1ns" ; +const char *us ="1us" ; +const char *ms ="1ms" ; +const char *s ="1s" ; +int err; +const char *endptr; +uint64_t res =0xbaadf00d ; + + err =qemu_strtotime_ps (ps, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 1); +g_assert (endptr == ps +3 ); + + err =qemu_strtotime_ps (ns, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 1000); +g_assert (endptr == ns +3 ); + + err =qemu_strtotime_ps (us, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 1000000); +g_assert (endptr == us +3 ); + + err =qemu_strtotime_ps (ms, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 1000000000LL); +g_assert (endptr == ms +3 ); + + err =qemu_strtotime_ps (s, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 1000000000000ULL); +g_assert (endptr == s +2 ); +} + +static void test_qemu_strtotime_ps_float (void ) +{ +const char *str ="56.789ns" ; +int err; +const char *endptr; +uint64_t res =0xbaadf00d ; + + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, 0); + g_assert_cmpint(res, ==, 56.789 * 1000); +g_assert (endptr == str +8 ); +} + +static void test_qemu_strtotime_ps_invalid (void ) +{ +const char *str; +const char *endptr; +int err; +uint64_t res =0xbaadf00d ; + + str ="" ; + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -EINVAL); +g_assert (endptr == str); + + str =" \t " ; + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -EINVAL); +g_assert (endptr == str); + + str ="crap" ; + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -EINVAL); +g_assert (endptr == str); + + str ="inf" ; + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -EINVAL); +g_assert (endptr == str); + + str ="NaN" ; + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -EINVAL); +g_assert (endptr == str); +} + +static void test_qemu_strtotime_ps_trailing (void ) +{ +const char *str; +int err; +uint64_t res =0xbaadf00d ; + + str ="123xxx" ; + + err =qemu_strtotime_ps (str,NULL , &res); + g_assert_cmpint(err, ==, -EINVAL); +} + +static void test_qemu_strtotime_ps_erange (void ) +{ +const char *str; +const char *endptr; +int err; +uint64_t res =0xbaadf00d ; + + str ="-1" ; + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -ERANGE); +g_assert (endptr == str +2 ); + + str ="18446744073709550592" ;/* 0xfffffffffffffc00 */ + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -ERANGE); +g_assert (endptr == str +20 ); + + str ="18446744073709551615" ;/* 2^64-1 */ + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -ERANGE); +g_assert (endptr == str +20 ); + + str ="18446744073709551616" ;/* 2^64 */ + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -ERANGE); +g_assert (endptr == str +20 ); + + str ="200000000000000s" ; + err =qemu_strtotime_ps (str, &endptr, &res); + g_assert_cmpint(err, ==, -ERANGE); +g_assert (endptr == str +16 ); +} +int main (int argc,char **argv) {g_test_init (&argc, &argv,NULL );
@@ -2456,5 +2643,17 @@ int main(int argc, char **argv)g_test_add_func ("/cutils/strtosz/metric" , test_qemu_strtosz_metric); +g_test_add_func ("/cutils/strtotime/simple" , + test_qemu_strtotime_ps_simple); +g_test_add_func ("/cutils/strtotime/units" , + test_qemu_strtotime_ps_units); +g_test_add_func ("/cutils/strtotime/float" , + test_qemu_strtotime_ps_float); +g_test_add_func ("/cutils/strtotime/invalid" , + test_qemu_strtotime_ps_invalid); +g_test_add_func ("/cutils/strtotime/trailing" , + test_qemu_strtotime_ps_trailing); +g_test_add_func ("/cutils/strtotime/erange" , + test_qemu_strtotime_ps_erange);return g_test_run (); }
Signature · 1 line
2.20.1
PATCH v10 3/11 qapi: Add builtin type time
In reply to Tao XuAdd optional builtin type time, fallback is uint64. This type use qemu_strtotime_ps() for pre-converting time suffix to numbers.
---
New patch in v10.
--- include/qapi/visitor-impl.h | 4 ++++ include/qapi/visitor.h | 9 +++++++++ qapi/opts-visitor.c | 22 ++++++++++++++++++++++ qapi/qapi-visit-core.c | 12 ++++++++++++ qapi/qobject-input-visitor.c | 18 ++++++++++++++++++ qapi/trace-events | 1 + scripts/qapi/common.py | 2 ++ 7 files changed, 68 insertions(+)
include/qapi/visitor-impl.h +4 -0
@@ -88,6 +88,10 @@ struct Visitorvoid (*type_size)(Visitor *v,const char *name,uint64_t *obj,Error **errp); +/* Optional; fallback is type_uint64() */ +void (*type_time)(Visitor *v,const char *name,uint64_t *obj, +Error **errp); +/* Must be set */ void (*type_bool)(Visitor *v,const char *name,bool *obj,Error **errp);
include/qapi/visitor.h +9 -0
@@ -554,6 +554,15 @@ void visit_type_int64(Visitor *v, const char *name, int64_t *obj,void visit_type_size (Visitor *v,const char *name,uint64_t *obj,Error **errp); +/* +* Visit a uint64_t value. +* Like visit_type_uint64(), except that some visitors may choose to +* recognize numbers with timeunit suffix, such as "ps", "ns", "us" +* "ms" and "s". +*/ +void visit_type_time (Visitor *v,const char *name,uint64_t *obj, +Error **errp); +/* * Visit a boolean value. *
qapi/opts-visitor.c +22 -0
@@ -508,6 +508,27 @@ opts_type_size(Visitor *v, const char *name, uint64_t *obj, Error **errp)processed (ov, name); } +static void +opts_type_time (Visitor *v,const char *name,uint64_t *obj,Error **errp) +{ +OptsVisitor *ov =to_ov (v); +const QemuOpt *opt; +int err; + + opt =lookup_scalar (ov, name, errp); +if (!opt) { +return ; + } + + err =qemu_strtotime_ps (opt->str ? opt->str :"" ,NULL , obj); +if (err <0 ) { +error_setg (errp,QERR_INVALID_PARAMETER_VALUE , opt->name, +"a time value" ); +return ; + } + +processed (ov, name); +}static void opts_optional (Visitor *v,const char *name,bool *present)
@@ -555,6 +576,7 @@ opts_visitor_new(const QemuOpts *opts) ov->visitor.type_int64 = &opts_type_int64; ov->visitor.type_uint64 = &opts_type_uint64; ov->visitor.type_size = &opts_type_size; + ov->visitor.type_time = &opts_type_time; ov->visitor.type_bool = &opts_type_bool; ov->visitor.type_str = &opts_type_str;
qapi/qapi-visit-core.c +12 -0
@@ -277,6 +277,18 @@ void visit_type_size(Visitor *v, const char *name, uint64_t *obj, } } +void visit_type_time (Visitor *v,const char *name,uint64_t *obj, +Error **errp) +{ +assert (obj); +trace_visit_type_time (v, name, obj); +if (v->type_time) { + v->type_time (v, name, obj, errp); + }else { + v->type_uint64 (v, name, obj, errp); + } +} +void visit_type_bool (Visitor *v,const char *name,bool *obj,Error **errp) {assert (obj);
qapi/qobject-input-visitor.c +18 -0
@@ -627,6 +627,23 @@ static void qobject_input_type_size_keyval(Visitor *v, const char *name, } } +static void qobject_input_type_time_keyval (Visitor *v,const char *name, +uint64_t *obj,Error **errp) +{ +QObjectInputVisitor *qiv =to_qiv (v); +const char *str =qobject_input_get_keyval (qiv, name, errp); + +if (!str) { +return ; + } + +if (qemu_strtotime_ps (str,NULL , obj) <0 ) { +/* TODO report -ERANGE more nicely */ +error_setg (errp,QERR_INVALID_PARAMETER_VALUE , +full_name (qiv, name),"time" ); + } +} +static void qobject_input_optional (Visitor *v,const char *name,bool *present) {QObjectInputVisitor *qiv =to_qiv (v);
@@ -708,6 +725,7 @@ Visitor *qobject_input_visitor_new_keyval(QObject *obj) v->visitor.type_any = qobject_input_type_any; v->visitor.type_null = qobject_input_type_null; v->visitor.type_size = qobject_input_type_size_keyval; + v->visitor.type_time = qobject_input_type_time_keyval; v->keyval = true;return &v->visitor;
qapi/trace-events +1 -0
@@ -29,6 +29,7 @@ visit_type_int16(void *v, const char *name, int16_t *obj) "v=%p name=%s obj=%p" visit_type_int32(void *v, const char *name, int32_t *obj) "v=%p name=%s obj=%p" visit_type_int64(void *v, const char *name, int64_t *obj) "v=%p name=%s obj=%p" visit_type_size(void *v, const char *name, uint64_t *obj) "v=%p name=%s obj=%p" +visit_type_time(void *v, const char *name, uint64_t *obj) "v=%p name=%s obj=%p" visit_type_bool(void *v, const char *name, bool *obj) "v=%p name=%s obj=%p" visit_type_str(void *v, const char *name, char **obj) "v=%p name=%s obj=%p" visit_type_number(void *v, const char *name, void *obj) "v=%p name=%s obj=%p"
scripts/qapi/common.py +2 -0
@@ -35,6 +35,7 @@ builtin_types = { 'uint32': 'QTYPE_QNUM', 'uint64': 'QTYPE_QNUM', 'size': 'QTYPE_QNUM', + 'time': 'QTYPE_QNUM', 'any': None, # any QType possible, actually 'QType': 'QTYPE_QSTRING', }
@@ -1834,6 +1835,7 @@ class QAPISchema(object): ('uint32', 'int', 'uint32_t'), ('uint64', 'int', 'uint64_t'), ('size', 'int', 'uint64_t'), + ('time', 'int', 'uint64_t'), ('bool', 'boolean', 'bool'), ('any', 'value', 'QObject' + pointer_suffix), ('null', 'null', 'QNull' + pointer_suffix)]:
Signature · 1 line
2.20.1
PATCH v10 4/11 tests: Add test for QAPI builtin type time
In reply to Tao XuAdd tests for time input such as zero, around limit of precision, signed upper limit, actual upper limit, beyond limits, time suffixes, and etc.
---
New patch in v10.
--- tests/test-keyval.c | 125 +++++++++++++++++++++++++++++ tests/test-qobject-input-visitor.c | 29 +++++++ 2 files changed, 154 insertions(+)
tests/test-keyval.c +125 -0
@@ -490,6 +490,130 @@ static void test_keyval_visit_size(void)visit_free (v); } +static void test_keyval_visit_time (void ) +{ +Error *err =NULL ; +Visitor *v; +QDict *qdict; +uint64_t time; + +/* Lower limit zero */ + qdict =keyval_parse ("time1=0" ,NULL , &error_abort); + v =qobject_input_visitor_new_keyval (QOBJECT (qdict)); +qobject_unref (qdict); +visit_start_struct (v,NULL ,NULL ,0 , &error_abort); +visit_type_time (v,"time1" , &time, &error_abort); + g_assert_cmpuint(time, ==, 0); +visit_check_struct (v, &error_abort); +visit_end_struct (v,NULL ); +visit_free (v); + +/* Around limit of precision: 2^53-1, 2^53, 2^53+1 */ + qdict =keyval_parse ("time1=9007199254740991," +"time2=9007199254740992," +"time3=9007199254740993" , +NULL , &error_abort); + v =qobject_input_visitor_new_keyval (QOBJECT (qdict)); +qobject_unref (qdict); +visit_start_struct (v,NULL ,NULL ,0 , &error_abort); +visit_type_time (v,"time1" , &time, &error_abort); + g_assert_cmphex(time, ==, 0x1fffffffffffff); +visit_type_time (v,"time2" , &time, &error_abort); + g_assert_cmphex(time, ==, 0x20000000000000); +visit_type_time (v,"time3" , &time, &error_abort); + g_assert_cmphex(time, ==, 0x20000000000000); +visit_check_struct (v, &error_abort); +visit_end_struct (v,NULL ); +visit_free (v); + +/* Close to signed upper limit 0x7ffffffffffffc00 (53 msbs set) */ + qdict =keyval_parse ("time1=9223372036854774784," /* 7ffffffffffffc00 */ +"time2=9223372036854775295" ,/* 7ffffffffffffdff */ +NULL , &error_abort); + v =qobject_input_visitor_new_keyval (QOBJECT (qdict)); +qobject_unref (qdict); +visit_start_struct (v,NULL ,NULL ,0 , &error_abort); +visit_type_time (v,"time1" , &time, &error_abort); + g_assert_cmphex(time, ==, 0x7ffffffffffffc00); +visit_type_time (v,"time2" , &time, &error_abort); + g_assert_cmphex(time, ==, 0x7ffffffffffffc00); +visit_check_struct (v, &error_abort); +visit_end_struct (v,NULL ); +visit_free (v); + +/* Close to actual upper limit 0xfffffffffffff800 (53 msbs set) */ + qdict =keyval_parse ("time1=18446744073709549568," /* fffffffffffff800 */ +"time2=18446744073709550591" ,/* fffffffffffffbff */ +NULL , &error_abort); + v =qobject_input_visitor_new_keyval (QOBJECT (qdict)); +qobject_unref (qdict); +visit_start_struct (v,NULL ,NULL ,0 , &error_abort); +visit_type_time (v,"time1" , &time, &error_abort); + g_assert_cmphex(time, ==, 0xfffffffffffff800); +visit_type_time (v,"time2" , &time, &error_abort); + g_assert_cmphex(time, ==, 0xfffffffffffff800); +visit_check_struct (v, &error_abort); +visit_end_struct (v,NULL ); +visit_free (v); + +/* Beyond limits */ + qdict =keyval_parse ("time1=-1," +"time2=18446744073709550592" ,/* fffffffffffffc00 */ +NULL , &error_abort); + v =qobject_input_visitor_new_keyval (QOBJECT (qdict)); +qobject_unref (qdict); +visit_start_struct (v,NULL ,NULL ,0 , &error_abort); +visit_type_time (v,"time1" , &time, &err); +error_free_or_abort (&err); +visit_type_time (v,"time2" , &time, &err); +error_free_or_abort (&err); +visit_end_struct (v,NULL ); +visit_free (v); + +/* Suffixes */ + qdict =keyval_parse ("time1=2ps,time2=3.4ns,time3=5us," +"time4=0.6ms,time5=700s" , +NULL , &error_abort); + v =qobject_input_visitor_new_keyval (QOBJECT (qdict)); +qobject_unref (qdict); +visit_start_struct (v,NULL ,NULL ,0 , &error_abort); +visit_type_time (v,"time1" , &time, &error_abort); + g_assert_cmpuint(time, ==, 2); +visit_type_time (v,"time2" , &time, &error_abort); + g_assert_cmpuint(time, ==, 3400); +visit_type_time (v,"time3" , &time, &error_abort); + g_assert_cmphex(time, ==, 5 * 1000 * 1000); +visit_type_time (v,"time4" , &time, &error_abort); + g_assert_cmphex(time, ==, 600 * 1000 * 1000); +visit_type_time (v,"time5" , &time, &error_abort); + g_assert_cmphex(time, ==, 700 * 1000000000000ULL); +visit_check_struct (v, &error_abort); +visit_end_struct (v,NULL ); +visit_free (v); + +/* Beyond limit with suffix */ + qdict =keyval_parse ("time1=18446745s" ,NULL , &error_abort); + v =qobject_input_visitor_new_keyval (QOBJECT (qdict)); +qobject_unref (qdict); +visit_start_struct (v,NULL ,NULL ,0 , &error_abort); +visit_type_time (v,"time1" , &time, &err); +error_free_or_abort (&err); +visit_end_struct (v,NULL ); +visit_free (v); + +/* Trailing crap */ + qdict =keyval_parse ("time1=89ks,time2=ns" ,NULL , &error_abort); + v =qobject_input_visitor_new_keyval (QOBJECT (qdict)); +qobject_unref (qdict); +visit_start_struct (v,NULL ,NULL ,0 , &error_abort); +visit_type_time (v,"time1" , &time, &err); +error_free_or_abort (&err); +visit_type_time (v,"time2" , &time, &err);; +error_free_or_abort (&err); +visit_end_struct (v,NULL ); +visit_free (v); +} +static void test_keyval_visit_dict (void ) {Error *err =NULL ;
@@ -678,6 +802,7 @@ int main(int argc, char *argv[])g_test_add_func ("/keyval/visit/bool" , test_keyval_visit_bool);g_test_add_func ("/keyval/visit/number" , test_keyval_visit_number);g_test_add_func ("/keyval/visit/size" , test_keyval_visit_size); +g_test_add_func ("/keyval/visit/time" , test_keyval_visit_time);g_test_add_func ("/keyval/visit/dict" , test_keyval_visit_dict);g_test_add_func ("/keyval/visit/list" , test_keyval_visit_list);g_test_add_func ("/keyval/visit/optional" , test_keyval_visit_optional);
tests/test-qobject-input-visitor.c +29 -0
@@ -366,6 +366,31 @@ static void test_visitor_in_size_str_fail(TestInputVisitorData *data,error_free_or_abort (&err); } +static void test_visitor_in_time_str_keyval (TestInputVisitorData *data, +const void *unused) +{ +uint64_t res, value =265 *1000 *1000 ; +Visitor *v; + + v =visitor_input_test_init_full (data, true,"\"265us\"" ); + +visit_type_time (v,NULL , &res, &error_abort); + g_assert_cmpfloat(res, ==, value); +} + +static void test_visitor_in_time_str_fail (TestInputVisitorData *data, +const void *unused) +{ +uint64_t res =0 ; +Visitor *v; +Error *err =NULL ; + + v =visitor_input_test_init (data,"\"265us\"" ); + +visit_type_time (v,NULL , &res, &err); +error_free_or_abort (&err); +} +static void test_visitor_in_string (TestInputVisitorData *data,const void *unused) {
@@ -1311,6 +1336,10 @@ int main(int argc, char **argv) NULL, test_visitor_in_size_str_keyval);input_visitor_test_add ("/visitor/input/size_str_fail" ,NULL , test_visitor_in_size_str_fail); +input_visitor_test_add ("/visitor/input/time_str_keyval" , +NULL , test_visitor_in_time_str_keyval); +input_visitor_test_add ("/visitor/input/time_str_fail" , +NULL , test_visitor_in_time_str_fail);input_visitor_test_add ("/visitor/input/string" ,NULL , test_visitor_in_string); input_visitor_test_add("/visitor/input/enum",
Signature · 1 line
2.20.1
PATCH v10 5/11 numa: Extend CLI to provide initiator information for numa nodes
In reply to Tao XuIn ACPI 6.3 chapter 5.2.27 Heterogeneous Memory Attribute Table (HMAT), The initiator represents processor which access to memory. And in 5.2.27.3 Memory Proximity Domain Attributes Structure, the attached initiator is defined as where the memory controller responsible for a memory proximity domain. With attached initiator information, the topology of heterogeneous memory can be described.
Extend CLI of "-numa node" option to indicate the initiator numa node-id. In the linux kernel, the codes in drivers/acpi/hmat/hmat.c parse and report the platform's HMAT tables.
---
Changes in v10:
- Add machine oprion properties "-machine hmat=on|off" for enabling or disabling HMAT in QEMU.
- Add more description for initiator option.
- Report error then HMAT is enalbe and initiator option is missing. Not allow invaild initiator now. (Igor)
--- hw/core/machine.c | 72 +++++++++++++++++++++++++++++++++++++++++++ hw/core/numa.c | 11 +++++++ include/sysemu/numa.h | 6 ++++ qapi/machine.json | 10 +++++- qemu-options.hx | 35 ++++++++++++++++++--- 5 files changed, 128 insertions(+), 6 deletions(-)
hw/core/machine.c +72 -0
@@ -516,6 +516,20 @@ static void machine_set_nvdimm(Object *obj, bool value, Error **errp) ms->nvdimms_state->is_enabled = value; } +static bool machine_get_hmat (Object *obj,Error **errp) +{ +MachineState *ms =MACHINE (obj); + +return ms->numa_state->hmat_enabled; +} + +static void machine_set_hmat (Object *obj,bool value,Error **errp) +{ +MachineState *ms =MACHINE (obj); + + ms->numa_state->hmat_enabled = value; +} +static char *machine_get_nvdimm_persistence (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
@@ -643,6 +657,7 @@ void machine_set_cpu_numa_node(MachineState *machine, const CpuInstanceProperties *props, Error **errp) { MachineClass *mc = MACHINE_GET_CLASS(machine); +NodeInfo *numa_info = machine->numa_state->nodes;bool match = false;int i;
@@ -712,6 +727,16 @@ void machine_set_cpu_numa_node(MachineState *machine, match = true; slot->props.node_id = props->node_id; slot->props.has_node_id = props->has_node_id; + +if (numa_info[props->node_id].initiator_valid && + (props->node_id != numa_info[props->node_id].initiator)) { +error_setg (errp,"The initiator of CPU NUMA node %" PRId64 +" should be itself." , props->node_id); +return ; + } + numa_info[props->node_id].initiator_valid = true; + numa_info[props->node_id].has_cpu = true; + numa_info[props->node_id].initiator = props->node_id; }if (!match) {
@@ -958,6 +983,13 @@ static void machine_initfn(Object *obj)if (mc->numa_mem_supported) { ms->numa_state =g_new0 (NumaState,1 ); +object_property_add_bool (obj,"hmat" , + machine_get_hmat, machine_set_hmat, + &error_abort); +object_property_set_description (obj,"hmat" , +"Set on/off to enable/disable " +"ACPI Heterogeneous Memory Attribute " +"Table (HMAT)" ,NULL ); }/* Register notifier when init is done for sysbus sanity checks */
@@ -1046,6 +1078,41 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)return g_string_free (s, false); } +static void numa_validate_initiator (NumaState *nstat) +{ +int i; +NodeInfo *numa_info = nstat->nodes; + +for (i =0 ; i < nstat->num_nodes; i++) { +if (numa_info[i].initiator >=MAX_NODES ) { +error_report ("The initiator id %" PRIu16" expects an integer " +"between 0 and %d" , numa_info[i].initiator, +MAX_NODES -1 ); + goto err; + } + +if (!numa_info[numa_info[i].initiator].present) { +error_report ("NUMA node %" PRIu16" is missing, use " +"'-numa node' option to declare it first." , + numa_info[i].initiator); + goto err; + } + +if (numa_info[numa_info[i].initiator].has_cpu) { + numa_info[i].initiator_valid = true; + }else { +error_report ("The initiator of NUMA node %d is invalid." , i); + goto err; + } + } + +return ; + +err: +error_printf ("\n" ); +exit (1 ); +} +static void machine_numa_finish_cpu_init (MachineState *machine) {int i;
@@ -1086,6 +1153,11 @@ static void machine_numa_finish_cpu_init(MachineState *machine)machine_set_cpu_numa_node (machine, &props, &error_fatal); } } + +if (machine->numa_state->hmat_enabled) { +numa_validate_initiator (machine->numa_state); + } +if (s->len && !qtest_enabled ()) {warn_report ("CPU(s) not present in any NUMA nodes: %s" , s->str);
hw/core/numa.c +11 -0
@@ -133,6 +133,17 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node, numa_info[nodenr].node_mem =object_property_get_uint (o,"size" ,NULL ); numa_info[nodenr].node_memdev =MEMORY_BACKEND (o); } + +if (node->has_initiator) { +if (!ms->numa_state->hmat_enabled) { +error_setg (errp,"ACPI Heterogeneous Memory Attribute Table " +"(HMAT) is disabled, use -machine,hmat=yes before " +"set initiator of NUMA" ); +return ; + } + + numa_info[nodenr].initiator = node->initiator; + } numa_info[nodenr].present = true; max_numa_nodeid =MAX (max_numa_nodeid, nodenr +1 ); ms->numa_state->num_nodes++;
include/sysemu/numa.h +6 -0
@@ -18,6 +18,9 @@ struct NodeInfo {uint64_t node_mem;struct HostMemoryBackend *node_memdev;bool present; +bool has_cpu; +bool initiator_valid; +uint16_t initiator;uint8_t distance[MAX_NODES ]; };
@@ -33,6 +36,9 @@ struct NumaState {/* Allow setting NUMA distance for different NUMA nodes */ bool have_numa_distance; +/* Detect if HMAT support is enabled. */ +bool hmat_enabled; +/* NUMA nodes information */ NodeInfo nodes[MAX_NODES ]; };
qapi/machine.json +9 -1
@@ -463,6 +463,13 @@ # @memdev: memory backend object. If specified for one node, # it must be specified for all nodes. # +# @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145, +# indicate the nodeid which has the memory controller +# responsible for this NUMA node. This field provides +# additional information as to the initiator node that +# is closest (as in directly attached) to this node, and +# therefore has the best performance (since 4.2) +# # Since: 2.1 ## { 'struct': 'NumaNodeOptions',
@@ -470,7 +477,8 @@ '*nodeid': 'uint16', '*cpus': ['uint16'], '*mem': 'size', - '*memdev': 'str' }} + '*memdev': 'str', + '*initiator': 'uint16' }} ## # @NumaDistOptions:
qemu-options.hx +30 -5
@@ -43,7 +43,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ " suppress-vmdesc=on|off disables self-describing migration (default=off)\n" " nvdimm=on|off controls NVDIMM support (default=off)\n" " enforce-config-section=on|off enforce configuration section migration (default=off)\n" - " memory-encryption=@var{} memory encryption object to use (default=none)\n", + " memory-encryption=@var{} memory encryption object to use (default=none)\n" + " hmat=on|off controls ACPI HMAT support (default=off)\n", QEMU_ARCH_ALL) STEXI @item -machine [type=]@var{name}[,prop=@var{value}[,...]]
@@ -103,6 +104,9 @@ NOTE: this parameter is deprecated. Please use @option{-global} @option{migration.send-configuration}=@var{on|off} instead. @item memory-encryption=@var{} Memory encryption object to use. The default is none. +@item hmat=on|off +Enables or disables ACPI Heterogeneous Memory Attribute Table (HMAT) support. +The default is off. @end table ETEXI
@@ -161,14 +165,14 @@ If any on the three values is given, the total number of CPUs @var{n} can be omi ETEXI DEF("numa", HAS_ARG, QEMU_OPTION_numa, - "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n" - "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n" + "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" + "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" "-numa dist,src=source,dst=destination,val=distance\n" "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n", QEMU_ARCH_ALL) STEXI -@item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}] -@itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}] +@item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}] +@itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}] @itemx -numa dist,src=@var{source},dst=@var{destination},val=@var{distance} @itemx -numa cpu,node-id=@var{node}[,socket-id=@var{x}][,core-id=@var{y}][,thread-id=@var{z}] @findex -numa
@@ -215,6 +219,27 @@ split equally between them. @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore, if one node uses @samp{memdev}, all of them have to use it. +@samp{initiator} is an additional option indicate the @var{initiator} +NUMA that has best performance (the lowest latency or largest bandwidth) +to this NUMA @var{node}. Note that this option can be set only when +the machine oprion properties "-machine hmat=on". + +Following example creates a machine with 2 NUMA nodes, node 0 has CPU. +node 1 has only memory, and its' initiator is node 0. Note that because +node 0 has CPU, by default the initiator of node 0 is itself and must be +itself. +@example +-machine hmat=on \ +-m 2G,slots=2,maxmem=4G \ +-object memory-backend-ram,size=1G,id=m0 \ +-object memory-backend-ram,size=1G,id=m1 \ +-numa node,nodeid=0,memdev=m0 \ +-numa node,nodeid=1,memdev=m1,initiator=0 \ +-smp 2,sockets=2,maxcpus=2 \ +-numa cpu,node-id=0,socket-id=0 \ +-numa cpu,node-id=0,socket-id=1 +@end example + @var{source} and @var{destination} are NUMA node IDs. @var{distance} is the NUMA distance from @var{source} to @var{destination}. The distance from a node to itself is always 10. If any pair of nodes is
Signature · 1 line
2.20.1
PATCH v10 6/11 hmat acpi: Build Memory Proximity Domain Attributes Structure(s)
In reply to Tao XuFrom: Liu Jingqi <[email protected]>
HMAT is defined in ACPI 6.3: 5.2.27 Heterogeneous Memory Attribute Table (HMAT). The specification references below link:
http://www.uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
It describes the memory attributes, such as memory side cache attributes and bandwidth and latency details, related to the Memory Proximity Domain. The software is
expected to use this information as hint for optimization.
This structure describes Memory Proximity Domain Attributes by memory subsystem and its associativity with processor proximity domain as well as hint for memory usage.
In the linux kernel, the codes in drivers/acpi/hmat/hmat.c parse and report the platform's HMAT tables.
---
No changes in v10
--- hw/acpi/Kconfig | 5 +++ hw/acpi/Makefile.objs | 1 + hw/acpi/hmat.c | 101 ++++++++++++++++++++++++++++++++++++++++++ hw/acpi/hmat.h | 45 +++++++++++++++++++ hw/i386/acpi-build.c | 3 ++ 5 files changed, 155 insertions(+) create mode 100644 hw/acpi/hmat.c create mode 100644 hw/acpi/hmat.h
hw/acpi/Kconfig +5 -0
@@ -7,6 +7,7 @@ config ACPI_X86 select ACPI_NVDIMM select ACPI_CPU_HOTPLUG select ACPI_MEMORY_HOTPLUG + select ACPI_HMAT config ACPI_X86_ICH bool
@@ -31,3 +32,7 @@ config ACPI_VMGENID bool default y depends on PC + +config ACPI_HMAT + bool + depends on ACPI
hw/acpi/Makefile.objs +1 -0
@@ -6,6 +6,7 @@ common-obj-$(CONFIG_ACPI_MEMORY_HOTPLUG) += memory_hotplug.o common-obj-$(CONFIG_ACPI_CPU_HOTPLUG) += cpu.o common-obj-$(CONFIG_ACPI_NVDIMM) += nvdimm.o common-obj-$(CONFIG_ACPI_VMGENID) += vmgenid.o +common-obj-$(CONFIG_ACPI_HMAT) += hmat.o common-obj-$(call lnot,$(CONFIG_ACPI_X86)) += acpi-stub.o common-obj-y += acpi_interface.o
hw/acpi/hmat.c new file +101 -0
101 lines not on this page · raw message
hw/acpi/hmat.h new file +45 -0
45 lines not on this page · raw message
hw/i386/acpi-build.c +3 -0
@@ -68,6 +68,7 @@#include "hw/i386/intel_iommu.h" #include "hw/acpi/ipmi.h" +#include "hw/acpi/hmat.h" /* These are used to size the ACPI tables for -M pc-i440fx-1.7 and * -M pc-i440fx-2.0. Even if the actual amount of AML generated grows
@@ -2698,6 +2699,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)acpi_add_table (table_offsets, tables_blob);build_slit (tables_blob, tables->linker, machine); } +acpi_add_table (table_offsets, tables_blob); +build_hmat (tables_blob, tables->linker, machine->numa_state); }if (acpi_get_mcfg (&mcfg)) {acpi_add_table (table_offsets, tables_blob);
Signature · 1 line
2.20.1
PATCH v10 7/11 hmat acpi: Build System Locality Latency and Bandwidth Information Structure(s)
In reply to Tao XuFrom: Liu Jingqi <[email protected]>
This structure describes the memory access latency and bandwidth information from various memory access initiator proximity domains. The latency and bandwidth numbers represented in this structure correspond to rated latency and bandwidth for the platform. The software could use this information as hint for optimization.
---
No changes in v10.
--- hw/acpi/hmat.c | 95 ++++++++++++++++++++++++++++++++++++++++- hw/acpi/hmat.h | 41 ++++++++++++++++++ include/qemu/typedefs.h | 1 + include/sysemu/numa.h | 24 +++++++++++ 4 files changed, 160 insertions(+), 1 deletion(-)
hw/acpi/hmat.c +94 -1
@@ -67,11 +67,81 @@ static void build_hmat_mpda(GArray *table_data, uint16_t flags, int initiator,build_append_int_noprefix (table_data,0 ,8 ); } +/* +* ACPI 6.3: 5.2.27.4 System Locality Latency and Bandwidth Information +* Structure: Table 5-146 +*/ +static void build_hmat_lb (GArray *table_data,HMAT_LB_Info *hmat_lb, +uint32_t num_initiator,uint32_t num_target, +uint32_t *initiator_pxm,int type) +{ +uint32_t s = num_initiator; +uint32_t t = num_target; +uint8_t m, n; +uint8_t mask =0x0f ; +int i; + +/* Type */ +build_append_int_noprefix (table_data,1 ,2 ); +/* Reserved */ +build_append_int_noprefix (table_data,0 ,2 ); +/* Length */ +build_append_int_noprefix (table_data,32 +4 * s +4 * t +2 * s * t,4 ); +/* Flags: Bits [3:0] Memory Hierarchy, Bits[7:4] Reserved */ +build_append_int_noprefix (table_data, hmat_lb->hierarchy & mask,1 ); +/* Data Type */ +build_append_int_noprefix (table_data, hmat_lb->data_type,1 ); +/* Reserved */ +build_append_int_noprefix (table_data,0 ,2 ); +/* Number of Initiator Proximity Domains (s) */ +build_append_int_noprefix (table_data, s,4 ); +/* Number of Target Proximity Domains (t) */ +build_append_int_noprefix (table_data, t,4 ); +/* Reserved */ +build_append_int_noprefix (table_data,0 ,4 ); + +/* Entry Base Unit */ +if (HMAT_IS_LATENCY (type)) { +build_append_int_noprefix (table_data, hmat_lb->base_lat,8 ); + }else { +build_append_int_noprefix (table_data, hmat_lb->base_bw,8 ); + } + +/* Initiator Proximity Domain List */ +for (i =0 ; i < s; i++) { +build_append_int_noprefix (table_data, initiator_pxm[i],4 ); + } + +/* Target Proximity Domain List */ +for (i =0 ; i < t; i++) { +build_append_int_noprefix (table_data, i,4 ); + } + +/* Latency or Bandwidth Entries */ +for (i =0 ; i < s; i++) { + m = initiator_pxm[i]; +for (n =0 ; n < t; n++) { +uint16_t entry; + +if (HMAT_IS_LATENCY (type)) { + entry = hmat_lb->latency[m][n]; + }else { + entry = hmat_lb->bandwidth[m][n]; + } + +build_append_int_noprefix (table_data, entry,2 ); + } + } +} +/* Build HMAT sub table structures */ static void hmat_build_table_structs (GArray *table_data,NumaState *nstat) {uint16_t flags; -int i; +uint32_t num_initiator =0 ; +uint32_t initiator_pxm[MAX_NODES ]; +int i, hrchy, type; +HMAT_LB_Info *numa_hmat_lb;for (i =0 ; i < nstat->num_nodes; i++) { flags =0 ;
@@ -82,6 +152,29 @@ static void hmat_build_table_structs(GArray *table_data, NumaState *nstat)build_hmat_mpda (table_data, flags, nstat->nodes[i].initiator, i); } + +for (i =0 ; i < nstat->num_nodes; i++) { +if (nstat->nodes[i].has_cpu) { + initiator_pxm[num_initiator++] = i; + } + } + +/* +* ACPI 6.3: 5.2.27.4 System Locality Latency and Bandwidth Information +* Structure: Table 5-146 +*/ +for (hrchy =HMAT_LB_MEM_MEMORY ; + hrchy <=HMAT_LB_MEM_CACHE_3RD_LEVEL ; hrchy++) { +for (type =HMAT_LB_DATA_ACCESS_LATENCY ; + type <=HMAT_LB_DATA_WRITE_BANDWIDTH ; type++) { + numa_hmat_lb = nstat->hmat_lb[hrchy][type]; + +if (numa_hmat_lb) { +build_hmat_lb (table_data, numa_hmat_lb, num_initiator, + nstat->num_nodes, initiator_pxm, type); + } + } + } }void build_hmat (GArray *table_data,BIOSLinker *linker,NumaState *nstat)
hw/acpi/hmat.h +41 -0
47 lines not on this page · raw message
include/qemu/typedefs.h +1 -0
@@ -49,6 +49,7 @@ typedef struct FWCfgEntry FWCfgEntry;typedef struct FWCfgIoState FWCfgIoState ;typedef struct FWCfgMemState FWCfgMemState ;typedef struct FWCfgState FWCfgState ; +typedef struct HMAT_LB_Info HMAT_LB_Info ;typedef struct HostMemoryBackend HostMemoryBackend ;typedef struct HVFX86EmulatorState HVFX86EmulatorState ;typedef struct I2CBus I2CBus ;
include/sysemu/numa.h +24 -0
@@ -14,6 +14,27 @@ struct CPUArchId;#define NUMA_DISTANCE_MAX 254#define NUMA_DISTANCE_UNREACHABLE 255 +/* the value of AcpiHmatLBInfo flags */ +enum { +HMAT_LB_MEM_MEMORY =0 , +HMAT_LB_MEM_CACHE_1ST_LEVEL =1 , +HMAT_LB_MEM_CACHE_2ND_LEVEL =2 , +HMAT_LB_MEM_CACHE_3RD_LEVEL =3 , +}; + +/* the value of AcpiHmatLBInfo data type */ +enum { +HMAT_LB_DATA_ACCESS_LATENCY =0 , +HMAT_LB_DATA_READ_LATENCY =1 , +HMAT_LB_DATA_WRITE_LATENCY =2 , +HMAT_LB_DATA_ACCESS_BANDWIDTH =3 , +HMAT_LB_DATA_READ_BANDWIDTH =4 , +HMAT_LB_DATA_WRITE_BANDWIDTH =5 , +}; + +#define HMAT_LB_LEVELS (HMAT_LB_MEM_CACHE_3RD_LEVEL + 1) +#define HMAT_LB_TYPES (HMAT_LB_DATA_WRITE_BANDWIDTH + 1) +struct NodeInfo {uint64_t node_mem;struct HostMemoryBackend *node_memdev;
@@ -41,6 +62,9 @@ struct NumaState {/* NUMA nodes information */ NodeInfo nodes[MAX_NODES ]; + +/* NUMA modes HMAT Locality Latency and Bandwidth Information */ +HMAT_LB_Info *hmat_lb[HMAT_LB_LEVELS ][HMAT_LB_TYPES ]; };typedef struct NumaState NumaState ;
Signature · 1 line
2.20.1
PATCH v10 8/11 hmat acpi: Build Memory Side Cache Information Structure(s)
In reply to Tao XuFrom: Liu Jingqi <[email protected]>
This structure describes memory side cache information for memory proximity domains if the memory side cache is present and the physical device forms the memory side cache.
The software could use this information to effectively place the data in memory to maximize the performance of the system memory that use the memory side cache.
---
No changes in v10
--- hw/acpi/hmat.c | 64 ++++++++++++++++++++++++++++++++++++++++- hw/acpi/hmat.h | 17 +++++++++++ include/qemu/typedefs.h | 1 + include/sysemu/numa.h | 5 ++++ 4 files changed, 86 insertions(+), 1 deletion(-)
hw/acpi/hmat.c +63 -1
@@ -134,14 +134,63 @@ static void build_hmat_lb(GArray *table_data, HMAT_LB_Info *hmat_lb, } } +/* ACPI 6.3: 5.2.27.5 Memory Side Cache Information Structure: Table 5-147 */ +static void build_hmat_cache (GArray *table_data,HMAT_Cache_Info *hmat_cache) +{ +/* +* Cache Attributes: Bits [3:0] – Total Cache Levels +* for this Memory Proximity Domain +*/ +uint32_t cache_attr = hmat_cache->total_levels &0xF ; + +/* Bits [7:4] : Cache Level described in this structure */ + cache_attr |= (hmat_cache->level &0xF ) <<4 ; + +/* Bits [11:8] - Cache Associativity */ + cache_attr |= (hmat_cache->associativity &0xF ) <<8 ; + +/* Bits [15:12] - Write Policy */ + cache_attr |= (hmat_cache->write_policy &0xF ) <<12 ; + +/* Bits [31:16] - Cache Line size in bytes */ + cache_attr |= (hmat_cache->line_size &0xFFFF ) <<16 ; + + cache_attr =cpu_to_le32 (cache_attr); + +/* Type */ +build_append_int_noprefix (table_data,2 ,2 ); +/* Reserved */ +build_append_int_noprefix (table_data,0 ,2 ); +/* Length */ +build_append_int_noprefix (table_data,32 ,4 ); +/* Proximity Domain for the Memory */ +build_append_int_noprefix (table_data, hmat_cache->mem_proximity,4 ); +/* Reserved */ +build_append_int_noprefix (table_data,0 ,4 ); +/* Memory Side Cache Size */ +build_append_int_noprefix (table_data, hmat_cache->size,8 ); +/* Cache Attributes */ +build_append_int_noprefix (table_data, cache_attr,4 ); +/* Reserved */ +build_append_int_noprefix (table_data,0 ,2 ); +/* +* Number of SMBIOS handles (n) +* Linux kernel uses Memory Side Cache Information Structure +* without SMBIOS entries for now, so set Number of SMBIOS handles +* as 0. +*/ +build_append_int_noprefix (table_data,0 ,2 ); +} +/* Build HMAT sub table structures */ static void hmat_build_table_structs (GArray *table_data,NumaState *nstat) {uint16_t flags;uint32_t num_initiator =0 ;uint32_t initiator_pxm[MAX_NODES ]; -int i, hrchy, type; +int i, hrchy, type, level;HMAT_LB_Info *numa_hmat_lb; +HMAT_Cache_Info *numa_hmat_cache;for (i =0 ; i < nstat->num_nodes; i++) { flags =0 ;
@@ -175,6 +224,19 @@ static void hmat_build_table_structs(GArray *table_data, NumaState *nstat) } } } + +/* +* ACPI 6.3: 5.2.27.5 Memory Side Cache Information Structure: +* Table 5-147 +*/ +for (i =0 ; i < nstat->num_nodes; i++) { +for (level =0 ; level <=MAX_HMAT_CACHE_LEVEL ; level++) { + numa_hmat_cache = nstat->hmat_cache[i][level]; +if (numa_hmat_cache) { +build_hmat_cache (table_data, numa_hmat_cache); + } + } + } }void build_hmat (GArray *table_data,BIOSLinker *linker,NumaState *nstat)
hw/acpi/hmat.h +17 -0
@@ -81,6 +81,23 @@ struct HMAT_LB_Info { uint16_t bandwidth[MAX_NODES][MAX_NODES]; }; +struct HMAT_Cache_Info { +/* The memory proximity domain to which the memory belongs. */ +uint32_t mem_proximity; +/* Size of memory side cache in bytes. */ +uint64_t size; +/* Total cache levels for this memory proximity domain. */ +uint8_t total_levels; +/* Cache level described in this structure. */ +uint8_t level; +/* Cache Associativity: None/Direct Mapped/Comple Cache Indexing */ +uint8_t associativity; +/* Write Policy: None/Write Back(WB)/Write Through(WT) */ +uint8_t write_policy; +/* Cache Line size in bytes. */ +uint16_t line_size; +}; +void build_hmat (GArray *table_data,BIOSLinker *linker,NumaState *nstat);#endif
include/qemu/typedefs.h +1 -0
@@ -49,6 +49,7 @@ typedef struct FWCfgEntry FWCfgEntry;typedef struct FWCfgIoState FWCfgIoState ;typedef struct FWCfgMemState FWCfgMemState ;typedef struct FWCfgState FWCfgState ; +typedef struct HMAT_Cache_Info HMAT_Cache_Info ;typedef struct HMAT_LB_Info HMAT_LB_Info ;typedef struct HostMemoryBackend HostMemoryBackend ;typedef struct HVFX86EmulatorState HVFX86EmulatorState ;
include/sysemu/numa.h +5 -0
@@ -35,6 +35,8 @@ enum {#define HMAT_LB_LEVELS (HMAT_LB_MEM_CACHE_3RD_LEVEL + 1)#define HMAT_LB_TYPES (HMAT_LB_DATA_WRITE_BANDWIDTH + 1) +#define MAX_HMAT_CACHE_LEVEL 3 +struct NodeInfo {uint64_t node_mem;struct HostMemoryBackend *node_memdev;
@@ -65,6 +67,9 @@ struct NumaState {/* NUMA modes HMAT Locality Latency and Bandwidth Information */ HMAT_LB_Info *hmat_lb[HMAT_LB_LEVELS ][HMAT_LB_TYPES ]; + +/* Memory Side Cache Information Structure */ +HMAT_Cache_Info *hmat_cache[MAX_NODES ][MAX_HMAT_CACHE_LEVEL +1 ]; };typedef struct NumaState NumaState ;
Signature · 1 line
2.20.1
PATCH v10 9/11 numa: Extend CLI to provide memory latency and bandwidth information
In reply to Tao XuFrom: Liu Jingqi <[email protected]>
Add -numa hmat-lb option to provide System Locality Latency and Bandwidth Information. These memory attributes help to build System Locality Latency and Bandwidth Information Structure(s) in ACPI Heterogeneous Memory Attribute Table (HMAT).
---
Changes in v10:
- use new builtin type 'time' as qapi input.
--- hw/core/numa.c | 164 ++++++++++++++++++++++++++++++++++++++++++ include/sysemu/numa.h | 2 + qapi/machine.json | 95 +++++++++++++++++++++++- qemu-options.hx | 49 ++++++++++++- 4 files changed, 307 insertions(+), 3 deletions(-)
hw/core/numa.c +164 -0
@@ -42,6 +42,7 @@#include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/cutils.h" +#include "hw/acpi/hmat.h" QemuOptsList qemu_numa_opts = { .name ="numa" ,
@@ -186,6 +187,152 @@ void parse_numa_distance(MachineState *ms, NumaDistOptions *dist, Error **errp) ms->numa_state->have_numa_distance = true; } +static uint64_t hmat_get_base (uint64_t lb_data,int unit) +{ +uint64_t base =1 ; + +while (lb_data >=UINT16_MAX &&QEMU_IS_ALIGNED (lb_data, unit)) { + lb_data /= unit; + base *= unit; + } + +if (lb_data <UINT16_MAX ) { +return base; + }else { +return 0 ; + } +} + +void parse_numa_hmat_lb (MachineState *ms,NumaHmatLBOptions *node, +Error **errp) +{ +int nb_numa_nodes = ms->numa_state->num_nodes; +NodeInfo *numa_info = ms->numa_state->nodes; +HMAT_LB_Info *hmat_lb =NULL ; +uint64_t base_lat =0 , base_bw =0 , bw_mb; + +if (node->data_type <=HMATLB_DATA_TYPE_WRITE_LATENCY ) { +if (!node->has_latency) { +error_setg (errp,"Missing 'latency' option." ); +return ; + } +if (node->has_bandwidth) { +error_setg (errp,"Invalid option 'bandwidth' since " +"the data type is latency." ); +return ; + } + } + +if (node->data_type >=HMATLB_DATA_TYPE_ACCESS_BANDWIDTH ) { +if (!node->has_bandwidth) { +error_setg (errp,"Missing 'bandwidth' option." ); +return ; + } +if (node->has_latency) { +error_setg (errp,"Invalid option 'latency' since " +"the data type is bandwidth." ); +return ; + } + } + +if (node->initiator >= nb_numa_nodes) { +error_setg (errp,"Invalid initiator=%" + PRIu16", it should be less than %d." , + node->initiator, nb_numa_nodes); +return ; + } +if (!numa_info[node->initiator].has_cpu) { +error_setg (errp,"Invalid initiator=%" + PRIu16", it isn't an initiator proximity domain." , + node->initiator); +return ; + } + +if (node->target >= nb_numa_nodes) { +error_setg (errp,"Invalid target=%" + PRIu16", it should be less than %d." , + node->target, nb_numa_nodes); +return ; + } +if (!numa_info[node->target].present) { +error_setg (errp,"Invalid target=%" + PRIu16", it hasn't a valid NUMA node." , + node->target); +return ; + } + +if (node->has_latency) { + hmat_lb = ms->numa_state->hmat_lb[node->hierarchy][node->data_type]; + +if (!hmat_lb) { + hmat_lb =g_malloc0 (sizeof (*hmat_lb)); + ms->numa_state->hmat_lb[node->hierarchy][node->data_type] = hmat_lb; + }else if (hmat_lb->latency[node->initiator][node->target]) { +error_setg (errp,"Duplicate configuration of the latency for " +"initiator=%" PRIu16" and target=%" PRIu16"." , + node->initiator, node->target); +return ; + } + + base_lat =hmat_get_base (node->latency,1000 ); +if (base_lat ==0 ) { +error_setg (errp,"Latency value %" PRIu64" overflow, max value" +" is %" PRIu16, node->latency,UINT16_MAX -1 ); +return ; + } + +/* Only the first time of setting the base unit is valid. */ +if (hmat_lb->base_lat ==0 ) { + hmat_lb->base_lat = base_lat; + }else if (hmat_lb->base_lat != base_lat) { +error_setg (errp,"Invalid base latency unit %" PRIu64", all " +"latencies must be specified in the same units." , base_lat); +return ; + } + + hmat_lb->latency[node->initiator][node->target] = + node->latency / base_lat; + } + +if (node->has_bandwidth) { + hmat_lb = ms->numa_state->hmat_lb[node->hierarchy][node->data_type]; + bw_mb = node->bandwidth /1024 /1024 ; + +if (!hmat_lb) { + hmat_lb =g_malloc0 (sizeof (*hmat_lb)); + ms->numa_state->hmat_lb[node->hierarchy][node->data_type] = hmat_lb; + }else if (hmat_lb->bandwidth[node->initiator][node->target]) { +error_setg (errp,"Duplicate configuration of the bandwidth for " +"initiator=%" PRIu16" and target=%" PRIu16"." , + node->initiator, node->target); +return ; + } + + base_bw =hmat_get_base (bw_mb,1024 ); +if (base_bw ==0 ) { +error_setg (errp,"Bandwidth value %" PRIu64" overflow, max value" +" is %" PRIu16, bw_mb,UINT16_MAX -1 ); +return ; + } + +/* Only the first time of setting the base unit is valid. */ +if (hmat_lb->base_bw ==0 ) { + hmat_lb->base_bw = base_bw; + }else if (hmat_lb->base_bw != base_bw) { +error_setg (errp,"Invalid base bandwidth unit %" PRIu64", all " +"bandwidths must be specified in the same units." , base_bw); +return ; + } + + hmat_lb->bandwidth[node->initiator][node->target] = bw_mb; + } + +if (hmat_lb) { + hmat_lb->hierarchy = node->hierarchy; + hmat_lb->data_type = node->data_type; + } +} +void set_numa_options (MachineState *ms,NumaOptions *object,Error **errp) {Error *err =NULL ;
@@ -224,6 +371,12 @@ void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp)machine_set_cpu_numa_node (ms,qapi_NumaCpuOptions_base (&object->u.cpu), &err);break ; +case NUMA_OPTIONS_TYPE_HMAT_LB : +parse_numa_hmat_lb (ms, &object->u.hmat_lb, &err); +if (err) { + goto end; + } +break ;default :abort (); }
@@ -251,6 +404,17 @@ static int parse_numa(void *opaque, QemuOpts *opts, Error **errp)qemu_strtosz_MiB (mem_str,NULL , &object->u.node.mem); } +if (object->type ==NUMA_OPTIONS_TYPE_HMAT_LB ) { +if (object->u.hmat_lb.has_latency) { +const char *lat_str =qemu_opt_get (opts,"latency" ); +qemu_strtotime_ps (lat_str,NULL , &object->u.hmat_lb.latency); + } +if (object->u.hmat_lb.has_bandwidth) { +const char *bw_str =qemu_opt_get (opts,"bandwidth" ); +qemu_strtosz_MiB (bw_str,NULL , &object->u.hmat_lb.bandwidth); + } + } +set_numa_options (ms, object, &err); end:
include/sysemu/numa.h +2 -0
@@ -75,6 +75,8 @@ typedef struct NumaState NumaState;void set_numa_options (MachineState *ms,NumaOptions *object,Error **errp);void parse_numa_opts (MachineState *ms); +void parse_numa_hmat_lb (MachineState *ms,NumaHmatLBOptions *node, +Error **errp);void numa_complete_configuration (MachineState *ms);void query_numa_node_mem (NumaNodeMem node_mem[],MachineState *ms);extern QemuOptsList qemu_numa_opts;
qapi/machine.json +93 -2
116 lines not on this page · raw message
qemu-options.hx +48 -1
70 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH v10 10/11 numa: Extend CLI to provide memory side cache information
In reply to Tao XuFrom: Liu Jingqi <[email protected]>
Add -numa hmat-cache option to provide Memory Side Cache Information. These memory attributes help to build Memory Side Cache Information Structure(s) in ACPI Heterogeneous Memory Attribute Table (HMAT).
---
No changes in v10.
--- hw/core/numa.c | 67 +++++++++++++++++++++++++++++++++++ include/sysemu/numa.h | 2 ++ qapi/machine.json | 81 +++++++++++++++++++++++++++++++++++++++++-- qemu-options.hx | 16 +++++++-- 4 files changed, 162 insertions(+), 4 deletions(-)
hw/core/numa.c +67 -0
@@ -333,6 +333,67 @@ void parse_numa_hmat_lb(MachineState *ms, NumaHmatLBOptions *node, } } +void parse_numa_hmat_cache (MachineState *ms,NumaHmatCacheOptions *node, +Error **errp) +{ +int nb_numa_nodes = ms->numa_state->num_nodes; +HMAT_Cache_Info *hmat_cache =NULL ; + +if (node->node_id >= nb_numa_nodes) { +error_setg (errp,"Invalid node-id=%" PRIu32 +", it should be less than %d." , + node->node_id, nb_numa_nodes); +return ; + } + +if (node->total >MAX_HMAT_CACHE_LEVEL ) { +error_setg (errp,"Invalid total=%" PRIu8 +", it should be less than or equal to %d." , + node->total,MAX_HMAT_CACHE_LEVEL ); +return ; + } +if (node->level > node->total) { +error_setg (errp,"Invalid level=%" PRIu8 +", it should be less than or equal to" +" total=%" PRIu8"." , + node->level, node->total); +return ; + } +if (ms->numa_state->hmat_cache[node->node_id][node->level]) { +error_setg (errp,"Duplicate configuration of the side cache for " +"node-id=%" PRIu32" and level=%" PRIu8"." , + node->node_id, node->level); +return ; + } + +if ((node->level >1 ) && + ms->numa_state->hmat_cache[node->node_id][node->level -1 ] && + (node->size >= + ms->numa_state->hmat_cache[node->node_id][node->level -1 ]->size)) { +error_setg (errp,"Invalid size=0x%" PRIx64 +", the size of level=%" PRIu8 +" should be less than the size(0x%" PRIx64 +") of level=%" PRIu8"." , + node->size, node->level, + ms->numa_state->hmat_cache[node->node_id] + [node->level -1 ]->size, + node->level -1 ); +return ; + } + + hmat_cache =g_malloc0 (sizeof (*hmat_cache)); + + hmat_cache->mem_proximity = node->node_id; + hmat_cache->size = node->size; + hmat_cache->total_levels = node->total; + hmat_cache->level = node->level; + hmat_cache->associativity = node->assoc; + hmat_cache->write_policy = node->policy; + hmat_cache->line_size = node->line; + + ms->numa_state->hmat_cache[node->node_id][node->level] = hmat_cache; +} +void set_numa_options (MachineState *ms,NumaOptions *object,Error **errp) {Error *err =NULL ;
@@ -377,6 +438,12 @@ void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp) goto end; }break ; +case NUMA_OPTIONS_TYPE_HMAT_CACHE : +parse_numa_hmat_cache (ms, &object->u.hmat_cache, &err); +if (err) { + goto end; + } +break ;default :abort (); }
include/sysemu/numa.h +2 -0
@@ -77,6 +77,8 @@ void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp);void parse_numa_opts (MachineState *ms);void parse_numa_hmat_lb (MachineState *ms,NumaHmatLBOptions *node,Error **errp); +void parse_numa_hmat_cache (MachineState *ms,NumaHmatCacheOptions *node, +Error **errp);void numa_complete_configuration (MachineState *ms);void query_numa_node_mem (NumaNodeMem node_mem[],MachineState *ms);extern QemuOptsList qemu_numa_opts;
qapi/machine.json +79 -2
102 lines not on this page · raw message
qemu-options.hx +14 -2
@@ -169,7 +169,8 @@ DEF("numa", HAS_ARG, QEMU_OPTION_numa, "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" "-numa dist,src=source,dst=destination,val=distance\n" "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n" - "-numa hmat-lb,initiator=node,target=node,hierarchy=memory|first-level|second-level|third-level,data-type=access-latency|read-latency|write-latency[,latency=lat][,bandwidth=bw]\n", + "-numa hmat-lb,initiator=node,target=node,hierarchy=memory|first-level|second-level|third-level,data-type=access-latency|read-latency|write-latency[,latency=lat][,bandwidth=bw]\n" + "-numa hmat-cache,node-id=node,size=size,total=total,level=level[,assoc=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n", QEMU_ARCH_ALL) STEXI @item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}]
@@ -177,6 +178,7 @@ STEXI @itemx -numa dist,src=@var{source},dst=@var{destination},val=@var{distance} @itemx -numa cpu,node-id=@var{node}[,socket-id=@var{x}][,core-id=@var{y}][,thread-id=@var{z}] @itemx -numa hmat-lb,initiator=@var{node},target=@var{node},hierarchy=@var{str},data-type=@var{str}[,latency=@var{lat}][,bandwidth=@var{bw}] +@itemx -numa hmat-cache,node-id=@var{node},size=@var{size},total=@var{total},level=@var{level}[,assoc=@var{str}][,policy=@var{str}][,line=@var{size}] @findex -numa Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA distance from a source node to a destination node.
@@ -282,11 +284,19 @@ if NUM is 0, means the corresponding latency or bandwidth information is not pro And if input numbers without any unit, the latency unit will be 'ps' and the bandwidth will be MB/s. +In @samp{hmat-cache} option, @var{node-id} is the NUMA-id of the memory belongs. +@var{size} is the size of memory side cache in bytes. @var{total} is the total cache levels. +@var{level} is the cache level described in this structure. @var{assoc} is the cache associativity, +the possible value is 'none/direct(direct-mapped)/complex(complex cache indexing)'. +@var{policy} is the write policy. @var{line} is the cache Line size in bytes. + For example, the following option assigns NUMA node 0 and 1. Node 0 has 2 cpus and a ram, node 1 has only a ram. The processors in node 0 access memory in node 0 with access-latency 5 nanoseconds, access-bandwidth is 200 MB/s; The processors in NUMA node 0 access memory in NUMA node 1 with access-latency 10 nanoseconds, access-bandwidth is 100 MB/s. +And for memory side cache information, NUMA node 0 and 1 both have 1 level memory +cache, size is 0x20000 bytes, policy is write-back, the cache Line size is 8 bytes: @example -machine hmat=on \ -m 2G \
@@ -300,7 +310,9 @@ nanoseconds, access-bandwidth is 100 MB/s. -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5ns \ -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \ -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10ns \ --numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M +-numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \ +-numa hmat-cache,node-id=0,size=0x20000,total=1,level=1,assoc=direct,policy=write-back,line=8 \ +-numa hmat-cache,node-id=1,size=0x20000,total=1,level=1,assoc=direct,policy=write-back,line=8 @end example ETEXI
Signature · 1 line
2.20.1
PATCH v10 11/11 tests/bios-tables-test: add test cases for ACPI HMAT
In reply to Tao XuACPI table HMAT has been introduced, QEMU now builds HMAT tables for Heterogeneous Memory with boot option '-numa node'.
Add test cases on PC and Q35 machines with 2 numa nodes. Because HMAT is generated when system enable numa, the following tables need to be added for this test:
tests/acpi-test-data/pc/*.acpihmat tests/acpi-test-data/pc/HMAT.* tests/acpi-test-data/q35/*.acpihmat tests/acpi-test-data/q35/HMAT.*
---
Changes in v10:
- Update test case, add "-machine hmat=on"
--- tests/bios-tables-test.c | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+)
tests/bios-tables-test.c +44 -0
@@ -871,6 +871,48 @@ static void test_acpi_piix4_tcg_dimm_pxm(void)test_acpi_tcg_dimm_pxm (MACHINE_PC ); } +static void test_acpi_tcg_acpi_hmat (const char *machine) +{ +test_data data; + +memset (&data,0 ,sizeof (data)); + data.machine = machine; + data.variant =".acpihmat" ; +test_acpi_one (" -machine hmat=on" +" -smp 2,sockets=2" +" -m 128M,slots=2,maxmem=1G" +" -object memory-backend-ram,size=64M,id=m0" +" -object memory-backend-ram,size=64M,id=m1" +" -numa node,nodeid=0,memdev=m0" +" -numa node,nodeid=1,memdev=m1,initiator=0" +" -numa cpu,node-id=0,socket-id=0" +" -numa cpu,node-id=0,socket-id=1" +" -numa hmat-lb,initiator=0,target=0,hierarchy=memory," +"data-type=access-latency,latency=5ns" +" -numa hmat-lb,initiator=0,target=0,hierarchy=memory," +"data-type=access-bandwidth,bandwidth=500M" +" -numa hmat-lb,initiator=0,target=1,hierarchy=memory," +"data-type=access-latency,latency=10ns" +" -numa hmat-lb,initiator=0,target=1,hierarchy=memory," +"data-type=access-bandwidth,bandwidth=100M" +" -numa hmat-cache,node-id=0,size=0x20000,total=1,level=1" +",assoc=direct,policy=write-back,line=8" +" -numa hmat-cache,node-id=1,size=0x20000,total=1,level=1" +",assoc=direct,policy=write-back,line=8" , + &data); +free_test_data (&data); +} + +static void test_acpi_q35_tcg_acpi_hmat (void ) +{ +test_acpi_tcg_acpi_hmat (MACHINE_Q35 ); +} + +static void test_acpi_piix4_tcg_acpi_hmat (void ) +{ +test_acpi_tcg_acpi_hmat (MACHINE_PC ); +} +static void test_acpi_virt_tcg (void ) {test_data data = {
@@ -915,6 +957,8 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/q35/numamem" , test_acpi_q35_tcg_numamem);qtest_add_func ("acpi/piix4/dimmpxm" , test_acpi_piix4_tcg_dimm_pxm);qtest_add_func ("acpi/q35/dimmpxm" , test_acpi_q35_tcg_dimm_pxm); +qtest_add_func ("acpi/piix4/acpihmat" , test_acpi_piix4_tcg_acpi_hmat); +qtest_add_func ("acpi/q35/acpihmat" , test_acpi_q35_tcg_acpi_hmat); }else if (strcmp (arch,"aarch64" ) ==0 ) {qtest_add_func ("acpi/virt" , test_acpi_virt_tcg); }
Signature · 1 line
2.20.1