All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] x86/mce: Add new "handled" field to "struct mce"
Date: Thu, 13 Feb 2020 14:09:53 -0800	[thread overview]
Message-ID: <20200213220953.GA21107@agluck-desk2.amr.corp.intel.com> (raw)
In-Reply-To: <20200213165617.GL31799@zn.tnic>

On Thu, Feb 13, 2020 at 05:56:17PM +0100, Borislav Petkov wrote:
> On Wed, Feb 12, 2020 at 12:46:50PM -0800, Tony Luck wrote:
> > There can be many different subsystems register on the mce handler
> > chain. Add a new bitmask field and define values so that handlers
> > can indicate whether they took any action to log or otherwise
> > handle an error.
> > 
> > The default handler at the end of the chain can use this information
> > to decide whether to print to the console log.
> > 
> > Signed-off-by: Tony Luck <tony.luck@intel.com>
> > ---
> >  arch/x86/include/uapi/asm/mce.h | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/arch/x86/include/uapi/asm/mce.h b/arch/x86/include/uapi/asm/mce.h
> > index 955c2a2e1cf9..99ca07f7b078 100644
> > --- a/arch/x86/include/uapi/asm/mce.h
> > +++ b/arch/x86/include/uapi/asm/mce.h
> > @@ -35,8 +35,17 @@ struct mce {
> >  	__u64 ipid;		/* MCA_IPID MSR: only valid on SMCA systems */
> >  	__u64 ppin;		/* Protected Processor Inventory Number */
> >  	__u32 microcode;	/* Microcode revision */
> > +	__u32 handled;		/* Bitmap of logging/handling actions */
> >  };
> >  
> > +/* handled flag bits */
> > +#define	MCE_HANDLED_CEC		BIT(0)
> > +#define	MCE_HANDLED_UC		BIT(1)
> > +#define	MCE_HANDLED_EXTLOG	BIT(2)
> > +#define	MCE_HANDLED_NFIT	BIT(3)
> > +#define	MCE_HANDLED_EDAC	BIT(4)
> > +#define	MCE_HANDLED_MCELOG	BIT(5)
> > +
> >  #define MCE_GET_RECORD_LEN   _IOR('M', 1, int)
> >  #define MCE_GET_LOG_LEN      _IOR('M', 2, int)
> >  #define MCE_GETCLEAR_FLAGS   _IOR('M', 3, int)
> > -- 
> 
> Not sure if this should be exposed to user. I don't think it has any
> business poking its nose into how the MCE was handled. Or maybe it does
> but I cannot think of a good example ATM.
> 
> If not, this could be
> 
> 	...
> 	void *private;
> };
> 
> which userspace can't make any assumptions about. And we can put
> whatever we need in there...

I can see various ways to spin this:

1) It is useful to user mode. The mcelog(8) daemon (or other consumer
   of "struct mce") gets a record of where to look for logs from this
   record.  This could reduce the anxiety about logging the same item
   multiple times.  Its a bit weird though because each entity logging
   only sees who came before them, not who came after.
2) Not useful
	2a) Keep it in the structure, but clear it in copies shown to user
	2b) Make a *private to point to such things (but that really
	    complicates allocation of struct mce ... right now we just
	    have local copies on kernel stack)
	2c) Make a wrapper structure:
		struct kernel_mce {
			struct mce mce;
			u32 handled;
			... other hidden stuff ...
		};

