Clean up and enhance of feature_word_description()
cover Clean up and enhance of feature_word_description()
This series grabs two patches related to feature_word_description() from two different old threads, they are simple and straightforward.
Patch 1 is grabbed from [1] while patch 2 is grabbed from [2].
[1]: https://lore.kernel.org/qemu-devel/[email protected]/
[2]: https://lore.kernel.org/qemu-devel/[email protected]/
Lei Wang (1):
i386: Remove unused parameter "uint32_t bit" in
feature_word_description()
Xiaoyao Li (1):
target/i386: Print CPUID subleaf info for unsupported feature
target/i386/cpu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/2 i386: Remove unused parameter "uint32_t bit" in feature_word_description()
From: Lei Wang <[email protected]>
Parameter "uint32_t bit" is not used in function feature_word_description(), so remove it.
--- target/i386/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
target/i386/cpu.c +2 -2
@@ -5451,7 +5451,7 @@ static const TypeInfo max_x86_cpu_type_info = { .class_init = max_x86_cpu_class_init, }; -static char *feature_word_description (FeatureWordInfo *f,uint32_t bit) +static char *feature_word_description (FeatureWordInfo *f) {assert (f->type ==CPUID_FEATURE_WORD || f->type ==MSR_FEATURE_WORD );
@@ -5490,6 +5490,7 @@ static void mark_unavailable_features(X86CPU *cpu, FeatureWord w, uint64_t mask,CPUX86State *env = &cpu->env;FeatureWordInfo *f = &feature_word_info[w];int i; + g_autofree char *feat_word_str = feature_word_description(f);if (!cpu->force_features) { env->features[w] &= ~mask;
@@ -5502,7 +5503,6 @@ static void mark_unavailable_features(X86CPU *cpu, FeatureWord w, uint64_t mask,for (i =0 ; i <64 ; ++i) {if ((1ULL << i) & mask) { - g_autofree char *feat_word_str = feature_word_description(f, i); warn_report("%s: %s%s%s [bit %d]", verbose_prefix, feat_word_str,
Signature · 1 line
2.34.1
Re: [PATCH 1/2] i386: Remove unused parameter "uint32_t bit" in feature_word_description()
Quoted 11 lines · Xiaoyao Li
Date: Tue, 17 Dec 2024 07:39:31 -0500
From: Xiaoyao Li <[email protected]>
Subject: [PATCH 1/2] i386: Remove unused parameter "uint32_tbit" in
feature_word_description()
X-Mailer: git-send-email 2.34.1From: Lei Wang <[email protected]>
Parameter "
uint32_tbit" is not used in functionfeature_word_description(), so remove it.
Quoted 8 lines
Signed-off-by Lei Wang <[email protected]>Reviewed-by Igor Mammedov <[email protected]>Reviewed-by Xiaoyao Li <[email protected]>Signed-off-by Xiaoyao Li <[email protected]>--- target/i386/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
PATCH 2/2 target/i386: Print CPUID subleaf info for unsupported feature
In reply to Xiaoyao LiSome CPUID leaves have meaningful subleaf index. Print the subleaf info in feature_word_description for CPUID features.
--- target/i386/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
target/i386/cpu.c +3 -2
@@ -5460,8 +5460,9 @@ static char *feature_word_description(FeatureWordInfo *f) {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)",
Signature · 1 line
2.34.1
Re: [PATCH 2/2] target/i386: Print CPUID subleaf info for unsupported feature
Quoted 6 lines · Xiaoyao Li
Date: Tue, 17 Dec 2024 07:39:32 -0500
From: Xiaoyao Li <[email protected]>
Subject: [PATCH 2/2] target/i386: Print CPUID subleaf info for unsupported
feature
X-Mailer: git-send-email 2.34.1
Quoted 8 lines
Some CPUID leaves have meaningful subleaf index. Print the subleaf info in
feature_word_descriptionfor CPUID features.Signed-off-by Xiaoyao Li <[email protected]>Reviewed-by Eduardo Habkost <[email protected]>--- target/i386/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Quoted 4 lines · Xiaoyao Li
This series grabs two patches related to
feature_word_description()from two different old threads, they are simple and straightforward.Patch 1 is grabbed from [1] while patch 2 is grabbed from [2].
Ping...
Quoted 13 lines
[1]: https://lore.kernel.org/qemu-devel/[email protected]/
[2]: https://lore.kernel.org/qemu-devel/[email protected]/Lei Wang (1):
i386: Remove unused parameter "uint32_tbit" in
feature_word_description()Xiaoyao Li (1):
target/i386: Print CPUID subleaf info for unsupported featuretarget/i386/cpu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Paolo Bonzini
AppliedQuoted 7 lines · Xiaoyao Li
Quoted 4 lines · Xiaoyao Li
This series grabs two patches related to
feature_word_description()from two different old threads, they are simple and straightforward.Patch 1 is grabbed from [1] while patch 2 is grabbed from [2].
Ping...
Applied, thanks---with a slightly fancier formatting for patch 2:
target/i386/cpu.c +7 -4
@@ -5780,12 +5780,15 @@ static char *feature_word_description(FeatureWordInfo *f) {const char *reg =get_register_name_32 (f->cpuid.reg);assert (reg); -return g_strdup_printf ("CPUID.%02XH_%02XH:%s" , - f->cpuid.eax, - f->cpuid.needs_ecx ? f->cpuid.ecx :0 , reg); +if (!f->cpuid.needs_ecx) { +return g_strdup_printf ("CPUID[eax=%02Xh].%s" , f->cpuid.eax, reg); + }else { +return g_strdup_printf ("CPUID[eax=%02Xh,ecx=%02Xh].%s" , + f->cpuid.eax, f->cpuid.ecx : 0, reg); + } }case MSR_FEATURE_WORD : -return g_strdup_printf ("MSR(%02XH)" , +return g_strdup_printf ("MSR(%02Xh)" , f->msr.index); }
Paolo