Re: [PATCH v1 4/9] target/i386/kvm: Use AMD MCE status encoding for Hygon

Zhao Liu <[email protected]>
Newsgroups gmane.comp.emulators.qemu,gmane.comp.emulators.kvm.devel
Message-ID <[email protected]>
> +/*
> + * 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?


Regards,
Zhao

>          status |= MCI_STATUS_S | MCI_STATUS_UC;
>          if (code == BUS_MCEERR_AR) {
>              status |= MCI_STATUS_AR | 0x134;
> -- 
> 2.43.7
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.