From nobody Tue Feb 10 15:01:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1714465780; cv=none; d=zohomail.com; s=zohoarc; b=XbqODY2FL2jjAkkWncHb1ZxDpI37+BBDXOl1SqaDyz9Xc5ZSAxB5WcGmYpx8ESVEbOjPY1evrU5MVcHC7KvzN+l7yIkJdSMoaGh354kdRItnPxL2QlNxFQ1SRWugVlt0ba21L0vgeOJ26Qqrlhz38oYWnWc5UZCX9GJ2TAmqzjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1714465780; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3Krvu4Zj4QowNkkBd0qb5SJ6EGBkyvRPSArlL+RTPpo=; b=DfczHbiraHMDpbFaZjtxN6ieWEqAeWmmT+0BZ9s37ymBRcm7Xr1b99qQL8U4zll/pyP53X8Ir9p6x9PjliFce8xAFK9JLUPfRMCCuxkkcZNcfpp19cvcWap7zljAx3mJNy5DpnL1/1GtZt2GRoKrCJJk/OdteRcLAtaAbEjmmnM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1714465780772678.740526943851; Tue, 30 Apr 2024 01:29:40 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.714617.1115884 (Exim 4.92) (envelope-from ) id 1s1irP-0006Ms-8S; Tue, 30 Apr 2024 08:29:11 +0000 Received: by outflank-mailman (output) from mailman id 714617.1115884; Tue, 30 Apr 2024 08:29:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s1irP-0006Ml-5A; Tue, 30 Apr 2024 08:29:11 +0000 Received: by outflank-mailman (input) for mailman id 714617; Tue, 30 Apr 2024 08:29:09 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s1irN-0006Md-8o for xen-devel@lists.xenproject.org; Tue, 30 Apr 2024 08:29:09 +0000 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [2607:f8b0:4864:20::831]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b58cb653-06cb-11ef-909b-e314d9c70b13; Tue, 30 Apr 2024 10:29:07 +0200 (CEST) Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-43716ff5494so57380941cf.0 for ; Tue, 30 Apr 2024 01:29:07 -0700 (PDT) Received: from localhost ([213.195.114.223]) by smtp.gmail.com with ESMTPSA id do7-20020a05622a478700b0043999fccc10sm8370941qtb.62.2024.04.30.01.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:29:04 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b58cb653-06cb-11ef-909b-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1714465745; x=1715070545; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3Krvu4Zj4QowNkkBd0qb5SJ6EGBkyvRPSArlL+RTPpo=; b=QFrlrI3Ragkg/C6e+RDBjOqR92LejgP9yhoX57WwINKDCALnwRZvK/AUOL7ttXwrso gXXz2X0OxMgPsc/Adc79YZaBVOwQaX0RG9tYVeGL6gwPG/h24aE+EgmkgrLm3yK7cMbn 32HDxbA6M6KErcvdY1yBNpSmTJGCtjM2QoDkM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714465745; x=1715070545; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3Krvu4Zj4QowNkkBd0qb5SJ6EGBkyvRPSArlL+RTPpo=; b=iOUgAvGXp2FXfK+hAubixE8a9QTUrJBgFfljlkZZTkdRQBYM5dNXdjFNCsGVF5L5jl m/Map1YT5IdtfQ7u7mYj58tz8A9Ovt0Ut9fna9+LNloYnqZZz2YOwGpSq/n9p82TjkVs 6SdaPAax2vYFvh9q1bt68+4AkwRohz5i4RAOraWJ7KT2iTITDArYTWN+vZlkUa3ELcql psPmeWJ2Ut/AGKM9t+6O8K7bL3VjVYpUxyrKuEcBkF42q8wS3tBPGlYUg6DSaGfUO1od vyGdPFD00w8BrXHcvZpH1S2DPOfSwTROTlQCxVtqL+tSVMXwhNUbQPmqnz35RRa66dwl FkWg== X-Gm-Message-State: AOJu0YyvBsTbxKr8UGrFePoF9SL1MB1IQLc8iy00/Oo7vOW7IgmQ1sty M5Z8C73TFtg1HIw6UFJ1LNyRZH1SJ/G1D0pH4KSwp8oZyOQqUDc5ltcRb0YJchah6ICwQi2m1oy G X-Google-Smtp-Source: AGHT+IHEpNACdYX24W17tpmcWW4uipDpgji8DhuKWFFXsLVhoK8dH4wfAbIlOw1KBD1Plubpw14xkg== X-Received: by 2002:a05:622a:59c6:b0:43a:ccb4:ea5e with SMTP id gc6-20020a05622a59c600b0043accb4ea5emr4365744qtb.6.1714465745073; Tue, 30 Apr 2024 01:29:05 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper , Anthony PERARD Subject: [PATCH] tools/xen-cpuid: switch to use cpu-policy defined names Date: Tue, 30 Apr 2024 10:29:01 +0200 Message-ID: <20240430082901.77662-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1714465782391100001 Like it was done recently for libxl, switch to using the auto-generated fea= ture names by the processing of cpufeatureset.h, this allows removing the open-c= oded feature names, and unifies the feature naming with libxl and the hypervisor. Note that leaf names need to be kept, as the current auto-generated data doesn't contain the leaf names. Signed-off-by: Roger Pau Monn=C3=A9 --- Late for 4.19, but I would still like it to be considered for inclusion sin= ce it's IMO a nice cleanup and reduces the burden of adding new feature bits i= nto the policy. --- tools/misc/xen-cpuid.c | 336 +++++++---------------------------------- 1 file changed, 51 insertions(+), 285 deletions(-) diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c index 8893547bebce..ab5d88472cf1 100644 --- a/tools/misc/xen-cpuid.c +++ b/tools/misc/xen-cpuid.c @@ -12,282 +12,33 @@ =20 #include =20 -static uint32_t nr_features; - -static const char *const str_1d[32] =3D -{ - [ 0] =3D "fpu", [ 1] =3D "vme", - [ 2] =3D "de", [ 3] =3D "pse", - [ 4] =3D "tsc", [ 5] =3D "msr", - [ 6] =3D "pae", [ 7] =3D "mce", - [ 8] =3D "cx8", [ 9] =3D "apic", - /* [10] */ [11] =3D "sysenter", - [12] =3D "mtrr", [13] =3D "pge", - [14] =3D "mca", [15] =3D "cmov", - [16] =3D "pat", [17] =3D "pse36", - [18] =3D "psn", [19] =3D "clflush", - /* [20] */ [21] =3D "ds", - [22] =3D "acpi", [23] =3D "mmx", - [24] =3D "fxsr", [25] =3D "sse", - [26] =3D "sse2", [27] =3D "ss", - [28] =3D "htt", [29] =3D "tm", - [30] =3D "ia64", [31] =3D "pbe", -}; - -static const char *const str_1c[32] =3D -{ - [ 0] =3D "sse3", [ 1] =3D "pclmulqdq", - [ 2] =3D "dtes64", [ 3] =3D "monitor", - [ 4] =3D "ds-cpl", [ 5] =3D "vmx", - [ 6] =3D "smx", [ 7] =3D "est", - [ 8] =3D "tm2", [ 9] =3D "ssse3", - [10] =3D "cntx-id", [11] =3D "sdgb", - [12] =3D "fma", [13] =3D "cx16", - [14] =3D "xtpr", [15] =3D "pdcm", - /* [16] */ [17] =3D "pcid", - [18] =3D "dca", [19] =3D "sse41", - [20] =3D "sse42", [21] =3D "x2apic", - [22] =3D "movebe", [23] =3D "popcnt", - [24] =3D "tsc-dl", [25] =3D "aesni", - [26] =3D "xsave", [27] =3D "osxsave", - [28] =3D "avx", [29] =3D "f16c", - [30] =3D "rdrnd", [31] =3D "hyper", -}; - -static const char *const str_e1d[32] =3D -{ - [ 0] =3D "fpu", [ 1] =3D "vme", - [ 2] =3D "de", [ 3] =3D "pse", - [ 4] =3D "tsc", [ 5] =3D "msr", - [ 6] =3D "pae", [ 7] =3D "mce", - [ 8] =3D "cx8", [ 9] =3D "apic", - /* [10] */ [11] =3D "syscall", - [12] =3D "mtrr", [13] =3D "pge", - [14] =3D "mca", [15] =3D "cmov", - [16] =3D "fcmov", [17] =3D "pse36", - /* [18] */ [19] =3D "mp", - [20] =3D "nx", /* [21] */ - [22] =3D "mmx+", [23] =3D "mmx", - [24] =3D "fxsr", [25] =3D "fxsr+", - [26] =3D "pg1g", [27] =3D "rdtscp", - /* [28] */ [29] =3D "lm", - [30] =3D "3dnow+", [31] =3D "3dnow", -}; - -static const char *const str_e1c[32] =3D -{ - [ 0] =3D "lahf-lm", [ 1] =3D "cmp", - [ 2] =3D "svm", [ 3] =3D "extapic", - [ 4] =3D "cr8d", [ 5] =3D "lzcnt", - [ 6] =3D "sse4a", [ 7] =3D "msse", - [ 8] =3D "3dnowpf", [ 9] =3D "osvw", - [10] =3D "ibs", [11] =3D "xop", - [12] =3D "skinit", [13] =3D "wdt", - /* [14] */ [15] =3D "lwp", - [16] =3D "fma4", [17] =3D "tce", - /* [18] */ [19] =3D "nodeid", - /* [20] */ [21] =3D "tbm", - [22] =3D "topoext", [23] =3D "perfctr-core", - [24] =3D "perfctr-nb", /* [25] */ - [26] =3D "dbx", [27] =3D "perftsc", - [28] =3D "pcx-l2i", [29] =3D "monitorx", - [30] =3D "addr-msk-ext", -}; - -static const char *const str_7b0[32] =3D -{ - [ 0] =3D "fsgsbase", [ 1] =3D "tsc-adj", - [ 2] =3D "sgx", [ 3] =3D "bmi1", - [ 4] =3D "hle", [ 5] =3D "avx2", - [ 6] =3D "fdp-exn", [ 7] =3D "smep", - [ 8] =3D "bmi2", [ 9] =3D "erms", - [10] =3D "invpcid", [11] =3D "rtm", - [12] =3D "pqm", [13] =3D "depfpp", - [14] =3D "mpx", [15] =3D "pqe", - [16] =3D "avx512f", [17] =3D "avx512dq", - [18] =3D "rdseed", [19] =3D "adx", - [20] =3D "smap", [21] =3D "avx512-ifma", - [22] =3D "pcommit", [23] =3D "clflushopt", - [24] =3D "clwb", [25] =3D "proc-trace", - [26] =3D "avx512pf", [27] =3D "avx512er", - [28] =3D "avx512cd", [29] =3D "sha", - [30] =3D "avx512bw", [31] =3D "avx512vl", -}; - -static const char *const str_Da1[32] =3D -{ - [ 0] =3D "xsaveopt", [ 1] =3D "xsavec", - [ 2] =3D "xgetbv1", [ 3] =3D "xsaves", -}; - -static const char *const str_7c0[32] =3D -{ - [ 0] =3D "prefetchwt1", [ 1] =3D "avx512-vbmi", - [ 2] =3D "umip", [ 3] =3D "pku", - [ 4] =3D "ospke", [ 5] =3D "waitpkg", - [ 6] =3D "avx512-vbmi2", [ 7] =3D "cet-ss", - [ 8] =3D "gfni", [ 9] =3D "vaes", - [10] =3D "vpclmulqdq", [11] =3D "avx512-vnni", - [12] =3D "avx512-bitalg", - [14] =3D "avx512-vpopcntdq", - - [22] =3D "rdpid", - /* 24 */ [25] =3D "cldemote", - /* 26 */ [27] =3D "movdiri", - [28] =3D "movdir64b", [29] =3D "enqcmd", - [30] =3D "sgx-lc", [31] =3D "pks", -}; - -static const char *const str_e7d[32] =3D -{ - /* 6 */ [ 7] =3D "hw-pstate", - [ 8] =3D "itsc", [ 9] =3D "cpb", - [10] =3D "efro", -}; - -static const char *const str_e8b[32] =3D -{ - [ 0] =3D "clzero", - [ 2] =3D "rstr-fp-err-ptrs", - - /* [ 8] */ [ 9] =3D "wbnoinvd", - - [12] =3D "ibpb", - [14] =3D "ibrs", [15] =3D "amd-stibp", - [16] =3D "ibrs-always", [17] =3D "stibp-always", - [18] =3D "ibrs-fast", [19] =3D "ibrs-same-mode", - - [20] =3D "no-lmsl", - /* [22] */ [23] =3D "ppin", - [24] =3D "amd-ssbd", [25] =3D "virt-ssbd", - [26] =3D "ssb-no", - [28] =3D "psfd", [29] =3D "btc-no", - [30] =3D "ibpb-ret", -}; - -static const char *const str_7d0[32] =3D -{ - [ 2] =3D "avx512-4vnniw", [ 3] =3D "avx512-4fmaps", - [ 4] =3D "fsrm", - - [ 8] =3D "avx512-vp2intersect", [ 9] =3D "srbds-ctrl", - [10] =3D "md-clear", [11] =3D "rtm-always-abort", - /* 12 */ [13] =3D "tsx-force-abort", - [14] =3D "serialize", [15] =3D "hybrid", - [16] =3D "tsxldtrk", - [18] =3D "pconfig", - [20] =3D "cet-ibt", - /* 22 */ [23] =3D "avx512-fp16", - - [26] =3D "ibrsb", [27] =3D "stibp", - [28] =3D "l1d-flush", [29] =3D "arch-caps", - [30] =3D "core-caps", [31] =3D "ssbd", -}; - -static const char *const str_7a1[32] =3D -{ - [ 0] =3D "sha512", [ 1] =3D "sm3", - [ 2] =3D "sm4", - [ 4] =3D "avx-vnni", [ 5] =3D "avx512-bf16", - - [10] =3D "fzrm", [11] =3D "fsrs", - [12] =3D "fsrcs", - - /* 18 */ [19] =3D "wrmsrns", - - /* 22 */ [23] =3D "avx-ifma", -}; +#include =20 -static const char *const str_e21a[32] =3D -{ - [ 0] =3D "no-nest-bp", [ 1] =3D "fs-gs-ns", - [ 2] =3D "lfence+", - [ 6] =3D "nscb", - [ 8] =3D "auto-ibrs", - [10] =3D "amd-fsrs", [11] =3D "amd-fsrc", - - /* 16 */ [17] =3D "cpuid-user-dis", - [18] =3D "epsf", [19] =3D "fsrsc", - [20] =3D "amd-prefetchi", - - /* 26 */ [27] =3D "sbpb", - [28] =3D "ibpb-brtype", [29] =3D "srso-no", -}; - -static const char *const str_7b1[32] =3D -{ - [ 0] =3D "ppin", -}; - -static const char *const str_7c1[32] =3D -{ -}; - -static const char *const str_7d1[32] =3D -{ - [ 4] =3D "avx-vnni-int8", [ 5] =3D "avx-ne-convert", - - [10] =3D "avx-vnni-int16", - - [14] =3D "prefetchi", - - [18] =3D "cet-sss", -}; - -static const char *const str_7d2[32] =3D -{ - [ 0] =3D "intel-psfd", [ 1] =3D "ipred-ctrl", - [ 2] =3D "rrsba-ctrl", [ 3] =3D "ddp-ctrl", - [ 4] =3D "bhi-ctrl", [ 5] =3D "mcdt-no", -}; - -static const char *const str_m10Al[32] =3D -{ - [ 0] =3D "rdcl-no", [ 1] =3D "eibrs", - [ 2] =3D "rsba", [ 3] =3D "skip-l1dfl", - [ 4] =3D "intel-ssb-no", [ 5] =3D "mds-no", - [ 6] =3D "if-pschange-mc-no", [ 7] =3D "tsx-ctrl", - [ 8] =3D "taa-no", [ 9] =3D "mcu-ctrl", - [10] =3D "misc-pkg-ctrl", [11] =3D "energy-ctrl", - [12] =3D "doitm", [13] =3D "sbdr-ssdp-no", - [14] =3D "fbsdp-no", [15] =3D "psdp-no", - /* 16 */ [17] =3D "fb-clear", - [18] =3D "fb-clear-ctrl", [19] =3D "rrsba", - [20] =3D "bhi-no", [21] =3D "xapic-status", - /* 22 */ [23] =3D "ovrclk-status", - [24] =3D "pbrsb-no", [25] =3D "gds-ctrl", - [26] =3D "gds-no", [27] =3D "rfds-no", - [28] =3D "rfds-clear", -}; - -static const char *const str_m10Ah[32] =3D -{ -}; +static uint32_t nr_features; =20 static const struct { const char *name; const char *abbr; - const char *const *strs; -} decodes[] =3D +} leaf_names[] =3D { - { "CPUID 0x00000001.edx", "1d", str_1d }, - { "CPUID 0x00000001.ecx", "1c", str_1c }, - { "CPUID 0x80000001.edx", "e1d", str_e1d }, - { "CPUID 0x80000001.ecx", "e1c", str_e1c }, - { "CPUID 0x0000000d:1.eax", "Da1", str_Da1 }, - { "CPUID 0x00000007:0.ebx", "7b0", str_7b0 }, - { "CPUID 0x00000007:0.ecx", "7c0", str_7c0 }, - { "CPUID 0x80000007.edx", "e7d", str_e7d }, - { "CPUID 0x80000008.ebx", "e8b", str_e8b }, - { "CPUID 0x00000007:0.edx", "7d0", str_7d0 }, - { "CPUID 0x00000007:1.eax", "7a1", str_7a1 }, - { "CPUID 0x80000021.eax", "e21a", str_e21a }, - { "CPUID 0x00000007:1.ebx", "7b1", str_7b1 }, - { "CPUID 0x00000007:2.edx", "7d2", str_7d2 }, - { "CPUID 0x00000007:1.ecx", "7c1", str_7c1 }, - { "CPUID 0x00000007:1.edx", "7d1", str_7d1 }, - { "MSR_ARCH_CAPS.lo", "m10Al", str_m10Al }, - { "MSR_ARCH_CAPS.hi", "m10Ah", str_m10Ah }, + { "CPUID 0x00000001.edx", "1d" }, + { "CPUID 0x00000001.ecx", "1c" }, + { "CPUID 0x80000001.edx", "e1d" }, + { "CPUID 0x80000001.ecx", "e1c" }, + { "CPUID 0x0000000d:1.eax", "Da1" }, + { "CPUID 0x00000007:0.ebx", "7b0" }, + { "CPUID 0x00000007:0.ecx", "7c0" }, + { "CPUID 0x80000007.edx", "e7d" }, + { "CPUID 0x80000008.ebx", "e8b" }, + { "CPUID 0x00000007:0.edx", "7d0" }, + { "CPUID 0x00000007:1.eax", "7a1" }, + { "CPUID 0x80000021.eax", "e21a" }, + { "CPUID 0x00000007:1.ebx", "7b1" }, + { "CPUID 0x00000007:2.edx", "7d2" }, + { "CPUID 0x00000007:1.ecx", "7c1" }, + { "CPUID 0x00000007:1.edx", "7d1" }, + { "MSR_ARCH_CAPS.lo", "m10Al" }, + { "MSR_ARCH_CAPS.hi", "m10Ah" }, }; =20 #define COL_ALIGN "24" @@ -301,21 +52,32 @@ static const char *const fs_names[] =3D { [XEN_SYSCTL_cpu_featureset_hvm_max] =3D "HVM Max", }; =20 -static void dump_leaf(uint32_t leaf, const char *const *strs) +static const char *find_name(unsigned int index) { - unsigned i; + static const struct feature_name { + const char *name; + unsigned int bit; + } feature_names[] =3D INIT_FEATURE_NAMES; + unsigned int i; =20 - if ( !strs ) - { - printf(" ???"); - return; - } + for ( i =3D 0; i < ARRAY_SIZE(feature_names); i++ ) + if ( feature_names[i].bit =3D=3D index ) + return feature_names[i].name; + + return NULL; +} + +static void dump_leaf(uint32_t leaf, unsigned int index) +{ + unsigned i; =20 for ( i =3D 0; i < 32; ++i ) if ( leaf & (1u << i) ) { - if ( strs[i] ) - printf(" %s", strs[i]); + const char *name =3D find_name(index * 32 + i); + + if ( name ) + printf(" %s", name); else printf(" <%u>", i); } @@ -326,6 +88,7 @@ static void decode_featureset(const uint32_t *features, const char *name, bool detail) { + static const uint32_t known_features[] =3D INIT_KNOWN_FEATURES; unsigned int i; =20 printf("%-"COL_ALIGN"s ", name); @@ -336,11 +99,14 @@ static void decode_featureset(const uint32_t *features, if ( !detail ) return; =20 - for ( i =3D 0; i < length && i < ARRAY_SIZE(decodes); ++i ) + /* Ensure leaf names stay in sync with the policy leaf count. */ + BUILD_BUG_ON(ARRAY_SIZE(known_features) !=3D ARRAY_SIZE(leaf_names)); + + for ( i =3D 0; i < length && i < ARRAY_SIZE(leaf_names); ++i ) { - printf(" [%02u] %-"COL_ALIGN"s", i, decodes[i].name ?: "= "); - if ( decodes[i].name ) - dump_leaf(features[i], decodes[i].strs); + printf(" [%02u] %-"COL_ALIGN"s", i, leaf_names[i].name ?: ""); + /* Attempt to print features anyway even if the leaf name is unkno= wn. */ + dump_leaf(features[i], i); printf("\n"); } } @@ -355,8 +121,8 @@ static void dump_info(xc_interface *xch, bool detail) if ( !detail ) { printf(" %"COL_ALIGN"s ", "KEY"); - for ( i =3D 0; i < ARRAY_SIZE(decodes); ++i ) - printf("%-8s ", decodes[i].abbr ?: "???"); + for ( i =3D 0; i < ARRAY_SIZE(leaf_names); ++i ) + printf("%-8s ", leaf_names[i].abbr ?: "???"); printf("\n"); } =20 --=20 2.44.0