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

Re: [Xen-devel] [PATCH v8 13/16] microcode: unify loading update during CPU resuming and AP wakeup


  • To: Chao Gao <chao.gao@xxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Mon, 5 Aug 2019 10:19:54 +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=HobMlxMgNTJ2Q43lmj4Iy8oOKS13AbNMgOHIiRfx6AQ=; b=TAi9aiRpfvlPZu/t6xjFDA0hUTALr/alVgYbUGNHlLEnnSKXI+L8o4ohFEpFnmIdyADZDjZgHBJ/k7g0RTmIHFVPrg1BgKyX+nEZ4aDsXMTQndT/48m2ZgyQfFpbfzNkOJFxuA6gsWc1GHOpScnKiSnQqsKBTZZDNswRm3WvK4BRFa47jJTbXl4j+ArE+W5X1G2DsJ534+oCof1HfdrPHSIvqRs4L5dxzvTfdILKERd70Ok5EP/QaBnsVSFE+9HPJEheMkV04g3g7elbjkC5KuKvt7XV/7G9n+EubRIq3VUqs2OADF02Qr7uoV8hmsdA1US1RTyTJGnbUW2PIILjmw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N1svBSW8/zxkKkRsyf4YQZyhW/ijNSNXXW75uAfUMX6WIcSBPn2Js1eGaQ4ndkGHjJar6sqPc87zGaUyWv/YgW7GeI/UP9h/LAgtzLLWeMhEhcihkc7r7wpVIVz33Cmttaxt3Fu/tH4VuvhYNXGq6d1CW/AqUM+hRyS/kKHtodOwWdTBf2O2JrS2qhLP3ObbW9C4XKOE+eZEpHzlmD0ZbF8hz7GKOKGlCxe7SMmxINiXYaQ15jWcy7MldoeRmqHE1xyVvHBXbYE6X6R39+iUAzwk3i1bjUSZ15BHwpIqCiyLagmGm/G+R+jqFRuk7AaWyuykNfxGukajOYaDDJc/XA==
  • 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: Mon, 05 Aug 2019 10:20:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVSFKrA3gY1r4/5kKzYHipTShbSabsXgAA
  • Thread-topic: [Xen-devel] [PATCH v8 13/16] microcode: unify loading update during CPU resuming and AP wakeup

On 01.08.2019 12:22, Chao Gao wrote:
> Both are loading the cached patch. Since APs call the unified function,
> microcode_update_one(), during wakeup, the 'start_update' parameter
> which originally used to distinguish BSP and APs is redundant. So remove
> this parameter.
> 
> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
> ---
> Changes in v8:
>   - split out from the previous patch
> ---
>   xen/arch/x86/acpi/power.c       |  2 +-
>   xen/arch/x86/microcode.c        | 36 +++++++++++-------------------------
>   xen/arch/x86/smpboot.c          |  5 +----
>   xen/include/asm-x86/processor.h |  4 ++--
>   4 files changed, 15 insertions(+), 32 deletions(-)
> 
> diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
> index 4f21903..24798d5 100644
> --- a/xen/arch/x86/acpi/power.c
> +++ b/xen/arch/x86/acpi/power.c
> @@ -253,7 +253,7 @@ static int enter_state(u32 state)
>   
>       console_end_sync();
>   
> -    microcode_resume_cpu();
> +    microcode_update_one();
>   
>       if ( !recheck_cpu_features(0) )
>           panic("Missing previously available feature(s)\n");
> diff --git a/xen/arch/x86/microcode.c b/xen/arch/x86/microcode.c
> index f0b1e39..cbaf13d 100644
> --- a/xen/arch/x86/microcode.c
> +++ b/xen/arch/x86/microcode.c
> @@ -204,24 +204,6 @@ static struct microcode_patch 
> *microcode_parse_blob(const char *buf,
>       return NULL;
>   }
>   
> -int microcode_resume_cpu(void)
> -{
> -    int err;
> -    struct cpu_signature *sig = &this_cpu(cpu_sig);
> -
> -    if ( !microcode_ops )
> -        return 0;
> -
> -    spin_lock(&microcode_mutex);
> -
> -    err = microcode_ops->collect_cpu_info(sig);
> -    if ( likely(!err) )
> -        err = microcode_ops->apply_microcode(microcode_cache);
> -    spin_unlock(&microcode_mutex);
> -
> -    return err;
> -}
> -
>   void microcode_free_patch(struct microcode_patch *microcode_patch)
>   {
>       microcode_ops->free_patch(microcode_patch->mc);
> @@ -402,7 +384,16 @@ static int __init microcode_init(void)
>   }
>   __initcall(microcode_init);
>   
> -int __init early_microcode_update_cpu(bool start_update)
> +/* Load a cached update to current cpu */
> +int microcode_update_one(void)
> +{
> +    return microcode_ops ? microcode_update_cpu(NULL) : 0;
> +}

With both callers ignoring the return value, I wonder if the
function should return void. Else it might be better (but I'm
not entirely certain) for it to return -EOPNOTSUPP rather
than 0.

> +/*
> + * BSP calls this function to parse ucode blob and then apply an update.
> + */

This is a single line comment, and hence wants its style
changed accordingly.

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®.