lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <da1f680b-f601-0e64-bdb4-1aa5b6fc6175@amd.com>
Date:   Thu, 15 Jun 2023 13:39:41 -0400
From:   Yazen Ghannam <yazen.ghannam@....com>
To:     Borislav Petkov <bp@...en8.de>
Cc:     yazen.ghannam@....com, linux-edac@...r.kernel.org,
        linux-kernel@...r.kernel.org, tony.luck@...el.com, x86@...nel.org
Subject: Re: [PATCH] x86/mce: Schedule mce_setup() on correct CPU for CPER
 decoding

On 6/15/2023 1:02 PM, Yazen Ghannam wrote:
> On 6/15/2023 12:20 PM, Borislav Petkov wrote:
>> On Thu, Jun 15, 2023 at 11:34:21AM -0400, Yazen Ghannam wrote:
>>> We can solve the NMI issue if it ever comes up in the future. Unless 
>>> there's
>>> an obvious change to avoid this now. Any suggestions?
>>
>> Yes, solve it right from the get-go. "It cannot happen now" is not good
>> enough. It should not be even technically possible.
>>
> 
> Okay, understood.
> 
>> Just report what's logged into BERT - nothing more. Whoever needs the
>> remaining info, can dump it from the machine.
>>
> 
> Will do.
> 

How about these changes? I can split this into separate preemption and 
PPIN patches.

The PPIN isn't coming directly from BERT. But it seems we can use the 
per_cpu value which is set up during CPU init.

Thanks,
Yazen

diff --git a/arch/x86/kernel/cpu/mce/apei.c b/arch/x86/kernel/cpu/mce/apei.c
index 8ed341714686..db16dc3c7b03 100644
--- a/arch/x86/kernel/cpu/mce/apei.c
+++ b/arch/x86/kernel/cpu/mce/apei.c
@@ -97,15 +97,19 @@ int apei_smca_report_x86_error(struct 
cper_ia_proc_ctx *ctx_info, u64 lapic_id)
         if (ctx_info->reg_arr_size < 48)
                 return -EINVAL;

+       get_cpu();
         mce_setup(&m);
+       put_cpu();

         m.extcpu = -1;
         m.socketid = -1;
+       m.ppin = 0;

         for_each_possible_cpu(cpu) {
                 if (cpu_data(cpu).initial_apicid == lapic_id) {
                         m.extcpu = cpu;
                         m.socketid = cpu_data(m.extcpu).phys_proc_id;
+                       m.ppin = cpu_data(m.extcpu).ppin;
                         break;
                 }
         }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