All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>,
	Tony Luck <tony.luck@intel.com>,
	Aristeu Rozanski <aris@redhat.com>,
	Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	linux-edac@vger.kernel.org
Subject: [2/5] x86/mce: Add macors for corrected error count bit field
Date: Mon, 24 Sep 2018 13:16:10 -0700	[thread overview]
Message-ID: <20180924201613.14070-3-tony.luck@intel.com> (raw)

From: Qiuxu Zhuo <qiuxu.zhuo@intel.com>

The bit field 52:38 of MCi_STATUS is for corrected error count.
Add {*_SHIFT|*_MASK|*_CEC(c)} macros for the bit field.

Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 arch/x86/include/asm/mce.h | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index d53e5dd7471a..a81a22e3592c 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -30,15 +30,18 @@
 #define MCG_EXT_CTL_LMCE_EN BIT_ULL(0) /* Enable LMCE */
 
 /* MCi_STATUS register defines */
-#define MCI_STATUS_VAL   BIT_ULL(63)  /* valid error */
-#define MCI_STATUS_OVER  BIT_ULL(62)  /* previous errors lost */
-#define MCI_STATUS_UC    BIT_ULL(61)  /* uncorrected error */
-#define MCI_STATUS_EN    BIT_ULL(60)  /* error enabled */
-#define MCI_STATUS_MISCV BIT_ULL(59)  /* misc error reg. valid */
-#define MCI_STATUS_ADDRV BIT_ULL(58)  /* addr reg. valid */
-#define MCI_STATUS_PCC   BIT_ULL(57)  /* processor context corrupt */
-#define MCI_STATUS_S	 BIT_ULL(56)  /* Signaled machine check */
-#define MCI_STATUS_AR	 BIT_ULL(55)  /* Action required */
+#define MCI_STATUS_VAL		BIT_ULL(63)  /* valid error */
+#define MCI_STATUS_OVER		BIT_ULL(62)  /* previous errors lost */
+#define MCI_STATUS_UC		BIT_ULL(61)  /* uncorrected error */
+#define MCI_STATUS_EN		BIT_ULL(60)  /* error enabled */
+#define MCI_STATUS_MISCV	BIT_ULL(59)  /* misc error reg. valid */
+#define MCI_STATUS_ADDRV	BIT_ULL(58)  /* addr reg. valid */
+#define MCI_STATUS_PCC		BIT_ULL(57)  /* processor context corrupt */
+#define MCI_STATUS_S		BIT_ULL(56)  /* Signaled machine check */
+#define MCI_STATUS_AR		BIT_ULL(55)  /* Action required */
+#define MCI_STATUS_CEC_SHIFT	38           /* Corrected Error Count */
+#define MCI_STATUS_CEC_MASK	0x1fffc000000000ULL
+#define MCI_STATUS_CEC(c)	(((c) & MCI_STATUS_CEC_MASK) >> MCI_STATUS_CEC_SHIFT)
 
 /* AMD-specific bits */
 #define MCI_STATUS_TCC		BIT_ULL(55)  /* Task context corrupt */

             reply	other threads:[~2018-09-24 20:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 20:16 Luck, Tony [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-24 20:24 [2/5] x86/mce: Add macors for corrected error count bit field 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=20180924201613.14070-3-tony.luck@intel.com \
    --to=tony.luck@intel.com \
    --cc=aris@redhat.com \
    --cc=bp@alien8.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=qiuxu.zhuo@intel.com \
    /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.