From: Borislav Petkov <bp@alien8.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>, Peter Wu <peter@lekensteyn.nl>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host
Date: Sat, 22 Mar 2014 11:01:44 +0100 [thread overview]
Message-ID: <20140322100144.GA5617@pd.tnic> (raw)
In-Reply-To: <532CDA92.2080409@zytor.com>
On Fri, Mar 21, 2014 at 05:34:26PM -0700, H. Peter Anvin wrote:
> It's not just KVM, though.
Right, there's also hw models which don't have a certain MSR all of a
sudden. And yeah yeah, it is architectural so it must be there, yadda,
yadda, we've heard all that already. But we want to be defensive with
our MSR accesses and not explode each time a MSR is missing.
Btw, hpa, I'm looking at the msr_read/msr_write() things now in
arch/x86/lib/msr.c and that second argument "struct msr *m" is kinda
clumsy since all the call sites will need to define a struct msr for
passing which is not intuitive. So I'd rather turn it into u64 so using
those functions would be as simple as possible:
u64 msrval;
int ret;
...
ret = msr_read(MSR_BLA, &msrval);
if (ret < 0)
goto err;
...
... msrval ...
and
ret = msr_write(MSR_DONG, msrval);
if (ret < 0) {
pr_err("Error configuring my fancy hw feature.\n");
goto unwind;
}
This should be the most intuitive usage, IMO. Agreed?
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
prev parent reply other threads:[~2014-03-22 10:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 17:42 GPF in intel_pmu_lbr_reset() with qemu -cpu host Peter Wu
2014-03-21 17:46 ` Peter Wu
2014-03-21 19:04 ` Venkatesh Srinivas
2014-03-21 19:09 ` H. Peter Anvin
2014-03-22 7:54 ` Paolo Bonzini
2014-03-22 8:50 ` Gleb Natapov
2014-03-22 10:05 ` Peter Wu
2014-03-22 12:27 ` Gleb Natapov
2014-03-22 21:46 ` H. Peter Anvin
2014-03-22 22:00 ` Peter Wu
2014-03-26 7:23 ` Wu, Feng
2014-03-26 9:38 ` Paolo Bonzini
2014-03-21 19:29 ` Andi Kleen
2014-03-21 20:46 ` H. Peter Anvin
2014-03-21 21:37 ` Andi Kleen
2014-03-21 21:41 ` H. Peter Anvin
2014-03-21 21:48 ` Andi Kleen
2014-03-21 21:55 ` H. Peter Anvin
2014-03-22 0:22 ` Andi Kleen
2014-03-22 0:26 ` H. Peter Anvin
2014-03-22 0:30 ` Andi Kleen
2014-03-22 0:34 ` H. Peter Anvin
2014-03-22 10:01 ` Borislav Petkov [this message]
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=20140322100144.GA5617@pd.tnic \
--to=bp@alien8.de \
--cc=andi@firstfloor.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peter@lekensteyn.nl \
--cc=peterz@infradead.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