From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Auld Subject: Re: [PATCH] Added call parameter to track whether invocation originated with guest or elsewhere Date: Mon, 22 Oct 2012 14:58:20 -0700 Message-ID: <1350943100.5232.1.camel@WillAuldHomeLinux> References: <1350439833.8785.27.camel@WillAuldHomeLinux> <507E89F5.4000301@redhat.com> <20121017140918.GA4940@amt.cnet> <507EC079.3050908@redhat.com> Reply-To: will.auld@intel.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , will.auld@intel.com, kvm@vger.kernel.org, xiantao.zhang@intel.com, jinsong.liu@intel.com To: Avi Kivity Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:43487 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755787Ab2JVV6X (ORCPT ); Mon, 22 Oct 2012 17:58:23 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so2318338pbb.19 for ; Mon, 22 Oct 2012 14:58:23 -0700 (PDT) In-Reply-To: <507EC079.3050908@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2012-10-17 at 16:28 +0200, Avi Kivity wrote: > On 10/17/2012 04:09 PM, Marcelo Tosatti wrote: > > On Wed, Oct 17, 2012 at 12:35:33PM +0200, Avi Kivity wrote: > >> On 10/17/2012 04:10 AM, Will Auld wrote: > >> > Signed-off-by: Will Auld > >> > --- > >> > > >> > Resending to full list > >> > > >> > Marcelo, > >> > > >> > This patch is what I believe you ask for as foundational for later > >> > patches to address IA32_TSC_ADJUST. > >> > > >> > >> Please write a changelog to reflect the motivation. > >> > >> All those bool parameters scattered all over the place aren't very > >> pretty. Usually we solve this with helpers that embed the parameter > >> name (kvm_set_msr() vs. kvm_set_msr_host()) but there are too many > >> functions for this to work here. > >> > >> Marcelo, any ideas? > > > > Its easier to read > > > > kvm_x86_ops->kvm_set_msr() > > kvm_x86_ops->kvm_set_msr_host() > > > > then > > > > kvm_x86_ops->kvm_set_msr(,false) > > kvm_x86_ops->kvm_set_msr(,true) > > > > So you're right. > > Yes, but we have a million functions for setting MSRs. > > Maybe > > struct msr { > bool host_requested; > u32 index; > u64 data; > }; > > and change all the APIs to use that. > > I was working on a different solution and then saw this suggestion just now. I like this tact and will look at it closer. Thanks, Will