public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-tip-commits@vger.kernel.org,
	tip-bot for Andy Lutomirski <tipbot@zytor.com>,
	peterz@infradead.org, torvalds@linux-foundation.org,
	luto@kernel.org, linux-kernel@vger.kernel.org,
	tglx@linutronix.de, akpm@linux-foundation.org
Subject: Re: [tip:x86/asm] x86/asm/msr: Make wrmsrl_safe() a function
Date: Fri, 5 Jun 2015 12:04:42 +0200	[thread overview]
Message-ID: <20150605100442.GA8995@gmail.com> (raw)
In-Reply-To: <A63099EB-1B4E-45D8-B1FA-00923D701A49@zytor.com>


* H. Peter Anvin <hpa@zytor.com> wrote:

> Shouldn't we make it a proper function sine there is going to have to be a 
> function call involved anyway?

Yeah, so what I think should be done instead is to flip around the API:
make wrmsrl_safe() the primary API and derive wrmsr_safe() from that,
because it's the saner API and because we have 3 times more wrmsrl_safe()
users right now!

And I'd make _that_ mapping inline, which would catch crap like:

  ./arch/x86/include/asm/msr.h:   return wrmsr_safe(msr, (u32)val,  (u32)(val >> 32));
  ./arch/x86/xen/enlighten.c:     wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32));

and would turn it back into wrmsrl_safe(pfn)/etc. seemlessly.

In addition to that we might even phase out the high/low API altogether, as code 
like this:

            !wrmsr_safe(MSR_EFER,
                        header->pmode_efer_low,
                        header->pmode_efer_high))

should probably use a single u64.

But crappy paravirt indirections get in the way of an easy, trivial restructuring, 
as usual...

Thanks,

	Ingo

  reply	other threads:[~2015-06-05 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05  8:42 [tip:x86/asm] x86/asm/msr: Make wrmsrl_safe() a function tip-bot for Andy Lutomirski
2015-06-05  8:57 ` H. Peter Anvin
2015-06-05 10:04   ` Ingo Molnar [this message]
2015-06-05 11:11     ` 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=20150605100442.GA8995@gmail.com \
    --to=mingo@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tipbot@zytor.com \
    --cc=torvalds@linux-foundation.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