On 21.03.2023 12:47, Sergey Dyasli wrote:
> --- a/xen/arch/x86/platform_hypercall.c
> +++ b/xen/arch/x86/platform_hypercall.c
> @@ -640,6 +640,36 @@ ret_t do_platform_op(
>      }
>      break;
>  
> +    case XENPF_get_ucode_version:
> +    {
> +        struct xenpf_ucode_version *ver = &op->u.ucode_version;
> +
> +        if ( !get_cpu_maps() )
> +        {
> +            ret = -EBUSY;
> +            break;
> +        }
> +
> +        if ( (ver->xen_cpuid >= nr_cpu_ids) || !cpu_online(ver->xen_cpuid) )
> +        {
> +            ret = -ENOENT;
> +        }

Nit: Unnecessary braces.

> +        else
> +        {
> +            const struct cpu_signature *sig = &per_cpu(cpu_sig, 
> ver->xen_cpuid);
> +
> +            ver->cpu_signature = sig->sig;
> +            ver->pf = sig->pf;
> +            ver->ucode_revision = sig->rev;
> +        }

While I don't mean to insist on making this work right in this patch, I'd
like to re-raise my earlier comment regarding it also being of possible
interest to know ucode revisions for parked CPUs (they are, after all, an
active entity in the system). Parked CPUs have their per-CPU data retained,
so getting at that data shouldn't be overly difficult (the main aspect
being to tell parked from fully offline CPUs).

Jan

Reply via email to