[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v8 09/16] microcode: remove pointless 'cpu' parameter


  • To: Chao Gao <chao.gao@xxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Fri, 2 Aug 2019 15:15:30 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8mUCAWcZpC7HLwu1Ft0sME9+Tp+9Iedz39qeBDra5Vc=; b=CIe3Js0VJBvDWtAhtTx1fgnZoEIRmq2br2VmamcXq+HMFT2GxCn7SKyDy5wfGiPP7FzSwvsthovzHin6c45gy5SuCAKgnqzaR0C7jAxh266fxa3k8UXSiQLYhc2P92DGCAVr2Dae9hUVWbNcJ7qwCQasXvQbKw3oImMaKfHw3c5n/R8Qp3/SOa0uoaFejSIXUSvJGoPfdzE5RCd+5IAZ33EWB0ptlAGkjonqqW1cVf1FkBB/0yDrwVDoZ+Ky0BPBdGF3JtQx7j1ltlf5SkPB7dWDIc2zQm4By9YIKaeV2l0fNFVFfXaFqAQptF4xQTRE5uXQPnnAcL1tyUR6ucKECw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oV83W670QkXLfZXfbF8L2xiJZyOhGjF9cADNQ6CfcuMF/fhd6RoA4IqCXUU27M+jekS8l7o0TfeT3hwRYkxP9gswL49u6+H7GOl+xYEzelAMcPsHee0awDIKzrboe8d7nkWJXFHzFbsTby4SkvbipjQB7+bTsTfZk+Xkfa/2anmaVhJEwgE8DpEHW6fXbUZ6UqSw2WrNkSNXA1vuvCLsCHau0mXECAq0ks2lmwfjVBh69FhD8xwSDmmXgO41ptqe5Yvvk1kiCSb61nTGy1K0dpwktLFPRVDmGhLlNEHtcUatA3Xt3b0WSbdszCD1TlfeaJPGnfJUODbt0hdnxeSluQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Ashok Raj <ashok.raj@xxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 02 Aug 2019 15:20:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVSFKee/zhap9hQ0ak0CrSHglRmabn+ZYA
  • Thread-topic: [PATCH v8 09/16] microcode: remove pointless 'cpu' parameter

On 01.08.2019 12:22, Chao Gao wrote:
> --- a/xen/arch/x86/microcode_amd.c
> +++ b/xen/arch/x86/microcode_amd.c
> @@ -78,23 +78,23 @@ struct mpbhdr {
>   static DEFINE_SPINLOCK(microcode_update_lock);
>   
>   /* See comment in start_update() for cases when this routine fails */
> -static int collect_cpu_info(unsigned int cpu, struct cpu_signature *csig)
> +static int collect_cpu_info(struct cpu_signature *csig)
>   {
> -    struct cpuinfo_x86 *c = &cpu_data[cpu];
> +    struct cpuinfo_x86 *c = &current_cpu_data;
>   
>       memset(csig, 0, sizeof(*csig));
>   
>       if ( (c->x86_vendor != X86_VENDOR_AMD) || (c->x86 < 0x10) )
>       {
>           printk(KERN_ERR "microcode: CPU%d not a capable AMD processor\n",
> -               cpu);
> +               smp_processor_id());
>           return -EINVAL;
>       }
>   
>       rdmsrl(MSR_AMD_PATCHLEVEL, csig->rev);
>   
>       pr_debug("microcode: CPU%d collect_cpu_info: patch_id=%#x\n",
> -             cpu, csig->rev);
> +             smp_processor_id(), csig->rev);
>   
>       return 0;
>   }

Argh - I'd been wrong saying "The only other use of "cpu" is in a
pr_debug()" in a reply to v7. I had managed to overlook the use in
the printk(). This suggests that the earlier solution was better,
as now we have at least two smp_processor_id() in the function, in
a debug build three of them. I'm sorry.

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
preferably with the change above moved back to its v7 shape, but
given this was my mistake I won't insist. If there was no need for
v9, then this could also be done while committing.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.