From: Borislav Petkov <bp@amd64.org>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: Tony Luck <tony.luck@intel.com>,
Greg Kroah-Hartman <greg@kroah.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] x86, MCA: Convert dont_log_ce, banks and tolerant
Date: Wed, 17 Oct 2012 15:15:59 +0200 [thread overview]
Message-ID: <20121017131559.GE25507@aftab.osrc.amd.com> (raw)
In-Reply-To: <507E9F9A.4090706@linux.vnet.ibm.com>
On Wed, Oct 17, 2012 at 05:37:54PM +0530, Naveen N. Rao wrote:
> Nit: no need for the above? Only 2 references below and I think we
> can simply continue to use mca_cfg for uniformity. Ditto for the use
> of cfg further below.
>
> >
> >- mce_banks = kzalloc(banks * sizeof(struct mce_bank), GFP_KERNEL);
> >+ mce_banks = kzalloc(num_banks * sizeof(struct mce_bank), GFP_KERNEL);
> > if (!mce_banks)
> > return -ENOMEM;
For the simple reason that this line violates the 80 columns and I
didn't want to bring any uglification to the code by breaking the line
in two.
For the generated asm it doesn't matter - it is simply done for keeping
the code as readable as possible.
> >- for (i = 0; i < banks; i++) {
> >+
> >+ for (i = 0; i < num_banks; i++) {
> > struct mce_bank *b = &mce_banks[i];
> >
> > b->ctl = -1ULL;
> >@@ -1401,7 +1405,7 @@ static int __cpuinit __mcheck_cpu_cap_init(void)
> > rdmsrl(MSR_IA32_MCG_CAP, cap);
> >
> > b = cap & MCG_BANKCNT_MASK;
> >- if (!banks)
> >+ if (!mca_cfg.banks)
> > pr_info("CPU supports %d MCE banks\n", b);
> >
> > if (b > MAX_NR_BANKS) {
> >@@ -1411,8 +1415,9 @@ static int __cpuinit __mcheck_cpu_cap_init(void)
> > }
> >
> > /* Don't support asymmetric configurations today */
> >- WARN_ON(banks != 0 && b != banks);
> >- banks = b;
> >+ WARN_ON(mca_cfg.banks != 0 && b != mca_cfg.banks);
> >+ mca_cfg.banks = b;
> >+
> > if (!mce_banks) {
> > int err = __mcheck_cpu_mce_banks_init();
> >
> >@@ -1448,7 +1453,7 @@ static void __mcheck_cpu_init_generic(void)
> > if (cap & MCG_CTL_P)
> > wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
> >
> >- for (i = 0; i < banks; i++) {
> >+ for (i = 0; i < mca_cfg.banks; i++) {
> > struct mce_bank *b = &mce_banks[i];
> >
> > if (!b->init)
> >@@ -1489,6 +1494,8 @@ static void quirk_sandybridge_ifu(int bank, struct mce *m, struct pt_regs *regs)
> > /* Add per CPU specific workarounds here */
> > static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
> > {
> >+ struct mca_config *cfg = &mca_cfg;
> >+
>
> Same as above. We could probably continue using mca_cfg for uniformity.
There are 13 mca_cfg references total in that function so having it
shorter with a declaration at the beginning of the function of what cfg
is, is better IMO.
[ … ]
> > __init mcheck_enable(char *str)
> > {
> >+ struct mca_config *cfg = &mca_cfg;
> >+
>
> Same as above.
Ditto, 8 refs here.
--
Regards/Gruss,
Boris.
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
next prev parent reply other threads:[~2012-10-17 13:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-17 11:13 [PATCH 0/5] Rework MCA configuration handling code Borislav Petkov
2012-10-17 11:13 ` [PATCH 1/5] drivers/base: Add a DEVICE_BOOL_ATTR macro Borislav Petkov
2012-10-17 19:03 ` Greg Kroah-Hartman
2012-10-17 20:10 ` Borislav Petkov
2012-10-17 20:29 ` Greg Kroah-Hartman
2012-10-17 20:36 ` Borislav Petkov
2012-10-17 20:44 ` Greg Kroah-Hartman
2012-10-17 11:13 ` [PATCH 2/5] x86, MCA: Convert dont_log_ce, banks and tolerant Borislav Petkov
2012-10-17 12:07 ` Naveen N. Rao
2012-10-17 13:15 ` Borislav Petkov [this message]
2012-10-17 11:13 ` [PATCH 3/5] x86, MCA: Convert rip_msr, mce_bootlog, monarch_timeout Borislav Petkov
2012-10-17 11:13 ` [PATCH 4/5] x86, MCA: Convert the next three variables batch Borislav Petkov
2012-10-17 11:13 ` [PATCH 5/5] x86, MCA: Finish mca_config conversion Borislav Petkov
2012-10-17 14:11 ` Joe Perches
-- strict thread matches above, loose matches on Subject: below --
2012-10-25 14:17 [PATCH 0/5] Rework MCA configuration handling code, v2 Borislav Petkov
2012-10-25 14:17 ` [PATCH 2/5] x86, MCA: Convert dont_log_ce, banks and tolerant 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=20121017131559.GE25507@aftab.osrc.amd.com \
--to=bp@amd64.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=tony.luck@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.