From 08c74c8316d9e42fa900cf31a9cb3efc550baf3e Mon Sep 17 00:00:00 2001 From: emaste Date: Wed, 16 May 2018 01:55:52 +0000 Subject: [PATCH] intel-ucode-split: list platform ids based on processor_flags The Intel CPU "Platform Id" is a 3-bit integer reported by a given MSR. Intel microcode updates have an 8-bit field to indicate Platform Id compatibility - one bit in the mask for each of the possible Platform Id values. To simplify interpretation, report the Platform Id mask also as a list. --- tools/tools/intel-ucode-split/intel-ucode-split.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/tools/intel-ucode-split/intel-ucode-split.c b/tools/tools/intel-ucode-split/intel-ucode-split.c index a5cd66395b29..68b0525edd4f 100644 --- a/tools/tools/intel-ucode-split/intel-ucode-split.c +++ b/tools/tools/intel-ucode-split/intel-ucode-split.c @@ -77,6 +77,8 @@ static void dump_header(const struct microcode_update_header *hdr) { char buf[16]; + int i; + bool platformid_printed; printf("header version\t0x%x\n", hdr->header_version); printf("revision\t0x%x\n", hdr->update_revision); @@ -87,7 +89,15 @@ dump_header(const struct microcode_update_header *hdr) format_signature(buf, hdr->processor_signature)); printf("checksum\t0x%x\n", hdr->checksum); printf("loader revision\t0x%x\n", hdr->loader_revision); - printf("processor flags\t0x%x\n", hdr->processor_flags); + printf("processor flags\t0x%x", hdr->processor_flags); + platformid_printed = false; + for (i = 0; i < 8; i++) { + if (hdr->processor_flags & 1 << i) { + printf("%s%d", platformid_printed ? ", " : "\t\t", i); + platformid_printed = true; + } + } + printf("\n"); printf("datasize\t0x%x\t\t0x%x\n", hdr->data_size, hdr->data_size != 0 ? hdr->data_size : 2000); printf("size\t\t0x%x\t\t0x%x\n", hdr->total_size,