From: Tony Luck <tony.luck@intel.com>
To: Borislav Petkov <bp@amd64.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Chen Gong <gong.chen@linux.intel.com>,
"Huang, Ying" <ying.huang@intel.com>,
Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Subject: Re: [PATCH 2/2] x86/mce: Add quirk for instruction recovery on Sandy Bridge processors
Date: Fri, 20 Jul 2012 09:33:23 -0700 [thread overview]
Message-ID: <CA+8MBbLX_cLR1+DpjuG-D5=5YhnTy3aGS4RL1iviRYomYoveWg@mail.gmail.com> (raw)
In-Reply-To: <20120720121848.GA29183@aftab.osrc.amd.com>
> Maybe define a default empty quirk_no_way_out() on the remaining
> families/vendors so that the compiler can optimize it away and we save
> ourselves the if-test?
Perhaps I misunderstood your suggestion. I don't see how the compiler will
manage to optimize it all away. I just tried defining
static void quirk_no_way_out_nop(int bank, struct mce *m, struct pt_regs *regs)
{
}
and providing that as an initial value for the quirk_no_way_out
function pointer.
Then I deleted the "if (quirk_no_way_out)".
Looking at the assembly code produced, I now just have an unconditional call:
callq *0x9fe992(%rip) # ffffffff81a18668 <quirk_no_way_out>
I'd think that a call through a function pointer to an empty function is
more expensive that testing whether that function pointer was NULL.
-Tony
next prev parent reply other threads:[~2012-07-20 16:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 18:38 [PATCH 0/2] Fix machine check recovery for instruction fault on Sandy Bridge Tony Luck
2012-07-19 18:21 ` [PATCH 1/2] x86/mce: Move MCACOD defines from mce-severity.c to <asm/mce.h> Tony Luck
2012-07-19 18:28 ` [PATCH 2/2] x86/mce: Add quirk for instruction recovery on Sandy Bridge processors Tony Luck
2012-07-20 12:18 ` Borislav Petkov
2012-07-20 16:33 ` Tony Luck [this message]
2012-07-21 12:45 ` Borislav Petkov
2012-07-23 16:11 ` Luck, Tony
2012-07-23 21:21 [PATCH 0/2] Fix machine check recovery for instruction fault on Sandy Bridge Tony Luck
2012-07-19 18:28 ` [PATCH 2/2] x86/mce: Add quirk for instruction recovery on Sandy Bridge processors Tony Luck
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='CA+8MBbLX_cLR1+DpjuG-D5=5YhnTy3aGS4RL1iviRYomYoveWg@mail.gmail.com' \
--to=tony.luck@intel.com \
--cc=bp@amd64.org \
--cc=gong.chen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=seto.hidetoshi@jp.fujitsu.com \
--cc=ying.huang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).