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, INCLUDES_PATCH,MAILING_LIST_MULTI,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 0239EC4CECF for ; Mon, 23 Sep 2019 19:21:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D269C2089F for ; Mon, 23 Sep 2019 19:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727255AbfIWTVd (ORCPT ); Mon, 23 Sep 2019 15:21:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1455 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726096AbfIWTVc (ORCPT ); Mon, 23 Sep 2019 15:21:32 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DFC213082E4E; Mon, 23 Sep 2019 19:21:32 +0000 (UTC) Received: from mail (ovpn-120-159.rdu2.redhat.com [10.10.120.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAF2160BFB; Mon, 23 Sep 2019 19:21:32 +0000 (UTC) Date: Mon, 23 Sep 2019 15:21:31 -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 02/17] KVM: monolithic: x86: convert the kvm_x86_ops methods to external functions Message-ID: <20190923192131.GD19996@redhat.com> References: <20190920212509.2578-1-aarcange@redhat.com> <20190920212509.2578-3-aarcange@redhat.com> <9b188fb8-b930-047f-d1c0-fe27cbe27338@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9b188fb8-b930-047f-d1c0-fe27cbe27338@redhat.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 23 Sep 2019 19:21:32 +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:19:30PM +0200, Paolo Bonzini wrote: > On 20/09/19 23:24, Andrea Arcangeli wrote: > > diff --git a/arch/x86/kvm/svm_ops.c b/arch/x86/kvm/svm_ops.c > > new file mode 100644 > > index 000000000000..2aaabda92179 > > --- /dev/null > > +++ b/arch/x86/kvm/svm_ops.c > > @@ -0,0 +1,672 @@ > > +// SPDX-License-Identifier: GPL-2.0-only > > +/* > > + * arch/x86/kvm/svm_ops.c > > + * > > + * Copyright 2019 Red Hat, Inc. > > + */ > > + > > +int kvm_x86_ops_cpu_has_kvm_support(void) > > +{ > > + return has_svm(); > > +} > > Can you just rename all the functions in vmx/ and svm.c, instead of > adding forwarders? I can do that, I thought this was cleaner as it still retained the abstraction separated from the mixup of the rest of the vmx/svm code, but it'll work the same by dropping the abstraction in kvm_ops.h and just maintaining a common name between the svm.c and vmx.c files, gcc already built it that way after all.