Re: [PATCH v1 4/9] target/i386/kvm: Use AMD MCE status encoding for Hygon
Tina Zhang <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu,gmane.comp.emulators.kvm.devel |
|---|---|
| Message-ID | <[email protected]> |
On 7/31/2026 3:06 PM, Zhao Liu wrote:
>> +/*
>> + * Use AMD-style MCE status records for QEMU-injected memory failures on
>> + * AMD and Hygon CPUs.
>> + */
>> +static bool kvm_mce_inject_uses_amd_status(const CPUX86State *env)
>> +{
>> + return IS_AMD_CPU(env) || IS_HYGON_CPU(env);
>> +}
>> +
>> static void kvm_mce_inject(X86CPU *cpu, hwaddr paddr, int code)
>> {
>> CPUState *cs = CPU(cpu);
>> @@ -707,7 +716,7 @@ static void kvm_mce_inject(X86CPU *cpu, hwaddr paddr, int code)
>> uint64_t mcg_status = MCG_STATUS_MCIP | MCG_STATUS_RIPV;
>> int flags = 0;
>>
>> - if (!IS_AMD_CPU(env)) {
>> + if (!kvm_mce_inject_uses_amd_status(env)) {
>
> Maybe we can check hygon directly here?
Yes. Since there is only one user of this helper, keeping the check
inline is clearer. I'll update it in the next version.
Thanks,
Tina