-Tony

  reply	other threads:[~2020-02-13 22:09 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 20:46 [RFC PATCH 0/5] New way to track mce notifier chain actions Tony Luck
2020-02-12 20:46 ` [PATCH 1/5] x86/mce: Rename "first" function as "early" Tony Luck
2020-02-12 20:46 ` [PATCH 2/5] x86/mce: Convert corrected error collector to use mce notifier Tony Luck
2020-02-12 20:46 ` [PATCH 3/5] x86/mce: Add new "handled" field to "struct mce" Tony Luck
2020-02-13 16:56   ` Borislav Petkov
2020-02-13 22:09     ` Luck, Tony [this message]
2020-02-14  8:50       ` Borislav Petkov
2020-02-12 20:46 ` [PATCH 4/5] x86/mce: Fix all mce notifiers to update the mce->handled bitmask Tony Luck
2020-02-13 17:03   ` Borislav Petkov
2020-02-13 22:19     ` Luck, Tony
2020-02-13 22:27       ` Andy Lutomirski
2020-02-13 23:08         ` Luck, Tony
2020-02-14  9:02           ` Borislav Petkov
2020-02-14  0:18         ` Thomas Gleixner
2020-02-14  8:59       ` Borislav Petkov
2020-02-12 20:46 ` [PATCH 5/5] x86/mce: Change default mce logger to check mce->handled Tony Luck
2020-02-13 17:08   ` Borislav Petkov
2020-02-13 22:27     ` Luck, Tony
2020-02-14  9:05       ` Borislav Petkov
2020-02-12 23:08 ` [RFC PATCH 0/5] New way to track mce notifier chain actions Luck, Tony
2020-02-13  5:52   ` Andy Lutomirski
2020-02-13  6:09     ` Borislav Petkov
2020-02-13 16:05       ` Andy Lutomirski
2020-02-14 22:27 ` [PATCH v2 0/7] " Tony Luck
2020-02-14 22:27   ` [PATCH v2 1/7] x86/mce: Rename "first" function as "early" Tony Luck
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 2/7] x86/mce: Convert corrected error collector to use mce notifier Tony Luck
2020-04-15  9:49     ` [tip: ras/core] x86/mce: Convert the CEC to use the MCE notifier tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 3/7] x86/mce: Add new "kflags" field to "struct mce" Tony Luck
2020-04-15  9:49     ` [tip: ras/core] x86/mce: Add a struct mce.kflags field tip-bot2 for Tony Luck
2020-04-15 18:19       ` Luck, Tony
2020-04-15 18:36         ` Borislav Petkov
2020-04-15 19:58           ` [PATCH] x86/mce: Drop bogus comment about mce.kflags Luck, Tony
2020-04-17  9:21             ` [tip: ras/core] " tip-bot2 for Tony Luck
2020-04-20  8:06       ` [tip: ras/core] x86/mce: Add a struct mce.kflags field Christoph Hellwig
2020-04-20  8:42         ` Borislav Petkov
2020-02-14 22:27   ` [PATCH v2 4/7] x86/mce: Fix all mce notifiers to update the mce->kflags bitmask Tony Luck
2020-04-07  8:21     ` Borislav Petkov
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 5/7] x86/mce: Change default mce logger to check mce->kflags Tony Luck
2020-04-07 11:10     ` Borislav Petkov
2020-04-07 16:43       ` Luck, Tony
2020-04-07 19:37         ` Borislav Petkov
2020-04-07 19:44           ` Luck, Tony
2020-04-15  9:49     ` [tip: ras/core] x86/mce: Change default MCE " tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 6/7] x86/mce: Add mce=print_all option Tony Luck
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Tony Luck
2020-02-14 22:27   ` [PATCH v2 7/7] x86/mce: Drop the EDAC report status checks Tony Luck
2020-04-15  9:49     ` [tip: ras/core] EDAC: " tip-bot2 for Tony Luck
2020-04-07 16:34 ` [PATCH 0/9 v3] New way to track mce notifier chain actions Borislav Petkov
2020-04-07 16:34   ` [PATCH 1/9] x86/mce/amd, edac: Remove report_gart_errors Borislav Petkov
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Borislav Petkov
2020-04-07 16:34   ` [PATCH 2/9] x86/mce: Rename "first" function as "early" Borislav Petkov
2020-04-07 16:34   ` [PATCH 3/9] x86/mce: Convert the CEC to use the MCE notifier Borislav Petkov
2020-04-07 16:34   ` [PATCH 4/9] x86/mce: Add a struct mce.kflags field Borislav Petkov
2020-04-07 16:34   ` [PATCH 5/9] x86/mce: Fix all mce notifiers to update the mce->kflags bitmask Borislav Petkov
2020-04-07 16:34   ` [PATCH 6/9] x86/mce: Change default MCE logger to check mce->kflags Borislav Petkov
2020-04-07 16:34   ` [PATCH 7/9] x86/mce: Add mce=print_all option Borislav Petkov
2020-04-07 16:34   ` [PATCH 8/9] EDAC: Drop the EDAC report status checks Borislav Petkov
2020-04-07 16:34   ` [PATCH 9/9] x86/mce: Fixup exception only for the correct MCEs Borislav Petkov
2020-04-15  9:49     ` [tip: ras/core] " tip-bot2 for Borislav Petkov
2020-04-07 19:53   ` [PATCH 0/9 v3] New way to track mce notifier chain actions Luck, Tony
2020-04-07 19:56     ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200213220953.GA21107@agluck-desk2.amr.corp.intel.com \
    --to=tony.luck@intel.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.