All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: tony.luck@intel.com, andi@firstfloor.org, bp@amd64.org
Cc: gong.chen@linux.intel.com, ananth@in.ibm.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com,
	tglx@linutronix.de, gregkh@suse.de, linux-edac@vger.kernel.org
Subject: [PATCH 1/3] x86/mce: Make sysfs tunables available globally across all cpus
Date: Wed, 05 Sep 2012 15:51:56 +0530	[thread overview]
Message-ID: <20120905102156.9423.27806.stgit@localhost.localdomain> (raw)
In-Reply-To: <20120905102049.9423.6413.stgit@localhost.localdomain>

All the MCE attributes currently exported via sysfs appear under
/sys/devices/system/machinecheck/machinecheck<n>/. Pretty much all of
these are global in nature and not specific to a processor. So, make these
available under /sys/devices/system/machinecheck/ where they rightly belong.
Update documentation to also point to the new location so that user-space
tools can pick up on the new location. We would eventually want to remove
these from the per-cpu location.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 Documentation/x86/x86_64/machinecheck |    4 ++--
 arch/x86/kernel/cpu/mcheck/mce.c      |   24 +++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/Documentation/x86/x86_64/machinecheck b/Documentation/x86/x86_64/machinecheck
index b1fb302..02b84a6 100644
--- a/Documentation/x86/x86_64/machinecheck
+++ b/Documentation/x86/x86_64/machinecheck
@@ -31,8 +31,8 @@ bankNctl
 	Note that BIOS maintain another mask to disable specific events
 	per bank.  This is not visible here
 
-The following entries appear for each CPU, but they are truly shared
-between all CPUs.
+The following entries are shared between all CPUs and appear under
+/sys/devices/system/machinecheck:
 
 check_interval
 	How often to poll for corrected machine check errors, in seconds
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index c311122..bf276eb 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -2205,6 +2205,7 @@ static struct dev_ext_attribute dev_attr_cmci_disabled = {
 	&mce_cmci_disabled
 };
 
+/* Use this _only_ for per-cpu attributes */
 static struct device_attribute *mce_device_attrs[] = {
 	&dev_attr_tolerant.attr,
 	&dev_attr_check_interval.attr,
@@ -2216,6 +2217,27 @@ static struct device_attribute *mce_device_attrs[] = {
 	NULL
 };
 
+/* All new global attributes go here */
+static struct attribute *mce_device_global_attrs[] = {
+	&dev_attr_tolerant.attr.attr,
+	&dev_attr_check_interval.attr.attr,
+	&dev_attr_trigger.attr,
+	&dev_attr_monarch_timeout.attr.attr,
+	&dev_attr_dont_log_ce.attr.attr,
+	&dev_attr_ignore_ce.attr.attr,
+	&dev_attr_cmci_disabled.attr.attr,
+	NULL
+};
+
+static struct attribute_group mce_device_attr_group = {
+	.attrs = mce_device_global_attrs,
+};
+
+static const struct attribute_group *mce_device_attr_groups[] = {
+	&mce_device_attr_group,
+	NULL,
+};
+
 static cpumask_var_t mce_device_initialized;
 
 static void mce_device_release(struct device *dev)
@@ -2397,7 +2419,7 @@ static __init int mcheck_init_device(void)
 
 	mce_init_banks();
 
-	err = subsys_system_register(&mce_subsys, NULL);
+	err = subsys_system_register(&mce_subsys, mce_device_attr_groups);
 	if (err)
 		return err;
 


  reply	other threads:[~2012-09-05 10:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 10:21 [PATCH 0/3] x86:mce: Some cleanups and bios-set CMCI thresholds Naveen N. Rao
2012-09-05 10:21 ` Naveen N. Rao [this message]
2012-09-05 10:32   ` [PATCH] [mcelog] Start using the new sysfs tunables location Naveen N. Rao
2012-09-05 18:47     ` Andi Kleen
2012-09-05 19:09       ` Tony Luck
2012-09-06  6:40         ` Naveen N. Rao
2012-09-06 12:28         ` Andi Kleen
2012-09-06 12:34           ` Naveen N. Rao
2012-09-06 12:51             ` Alan Cox
2012-09-06 13:21             ` Andi Kleen
2012-09-05 10:22 ` [PATCH 2/3] x86/mce: Pack boolean MCE flags into a structure Naveen N. Rao
2012-09-05 17:15   ` Joe Perches
2012-09-05 18:56   ` Tony Luck
2012-09-06  6:48     ` Naveen N. Rao
2012-09-06 12:15       ` Borislav Petkov
2012-09-05 10:22 ` [PATCH 3/3] x86/mce: Honour bios-set CMCI threshold Naveen N. Rao

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=20120905102156.9423.27806.stgit@localhost.localdomain \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ananth@in.ibm.com \
    --cc=andi@firstfloor.org \
    --cc=bp@amd64.org \
    --cc=gong.chen@linux.intel.com \
    --cc=gregkh@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --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.