[PATCH] x86/xen: disable Firmware First mode for correctable memory errors

Juergen Gross posted 1 patch 4 years, 2 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
arch/x86/xen/enlighten_pv.c | 8 ++++++++
1 file changed, 8 insertions(+)
[PATCH] x86/xen: disable Firmware First mode for correctable memory errors
Posted by Juergen Gross 4 years, 2 months ago
When running as Xen dom0 the kernel isn't responsible for selecting the
error handling mode, this should be handled by the hypervisor.

So disable setting FF mode when running as Xen pv guest. Not doing so
might result in boot splats like:

[    7.509696] HEST: Enabling Firmware First mode for corrected errors.
[    7.510382] mce: [Firmware Bug]: Ignoring request to disable invalid MCA bank 2.
[    7.510383] mce: [Firmware Bug]: Ignoring request to disable invalid MCA bank 3.
[    7.510384] mce: [Firmware Bug]: Ignoring request to disable invalid MCA bank 4.
[    7.510384] mce: [Firmware Bug]: Ignoring request to disable invalid MCA bank 5.
[    7.510385] mce: [Firmware Bug]: Ignoring request to disable invalid MCA bank 6.
[    7.510386] mce: [Firmware Bug]: Ignoring request to disable invalid MCA bank 7.
[    7.510386] mce: [Firmware Bug]: Ignoring request to disable invalid MCA bank 8.

Reason is that the HEST ACPI table contains the real number of MCA
banks, while the hypervisor is emulating only 2 banks for guests.

Cc: stable@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/xen/enlighten_pv.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 22e741e0b10c..065c049d0f3c 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1296,6 +1296,14 @@ asmlinkage __visible void __init xen_start_kernel(void)
 
 	xen_smp_init();
 
+#ifdef CONFIG_ACPI
+	/*
+	 * Disable selecting "Firmware First mode" for correctable memory
+	 * errors, as this is the duty of the hypervisor to decide.
+	 */
+	acpi_disable_cmcff = 1;
+#endif
+
 #ifdef CONFIG_ACPI_NUMA
 	/*
 	 * The pages we from Xen are not related to machine pages, so
-- 
2.26.2


Re: [PATCH] x86/xen: disable Firmware First mode for correctable memory errors
Posted by boris.ostrovsky@oracle.com 4 years, 2 months ago
On 9/25/20 6:11 AM, Juergen Gross wrote:
> @@ -1296,6 +1296,14 @@ asmlinkage __visible void __init xen_start_kernel(void)
>  
>  	xen_smp_init();
>  
> +#ifdef CONFIG_ACPI
> +	/*
> +	 * Disable selecting "Firmware First mode" for correctable memory
> +	 * errors, as this is the duty of the hypervisor to decide.
> +	 */
> +	acpi_disable_cmcff = 1;
> +#endif


Not that it matters greatly but should this go under if (xen_initial_domain()) clause a bit further down?


Either way:


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>



Re: [PATCH] x86/xen: disable Firmware First mode for correctable memory errors
Posted by Jan Beulich 4 years, 2 months ago
On 25.09.2020 15:45, boris.ostrovsky@oracle.com wrote:
> On 9/25/20 6:11 AM, Juergen Gross wrote:
>> @@ -1296,6 +1296,14 @@ asmlinkage __visible void __init xen_start_kernel(void)
>>  
>>  	xen_smp_init();
>>  
>> +#ifdef CONFIG_ACPI
>> +	/*
>> +	 * Disable selecting "Firmware First mode" for correctable memory
>> +	 * errors, as this is the duty of the hypervisor to decide.
>> +	 */
>> +	acpi_disable_cmcff = 1;
>> +#endif
> 
> 
> Not that it matters greatly but should this go under if (xen_initial_domain())
> clause a bit further down?

Yes - DomU-s are supposed to be in charge of their (virtual) firmware,
no matter that right now APEI for guests is completely out of sight as
far as I'm aware.

Jan