From: Borislav Petkov <bp@alien8.de>
To: X86-ML <x86@kernel.org>
Cc: Tony Luck <tony.luck@intel.com>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
LKML <linux-kernel@vger.kernel.org>,
Linux EDAC <linux-edac@vger.kernel.org>
Subject: [RFC PATCH 2/4] x86/mce: Rename rcu_dereference_check_mce() to mce_log_get_idx_check()
Date: Wed, 22 Jul 2015 10:40:26 +0200 [thread overview]
Message-ID: <1437554428-24788-3-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1437554428-24788-1-git-send-email-bp@alien8.de>
From: Borislav Petkov <bp@suse.de>
The "rcu_" prefix misleads for it being a proper RCU interface which
is not. It basically checks whether we're preemptible or holding the
chrdev_read mutex.
Rename it accordingly.
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
---
arch/x86/kernel/cpu/mcheck/mce.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 5a19adb86b8f..36c065e6fa94 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -52,11 +52,11 @@
static DEFINE_MUTEX(mce_chrdev_read_mutex);
-#define rcu_dereference_check_mce(p) \
+#define mce_log_get_idx_check(p) \
({ \
rcu_lockdep_assert(rcu_read_lock_sched_held() || \
lockdep_is_held(&mce_chrdev_read_mutex), \
- "suspicious rcu_dereference_check_mce() usage"); \
+ "suspicious mce_log_get_idx_check() usage"); \
smp_load_acquire(&(p)); \
})
@@ -165,7 +165,7 @@ void mce_log(struct mce *mce)
mce->finished = 0;
wmb();
for (;;) {
- entry = rcu_dereference_check_mce(mcelog.next);
+ entry = mce_log_get_idx_check(mcelog.next);
for (;;) {
/*
@@ -1812,7 +1812,7 @@ static ssize_t mce_chrdev_read(struct file *filp, char __user *ubuf,
goto out;
}
- next = rcu_dereference_check_mce(mcelog.next);
+ next = mce_log_get_idx_check(mcelog.next);
/* Only supports full reads right now */
err = -EINVAL;
--
2.5.0.rc2.28.g6003e7f
next prev parent reply other threads:[~2015-07-22 8:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 8:40 [RFC PATCH 0/4] x86/ras: Move AMD MCE injection module to arch/x86/ Borislav Petkov
2015-07-22 8:40 ` [RFC PATCH 1/4] RAS: Add a menuconfig option with descriptive text Borislav Petkov
2015-07-22 8:40 ` Borislav Petkov [this message]
2015-07-23 15:58 ` [RFC PATCH 2/4] x86/mce: Rename rcu_dereference_check_mce() to mce_log_get_idx_check() Paul E. McKenney
2015-07-22 8:40 ` [RFC PATCH 3/4] x86/mce: Add a wrapper around mce_log() for injection Borislav Petkov
2015-07-22 8:40 ` [RFC PATCH 4/4] x86/ras: Move AMD MCE injector to arch/x86/ras/ 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=1437554428-24788-3-git-send-email-bp@alien8.de \
--to=bp@alien8.de \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox