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

Re: [PATCH v4 4/4] x86/microcode: Disable microcode update handler if DIS_MCU_UPDATE is set


  • To: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 23 Jun 2023 09:39:35 +0200
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Qhl3HFWr+gEHZXyBcIOFJ0ylgt9glriovY4XH+zjdt0=; b=Xs8tPR8a+UitaCDr7Hj54BeQrYZHFmrJF+F2ffsSxTwpfv37FiLNzjKBgPI2n89UpeJNz30xJM3EIFsyv13MclJORxFReaBKq9jR3tUAz9MFJiDTWHhMsn6pMKOD6oPBxEYnefEnTt61VmcR8/jYUY9H85e0Qc+tZb1GTKmmAFOew3t07pmhjI0ZjqnbVJgPy8zaDCbdsgaX+daAis39yuB0ywKZ5W71knLMJkFay2k3WTgSEHy/SV7mslmTW4MAEcrpvkeRpqtQ9Ez4misnogudn1rzxuCKw9ZxSlc5cqch3nFsQHuLxHqsRFq1ofwtgGSodqJxtVoHuXLG+4X6iw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C8ht4qmRMBkdEVxpPg2ZOlSZrGPnkgZmcHtfwm6GNxcL7GToDt5hH+iNSPRTD1HFa7biJMxOs3OzP/W/VwNXLlTnuLu6AoEhtMs3H/3nPQZG8PMXV1628/Icj3L1dKARrilrbXCZ2/bQVfN47/wPJlDhe94MgE7LRl0lMXUJJ5soZ5NWVtv9voQFEpCWqOUbUHAq2T+T4UrdCfZ0l+j5nbLi/yHDEJpCK7NTF9q7cyqggJBZ4w2pS2IkKAP9RXVjM9WgGP9uep505H3YRsyNbPhPB9rbNffMCsvaUIsVGVkeJCvPcK19Wnzp52YeU8mDWlnj0XVlQ5MpC7r5ZxLrvw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 23 Jun 2023 07:40:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.06.2023 19:42, Alejandro Vallejo wrote:
> --- a/xen/arch/x86/cpu/microcode/intel.c
> +++ b/xen/arch/x86/cpu/microcode/intel.c
> @@ -385,6 +385,19 @@ static struct microcode_patch *cf_check 
> cpu_request_microcode(
>      return patch;
>  }
>  
> +bool __init intel_can_load_microcode(void)
> +{
> +    uint64_t mcu_ctrl;
> +
> +    if ( !cpu_has_mcu_ctrl )
> +        return true;
> +
> +    rdmsrl(MSR_MCU_CONTROL, mcu_ctrl);
> +
> +    /* If DIS_MCU_LOAD is set applying microcode updates won't work */
> +    return  !(mcu_ctrl & MCU_CONTROL_DIS_MCU_LOAD);

And we have to honor this, i.e. we shouldn't make an attempt
at clearing the bit?

Also nit: One too many blank after "return".

> --- a/xen/arch/x86/cpu/microcode/private.h
> +++ b/xen/arch/x86/cpu/microcode/private.h
> @@ -60,6 +60,13 @@ struct microcode_ops {
>          const struct microcode_patch *new, const struct microcode_patch 
> *old);
>  };
>  
> +/**
> + * Checks whether we can perform microcode updates on this Intel system
> + *
> + * @return True iff the microcode update facilities are enabled
> + */
> +bool __init intel_can_load_microcode(void);

No __init please on declarations; they only matter on definitions.

Jan



 


Rackspace

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