From 0f4275b0411ab43976c56a4070e9da4107046d50 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Fri, 6 Aug 2021 11:09:20 +0800 Subject: [PATCH] board-inspector: collect address bits of processors This patch updates the board inspector to collect the bits of physical and linear addresses of the processors and generate this information to the board XML for further uses at configuration phase. Tracked-On: #6292 Signed-off-by: Junjie Mao --- misc/config_tools/board_inspector/cpuparser/cpuids.py | 5 +++++ .../board_inspector/extractors/10-processors.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/misc/config_tools/board_inspector/cpuparser/cpuids.py b/misc/config_tools/board_inspector/cpuparser/cpuids.py index 521b3d31b..b8a074f2e 100644 --- a/misc/config_tools/board_inspector/cpuparser/cpuids.py +++ b/misc/config_tools/board_inspector/cpuparser/cpuids.py @@ -751,3 +751,8 @@ class LEAF_80000008(CPUID): leaf = 0x80000008 physical_address_bits = cpuidfield(EAX, 7, 0, doc="# Physical Address bits") linear_address_bits = cpuidfield(EAX, 15, 8, doc="# Linear Address bits") + + attribute_bits = [ + "physical_address_bits", + "linear_address_bits", + ] diff --git a/misc/config_tools/board_inspector/extractors/10-processors.py b/misc/config_tools/board_inspector/extractors/10-processors.py index 4d1a53d93..77612bd32 100644 --- a/misc/config_tools/board_inspector/extractors/10-processors.py +++ b/misc/config_tools/board_inspector/extractors/10-processors.py @@ -52,6 +52,12 @@ def extract_model(processors_node, cpu_id, family_id, model_id, core_type, nativ if getattr(leaf_data, cap) == 1: add_child(n, "capability", id=cap) + leaves = [(0x80000008, 0)] + for leaf in leaves: + leaf_data = parse_cpuid(leaf[0], leaf[1], cpu_id) + for cap in leaf_data.attribute_bits: + add_child(n, "attribute", str(getattr(leaf_data, cap)), id=cap) + def extract_topology(processors_node): cpu_ids = get_online_cpu_ids() for cpu_id in cpu_ids: