From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6314C432C1 for ; Tue, 24 Sep 2019 00:52:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E09820882 for ; Tue, 24 Sep 2019 00:52:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391823AbfIXAv5 (ORCPT ); Mon, 23 Sep 2019 20:51:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57220 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390912AbfIXAv5 (ORCPT ); Mon, 23 Sep 2019 20:51:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D28A110C0940; Tue, 24 Sep 2019 00:51:56 +0000 (UTC) Received: from mail (ovpn-120-159.rdu2.redhat.com [10.10.120.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A398B10013A1; Tue, 24 Sep 2019 00:51:53 +0000 (UTC) Date: Mon, 23 Sep 2019 20:51:52 -0400 From: Andrea Arcangeli To: Paolo Bonzini Cc: Vitaly Kuznetsov , "Dr. David Alan Gilbert" , Marcelo Tosatti , Peter Xu , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 13/17] KVM: monolithic: x86: drop the kvm_pmu_ops structure Message-ID: <20190924005152.GA4658@redhat.com> References: <20190920212509.2578-1-aarcange@redhat.com> <20190920212509.2578-14-aarcange@redhat.com> <057fc5f2-7343-943f-ed86-59f1ad5122e5@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <057fc5f2-7343-943f-ed86-59f1ad5122e5@redhat.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Tue, 24 Sep 2019 00:51:56 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Sep 23, 2019 at 12:21:43PM +0200, Paolo Bonzini wrote: > On 20/09/19 23:25, Andrea Arcangeli wrote: > > Cleanup after this was finally left fully unused. > > > > Signed-off-by: Andrea Arcangeli > > --- > > arch/x86/include/asm/kvm_host.h | 3 --- > > arch/x86/kvm/pmu.h | 19 ------------------- > > arch/x86/kvm/pmu_amd.c | 15 --------------- > > arch/x86/kvm/svm.c | 1 - > > arch/x86/kvm/vmx/pmu_intel.c | 15 --------------- > > arch/x86/kvm/vmx/vmx.c | 2 -- > > 6 files changed, 55 deletions(-) > > Is there any reason not to do the same for kvm_x86_ops? This was covered in the commit header of patch 2: To reduce the rejecting parts while tracking upstream, this doesn't attempt to entirely remove the kvm_x86_ops structure yet, that is meant for a later cleanup. The pmu ops have been already cleaned up in this patchset because it was left completely unused right after the conversion from pointer to functions to external functions. Lot more patches are needed to get rid of kvm_x86_ops entirely because there are lots of places checking the actual value of the method before making the indirect call. I tried to start that, but then it got into potentially heavily rejecting territory, so I thought it was simpler to start with what I had, considering from a performance standpoint it's optimal already as far as retpolines are concerned. > (As an aside, patch 2 is not copying over the comments in the struct > kvm_x86_ops declarations. Granted there aren't many, but we should not > lose the few that exist). Yes sorry, this was actually unintentional and the comment need to be retained in the header declaration. Thanks, Andrea