From nobody Tue Jun 23 16:28:03 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gl9V13R0mz6hhL6 for ; Tue, 23 Jun 2026 16:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gl9V10wVhz3MGW for ; Tue, 23 Jun 2026 16:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782232089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2BbuXWg3p7uuO1cj7AiYy1GafYG9K3Lh9QBV5Br0AJE=; b=yH5mVxV4kfAqGBMupfgYALT1AXk4yvNdebh6JquO9zL2+B6G+tUDx5RwjOKTYAt/6CkEcm pWMgWjvg8ZTErFAlkBq2CjEujNdA+4ZI7YAAtsyl/61zq7AXojOHgXFXjL/M0bVWKIU/wz mbmXLQmvLnG6nZ20OwsRhsNL44DCj32RwBKwJcpCaXqN0Mx9C0kmNI6Vf73Jg+v6AKEkVC 6Sp2Qzw986SAyR42CB3p0VKykiqA10Mp6gCvApqMwTkoKCQT7QRxT2nawT+tNqjkfjcVWf XjfMLQzTHm0QY4dOJDQMmNQSft5PVEIBAscEVRN18CEtfTC/8QQqmrDNdB9uzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782232089; a=rsa-sha256; cv=none; b=l12t9tKrwQXxPefV/0P1/wA5i2PDji+2O04FkaBzM+1bv2ga53KmNkW7icbIPzCiXMWmJ9 ErI2wxps28HiNVi9viNqU6haJCKXoL/0C4vAcR221XGZiGNLjswbyd0fqIje5KNP3wbgSj bXvsaNgrHz5H04JzAFuJ+lG3SpkK2E5QDESCdY5lXYjOyD0JOyFoCbRdZQKwhB3lzQt6P8 HQQreCICiVq0EReAJrNXSZfkrH5WjxpL/NDNf7UcMTEVQXCij9GKrWO8YRJhy7svDujaWW P+cvXo/FOeHB+bhxMu15sLvu5ZAm3hs+fPLRkLUFryltxM+GoVbtW1ReKKGkCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782232089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2BbuXWg3p7uuO1cj7AiYy1GafYG9K3Lh9QBV5Br0AJE=; b=h3XAkA+qwy9646ZP/OcJ1f8bb1iDiz62dV+8s56c9NPjh6+LFlL9nETv5SnRiy0pV/EXZ1 k2dmp8D/4d2XIW2iW/V7FFn086OiUWUfjWyqBEAc1Kj6yEI9kZky+hhvHb3sGV/0FdwNKD 5CW+WpB3b+vejD1I9yVT9B3idu+0KGoOVcwC8G/38Bf6EcB8KkLSa5QzdP87fjv0WRt2T7 QEvJgn4a3bLHrEDJyFh5ofU68hvXapkXMoKnMlKpCr7T1Rg73T8FrTEoQ+9Wu3mXJnji/F 5hlrLtDrPAlKQ4u2f4f7OHycWbmQjyVOjtlVwZN1TZGAqhwtE8Yr+CMLQRA8Qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gl9V06dqBzhlx for ; Tue, 23 Jun 2026 16:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24bd8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 23 Jun 2026 16:28:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ff44fba2e951 - stable/15 - acpidump: Extend the decoding of entries in the EINJ and ERST tables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ff44fba2e95147068e16e3de8d67bc838729d1a8 Auto-Submitted: auto-generated Date: Tue, 23 Jun 2026 16:28:03 +0000 Message-Id: <6a3ab413.24bd8.12926285@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ff44fba2e95147068e16e3de8d67bc838729d1a8 commit ff44fba2e95147068e16e3de8d67bc838729d1a8 Author: John Baldwin AuthorDate: 2025-12-26 15:35:59 +0000 Commit: John Baldwin CommitDate: 2026-06-23 15:57:28 +0000 acpidump: Extend the decoding of entries in the EINJ and ERST tables - Decode the Action, Instruction, and Flags fields for these tables - Omit the Flags field if it is zero - Omit the Value field for instrunctions that do not use it Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54308 (cherry picked from commit 6b2e4da4430029b16591c64aaef78bcd1644cedc) --- usr.sbin/acpi/acpidump/acpi.c | 206 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 193 insertions(+), 13 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 026795118832..0b125b5591ba 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -623,16 +623,89 @@ acpi_handle_bert(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); } +static const char * +einj_action(UINT8 Action) +{ + static char buf[32]; + +#define ACTION(name) \ + case __CONCAT(ACPI_EINJ_, name): \ + return (__STRING(name)) +#define ACTIONV2(name) \ + case __CONCAT(ACPI_EINJV2_, name): \ + return (__XSTRING(__CONCAT(V2_, name))) + + switch (Action) { + ACTION(BEGIN_OPERATION); + ACTION(GET_TRIGGER_TABLE); + ACTION(SET_ERROR_TYPE); + ACTION(GET_ERROR_TYPE); + ACTION(END_OPERATION); + ACTION(EXECUTE_OPERATION); + ACTION(CHECK_BUSY_STATUS); + ACTION(GET_COMMAND_STATUS); + ACTION(SET_ERROR_TYPE_WITH_ADDRESS); + ACTION(GET_EXECUTE_TIMINGS); + ACTIONV2(GET_ERROR_TYPE); + ACTION(TRIGGER_ERROR); + default: + snprintf(buf, sizeof(buf), "UNKNOWN (%#x)", Action); + return (buf); + } + +#undef ACTION +#undef ACTIONV2 +} + +static const char * +einj_instruction(UINT8 Instruction) +{ + static char buf[32]; + +#define INSTRUCTION(name) \ + case __CONCAT(ACPI_EINJ_, name): \ + return (__STRING(name)) + + switch (Instruction) { + INSTRUCTION(READ_REGISTER); + INSTRUCTION(READ_REGISTER_VALUE); + INSTRUCTION(WRITE_REGISTER); + INSTRUCTION(WRITE_REGISTER_VALUE); + INSTRUCTION(NOOP); + INSTRUCTION(FLUSH_CACHELINE); + default: + snprintf(buf, sizeof(buf), "UNKNOWN (%#x)", Instruction); + return (buf); + } + +#undef INSTRUCTION +} + static void -acpi_print_whea(ACPI_WHEA_HEADER *w) +acpi_print_einj_entry(ACPI_EINJ_ENTRY *entry) { + ACPI_WHEA_HEADER *w = &entry->WheaHeader; - printf("\n\tAction=%d\n", w->Action); - printf("\tInstruction=%d\n", w->Instruction); - printf("\tFlags=%02x\n", w->Flags); + printf("\n\tAction=%s\n", einj_action(w->Action)); + printf("\tInstruction=%s\n", einj_instruction(w->Instruction)); + if (w->Flags != 0) { + printf("\tFlags=%02x", w->Flags); + if (w->Flags & 0x1) + printf(""); + printf("\n"); + } printf("\tRegisterRegion="); acpi_print_gas(&w->RegisterRegion); - printf("\n\tValue=0x%016jx\n", w->Value); + printf("\n"); + switch (w->Instruction) { + case ACPI_EINJ_READ_REGISTER: + case ACPI_EINJ_WRITE_REGISTER: + case ACPI_EINJ_NOOP: + case ACPI_EINJ_FLUSH_CACHELINE: + break; + default: + printf("\tValue=0x%016jx\n", w->Value); + } printf("\tMask=0x%016jx\n", w->Mask); } @@ -640,7 +713,7 @@ static void acpi_handle_einj(ACPI_TABLE_HEADER *sdp) { ACPI_TABLE_EINJ *einj; - ACPI_WHEA_HEADER *w; + ACPI_EINJ_ENTRY *w; u_int i; printf(BEGIN_COMMENT); @@ -649,18 +722,125 @@ acpi_handle_einj(ACPI_TABLE_HEADER *sdp) printf("\tHeaderLength=%d\n", einj->HeaderLength); printf("\tFlags=0x%02x\n", einj->Flags); printf("\tEntries=%d\n", einj->Entries); - w = (ACPI_WHEA_HEADER *)(einj + 1); + w = (ACPI_EINJ_ENTRY *)(einj + 1); for (i = 0; i < MIN(einj->Entries, (sdp->Length - - sizeof(ACPI_TABLE_EINJ)) / sizeof(ACPI_WHEA_HEADER)); i++) - acpi_print_whea(w + i); + sizeof(ACPI_TABLE_EINJ)) / sizeof(ACPI_EINJ_ENTRY)); i++) + acpi_print_einj_entry(w + i); printf(END_COMMENT); } +static const char * +erst_action(UINT8 Action) +{ + static char buf[32]; + +#define ACTION(name) \ + case __CONCAT(ACPI_ERST_, name): \ + return (__STRING(name)) + + switch (Action) { + ACTION(BEGIN_WRITE); + ACTION(BEGIN_READ); + ACTION(BEGIN_CLEAR); + ACTION(END); + ACTION(SET_RECORD_OFFSET); + ACTION(EXECUTE_OPERATION); + ACTION(CHECK_BUSY_STATUS); + ACTION(GET_COMMAND_STATUS); + ACTION(GET_RECORD_ID); + ACTION(SET_RECORD_ID); + ACTION(GET_RECORD_COUNT); + ACTION(BEGIN_DUMMY_WRIITE); + ACTION(GET_ERROR_RANGE); + ACTION(GET_ERROR_LENGTH); + ACTION(GET_ERROR_ATTRIBUTES); + ACTION(EXECUTE_TIMINGS); + default: + snprintf(buf, sizeof(buf), "UNKNOWN (%#x)", Action); + return (buf); + } + +#undef ACTION +} + +static const char * +erst_instruction(UINT8 Instruction) +{ + static char buf[32]; + +#define INSTRUCTION(name) \ + case __CONCAT(ACPI_ERST_, name): \ + return (__STRING(name)) + + switch (Instruction) { + INSTRUCTION(READ_REGISTER); + INSTRUCTION(READ_REGISTER_VALUE); + INSTRUCTION(WRITE_REGISTER); + INSTRUCTION(WRITE_REGISTER_VALUE); + INSTRUCTION(NOOP); + INSTRUCTION(LOAD_VAR1); + INSTRUCTION(LOAD_VAR2); + INSTRUCTION(STORE_VAR1); + INSTRUCTION(ADD); + INSTRUCTION(SUBTRACT); + INSTRUCTION(ADD_VALUE); + INSTRUCTION(SUBTRACT_VALUE); + INSTRUCTION(STALL); + INSTRUCTION(STALL_WHILE_TRUE); + INSTRUCTION(SKIP_NEXT_IF_TRUE); + INSTRUCTION(GOTO); + INSTRUCTION(SET_SRC_ADDRESS_BASE); + INSTRUCTION(SET_DST_ADDRESS_BASE); + INSTRUCTION(MOVE_DATA); + default: + snprintf(buf, sizeof(buf), "UNKNOWN (%#x)", Instruction); + return (buf); + } + +#undef INSTRUCTION +} + +static void +acpi_print_erst_entry(ACPI_ERST_ENTRY *entry) +{ + ACPI_WHEA_HEADER *w = &entry->WheaHeader; + + printf("\n\tAction=%s\n", erst_action(w->Action)); + printf("\tInstruction=%s\n", erst_instruction(w->Instruction)); + if (w->Flags != 0) { + printf("\tFlags=%02x", w->Flags); + if (w->Flags & 0x1) + printf(""); + printf("\n"); + } + printf("\tRegisterRegion="); + acpi_print_gas(&w->RegisterRegion); + printf("\n"); + switch (w->Instruction) { + case ACPI_ERST_READ_REGISTER: + case ACPI_ERST_WRITE_REGISTER: + case ACPI_ERST_NOOP: + case ACPI_ERST_LOAD_VAR1: + case ACPI_ERST_LOAD_VAR2: + case ACPI_ERST_STORE_VAR1: + case ACPI_ERST_ADD: + case ACPI_ERST_SUBTRACT: + case ACPI_ERST_SET_SRC_ADDRESS_BASE: + case ACPI_ERST_SET_DST_ADDRESS_BASE: + case ACPI_ERST_MOVE_DATA: + break; + default: + printf("\tValue=0x%016jx\n", w->Value); + break; + } + printf("\tMask=0x%016jx\n", w->Mask); +} + static void acpi_handle_erst(ACPI_TABLE_HEADER *sdp) { ACPI_TABLE_ERST *erst; - ACPI_WHEA_HEADER *w; + ACPI_ERST_ENTRY *w; u_int i; printf(BEGIN_COMMENT); @@ -668,10 +848,10 @@ acpi_handle_erst(ACPI_TABLE_HEADER *sdp) erst = (ACPI_TABLE_ERST *)sdp; printf("\tHeaderLength=%d\n", erst->HeaderLength); printf("\tEntries=%d\n", erst->Entries); - w = (ACPI_WHEA_HEADER *)(erst + 1); + w = (ACPI_ERST_ENTRY *)(erst + 1); for (i = 0; i < MIN(erst->Entries, (sdp->Length - - sizeof(ACPI_TABLE_ERST)) / sizeof(ACPI_WHEA_HEADER)); i++) - acpi_print_whea(w + i); + sizeof(ACPI_TABLE_ERST)) / sizeof(ACPI_ERST_ENTRY)); i++) + acpi_print_erst_entry(w + i); printf(END_COMMENT); }