LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andrew Morton <akpm@osdl.org>,
Jeremy Fitzhardinge <jeremy@goop.org>,
lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@muc.de>
Subject: Re: [PATCH] Cleanup: rationalize paravirt wrappers
Date: Thu, 22 Mar 2007 10:09:39 +0200 [thread overview]
Message-ID: <460239C3.5000404@qumranet.com> (raw)
In-Reply-To: <1174550442.2713.128.camel@localhost.localdomain>
Rusty Russell wrote:
>>
>>> +#define rdmsr(msr,val1,val2) \
>>> + do { \
>>> + int __err; \
>>> + unsigned long long __val = native_read_msr(msr, &__err); \
>>> + val1 = __val; \
>>> + val2 = __val >> 32; \
>>> + } while(0)
>>> +
>>>
>>>
>> You're silently changing the behavior (as well as the prototype) here,
>> rdmsr() used to fail loudly, now it fails silently, with no way for the
>> caller to check.
>>
>
> Hi Avi!
>
> Not sure what you're saying about the prototype: the old macro was:
>
> -#define rdmsr(msr,val1,val2) \
> - __asm__ __volatile__("rdmsr" \
> - : "=a" (val1), "=d" (val2) \
> - : "c" (msr))
> -
>
> Which doesn't seem to be a great difference to me.
>
Right, scratch that. Was confused by rdmsr_safe().
> The behaviour change (don't oops when an invalid rdmsr is used) was
> there with CONFIG_PARAVIRT=y, the cleanup just made !CONFIG_PARAVIRT the
> same. Is it important?
I think so. A function should either never fail, or indicate that it
has failed (panic, error return, debug message). With the kinder,
gentler rdmsr() one can code the wrong msr value and not notice that
something is wrong.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
next prev parent reply other threads:[~2007-03-22 8:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-22 2:41 Rusty Russell
2007-03-22 7:30 ` Avi Kivity
2007-03-22 8:00 ` Rusty Russell
2007-03-22 8:09 ` Jeremy Fitzhardinge
2007-03-22 8:09 ` Avi Kivity [this message]
2007-03-22 9:55 ` Rusty Russell
2007-03-23 11:05 ` Rusty Russell
2007-03-23 11:19 ` Avi Kivity
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=460239C3.5000404@qumranet.com \
--to=avi@qumranet.com \
--cc=ak@muc.de \
--cc=akpm@osdl.org \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--subject='Re: [PATCH] Cleanup: rationalize paravirt wrappers' \
/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
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).