From: Borislav Petkov <bp@amd64.org>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
LKML <linux-kernel@vger.kernel.org>,
Borislav Petkov <borislav.petkov@amd.com>
Subject: Re: [RFC PATCH 3/3] Convert mce_disabled
Date: Fri, 12 Oct 2012 23:58:59 +0200 [thread overview]
Message-ID: <20121012215859.GA18739@aftab.osrc.amd.com> (raw)
In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F19D4ABDA@ORSMSX108.amr.corp.intel.com>
On Fri, Oct 12, 2012 at 05:46:16PM +0000, Luck, Tony wrote:
> > Or, you can modify the mca_config I have there and use bools and pass a
> > pointer to each actual bool member in each DEVICE_BIT_ATTR invocation
> > (and rename it to DEVICE_BOOL_ATTR). Yeah, that could work, unless I'm
> > missing something else, of course.
>
> This looks like the best solution to me. Sure we use a little more memory for
> a "bool" for each option instead of just a single bit. But there are only a
> handful of them, not thousands. So I think we can cope with a few extra
> bytes of memory consumption. I was still not completely convinced by the
>
> if (val)
> *bvec |= le64_to_cpu(BIT_64(bit));
>
> solution - it assumes that big endian machines also assign their bit numbers
> in a big->little way - but that isn't required by the C standard. bitfields are
> assigned at the whim of the compiler writer (the only restrictions seem to
> be on alignments of fields w.r.t. to the underlying data types).
Ok, it seems that would've been a can of worms if we'd opened it.
Fortunately, if we do bools and we pass a pointer to the respective bool
member of mca_config, we won't need to do that anymore. Instead simply:
*bool_ptr = !!val;
It can't get any simpler than that. I'll give it a try soon to see
whether it pans out as I'm imagining it.
Thanks.
--
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-12 21:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-10 14:19 [RFC PATCH 0/3] mca_config stuff Borislav Petkov
2012-10-10 14:19 ` [RFC PATCH 1/3] Add DEVICE_BIT_ATTR Borislav Petkov
2012-10-10 14:20 ` [RFC PATCH 2/3] Change mce_dont_log_ce Borislav Petkov
2012-10-10 14:20 ` [RFC PATCH 3/3] Convert mce_disabled Borislav Petkov
2012-10-10 15:46 ` Luck, Tony
2012-10-10 15:53 ` Borislav Petkov
2012-10-12 10:50 ` Naveen N. Rao
2012-10-12 11:56 ` Borislav Petkov
2012-10-12 17:46 ` Luck, Tony
2012-10-12 21:58 ` Borislav Petkov [this message]
2012-10-15 5:53 ` Naveen N. Rao
2012-10-10 15:35 ` [RFC PATCH 0/3] mca_config stuff Luck, Tony
2012-10-10 19:53 ` 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=20121012215859.GA18739@aftab.osrc.amd.com \
--to=bp@amd64.org \
--cc=borislav.petkov@amd.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.