On Wed, May 20, 2015 at 12:36:10PM +0200, Borislav Petkov wrote: > Date: Wed, 20 May 2015 12:36:10 +0200 > From: Borislav Petkov <b...@suse.de> > To: "Chen, Gong" <gong.c...@linux.intel.com> > Cc: linux-kernel@vger.kernel.org, tony.l...@intel.com > Subject: Re: [PATCH 1/4 Rebase] x86, MCE: Provide a lock-less memory pool > to save error record > User-Agent: Mutt/1.5.23 (2014-03-12) > > On Wed, May 20, 2015 at 03:35:35PM -0400, Chen, Gong wrote: > > printk is not safe to use in MCE context. Add a lockless memory > > allocator pool to save error records in MCE context. Issual of those > > records will be delayed to a context safe to do printk. This idea is > > inspired by APEI/GHES driver. > > > > We're very conservative and allocate only two pages for it but since > > we're going to use those pages throughout the system's lifetime, we > > allocate them statically to avoid early boot time allocation woes. > > > > Signed-off-by: Chen, Gong <gong.c...@linux.intel.com> > > Link: > > http://lkml.kernel.org/r/1407830375-11087-1-git-send-email-gong.c...@linux.intel.com > > [Boris: rewrite. ] > > Signed-off-by: Borislav Petkov <b...@suse.de> > > --- > > arch/x86/Kconfig | 1 + > > arch/x86/include/uapi/asm/mce.h | 3 +- > > arch/x86/kernel/cpu/mcheck/Makefile | 2 +- > > arch/x86/kernel/cpu/mcheck/mce-genpool.c | 102 > > ++++++++++++++++++++++++++++++ > > arch/x86/kernel/cpu/mcheck/mce-internal.h | 12 ++++ > > arch/x86/kernel/cpu/mcheck/mce.c | 8 ++- > > 6 files changed, 125 insertions(+), 3 deletions(-) > > create mode 100644 arch/x86/kernel/cpu/mcheck/mce-genpool.c > > Applied, thanks... > > > diff --git a/arch/x86/kernel/cpu/mcheck/mce.c > > b/arch/x86/kernel/cpu/mcheck/mce.c > > index e535533d5ab8..ba91777a7ad8 100644 > > --- a/arch/x86/kernel/cpu/mcheck/mce.c > > +++ b/arch/x86/kernel/cpu/mcheck/mce.c > > @@ -115,7 +115,7 @@ static void (*quirk_no_way_out)(int bank, struct mce > > *m, struct pt_regs *regs); > > * CPU/chipset specific EDAC code can register a notifier call here to > > print > > * MCE errors in a human-readable form. > > */ > > -static ATOMIC_NOTIFIER_HEAD(x86_mce_decoder_chain); > > +ATOMIC_NOTIFIER_HEAD(x86_mce_decoder_chain); > > > > /* Do initial initialization of a struct mce */ > > void mce_setup(struct mce *m) > > @@ -1688,6 +1688,12 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c) > > if (mca_cfg.disabled) > > return; > > > > + if (mce_genpool_init()) { > > + mca_cfg.disabled = true; > > + pr_emerg("Couldn't allocate MCE records pool!\n"); > > + return; > > + } > > + > > if (__mcheck_cpu_ancient_init(c)) > > return; > > ... and moved this pool initialization right before we assign > machine_check_vector so that we don't do it unnecessarily if we return > earlier due to missing MCA features/MCA not enabled. > IIRC, I don't need to post a new patch again, right?
signature.asc
Description: Digital signature