diff mbox series

[RFC,1/5] target/i386: Print CPUID subleaf info for unsupported feature

Message ID 20210909144150.1728418-2-xiaoyao.li@intel.com (mailing list archive)
State New, archived
Headers show
Series Make Intel PT configurable | expand

Commit Message

Xiaoyao Li Sept. 9, 2021, 2:41 p.m. UTC
Some CPUID leaves have meaningful subleaf index. Print the subleaf info
in feature_word_description for CPUID features.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 target/i386/cpu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Eduardo Habkost Oct. 15, 2021, 3:12 p.m. UTC | #1
On Thu, Sep 09, 2021 at 10:41:46PM +0800, Xiaoyao Li wrote:
> Some CPUID leaves have meaningful subleaf index. Print the subleaf info
> in feature_word_description for CPUID features.
> 
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
diff mbox series

Patch

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 97e250e8760d..a06473c9e84c 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4219,8 +4219,9 @@  static char *feature_word_description(FeatureWordInfo *f, uint32_t bit)
         {
             const char *reg = get_register_name_32(f->cpuid.reg);
             assert(reg);
-            return g_strdup_printf("CPUID.%02XH:%s",
-                                   f->cpuid.eax, reg);
+            return g_strdup_printf("CPUID.%02XH_%02XH:%s",
+                                   f->cpuid.eax,
+                                   f->cpuid.needs_ecx ? f->cpuid.ecx : 0, reg);
         }
     case MSR_FEATURE_WORD:
         return g_strdup_printf("MSR(%02XH)",