From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932525AbbFEKEu (ORCPT ); Fri, 5 Jun 2015 06:04:50 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:34152 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752256AbbFEKEs (ORCPT ); Fri, 5 Jun 2015 06:04:48 -0400 Date: Fri, 5 Jun 2015 12:04:42 +0200 From: Ingo Molnar To: "H. Peter Anvin" Cc: linux-tip-commits@vger.kernel.org, tip-bot for Andy Lutomirski , 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 Message-ID: <20150605100442.GA8995@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * H. Peter Anvin 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