Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751717AbbEDQEu (ORCPT ); Mon, 4 May 2015 12:04:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37418 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbbEDQEn (ORCPT ); Mon, 4 May 2015 12:04:43 -0400 Message-ID: <55479895.4030400@redhat.com> Date: Mon, 04 May 2015 18:04:37 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= CC: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, bsd@redhat.com, guangrong.xiao@linux.intel.com, Yang Zhang , wanpeng.li@linux.intel.com Subject: Re: [PATCH 05/13] KVM: x86: pass host_initiated to functions that read MSRs References: <1430393772-27208-1-git-send-email-pbonzini@redhat.com> <1430393772-27208-6-git-send-email-pbonzini@redhat.com> <20150504140143.GA11234@potion.brq.redhat.com> In-Reply-To: <20150504140143.GA11234@potion.brq.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 906 Lines: 32 On 04/05/2015 16:01, Radim Krčmář wrote: >> static int emulator_get_msr(struct x86_emulate_ctxt *ctxt, >> u32 msr_index, u64 *pdata) >> { >> - return kvm_get_msr(emul_to_vcpu(ctxt), msr_index, pdata); >> + struct msr_data msr; >> + int r; >> + >> + msr.index = msr_index; >> + msr.host_initiated = false; >> + r = kvm_get_msr(emul_to_vcpu(ctxt), &msr); >> + if (r) >> + return r; >> + >> + *pdata = msr.data; >> + return 0; >> } > > (Only msr.host_initiated changed from do_get_msr() ... > I'd add a function with an extra bool arg and call it twice.) True, but the same situation is there already for do_set_msr vs. emulator_set_msr Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/