From 9c96bfe773c0e7091b7dcec7a3daf35a28800190 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Fri, 16 Sep 2016 20:16:07 +0000 Subject: Suppress debugging output about CSD entries that say nothing we care about and improve the output for those we might. output examples from mikeb@ ok kettenis@ --- sys/dev/acpi/acpicpu.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'sys/dev/acpi') diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c index dc5e5329f2c..1a9bc4ae67d 100644 --- a/sys/dev/acpi/acpicpu.c +++ b/sys/dev/acpi/acpicpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpicpu.c,v 1.76 2016/09/02 13:59:51 pirofti Exp $ */ +/* $OpenBSD: acpicpu.c,v 1.77 2016/09/16 20:16:06 guenther Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * Copyright (c) 2015 Philip Guenther @@ -94,6 +94,10 @@ void acpicpu_setperf_ppc_change(struct acpicpu_pss *, int); #define ACPI_MAX_C2_LATENCY 100 #define ACPI_MAX_C3_LATENCY 1000 +#define CSD_COORD_SW_ALL 0xFC +#define CSD_COORD_SW_ANY 0xFD +#define CSD_COORD_HW_ALL 0xFE + /* Make sure throttling bits are valid,a=addr,o=offset,w=width */ #define valid_throttle(o,w,a) (a && w && (o+w)<=31 && (o>4 || (o+w)<=4)) @@ -467,21 +471,36 @@ acpicpu_add_cstatepkg(struct aml_value *val, void *arg) void acpicpu_add_cdeppkg(struct aml_value *val, void *arg) { + int64_t num_proc, coord_type, domain, cindex; + + /* + * errors: unexpected object type, bad length, mismatched length, + * and bad CSD revision + */ + if (val->type != AML_OBJTYPE_PACKAGE || val->length < 6 || + val->length != val->v_package[0]->v_integer || + val->v_package[1]->v_integer != 0) { #if 1 || defined(ACPI_DEBUG) && !defined(SMALL_KERNEL) - aml_showvalue(val); + aml_showvalue(val); #endif - if (val->type != AML_OBJTYPE_PACKAGE || val->length < 6 || - val->length != val->v_package[0]->v_integer) { printf("bogus CSD\n"); return; } - printf("\nCSD r=%lld d=%lld c=%llx n=%lld i=%lli\n", - val->v_package[1]->v_integer, - val->v_package[2]->v_integer, - val->v_package[3]->v_integer, - val->v_package[4]->v_integer, - val->v_package[5]->v_integer); + /* coordinating 'among' one CPU is trivial, ignore */ + num_proc = val->v_package[4]->v_integer; + if (num_proc == 1) + return; + + /* we practically assume the hardware will coordinate, so ignore */ + coord_type = val->v_package[3]->v_integer; + if (coord_type == CSD_COORD_HW_ALL) + return; + + domain = val->v_package[2]->v_integer; + cindex = val->v_package[5]->v_integer; + printf("\nCSD c=%#llx d=%lld n=%lld i=%lli\n", + coord_type, domain, num_proc, cindex); } int -- cgit v1.2.3