Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1315994ybn; Wed, 25 Sep 2019 16:13:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgoxoA7sgvRxZlw900HC049ah8P4CgIj8JyeeffMf2XK6+B2V1FwPknh/aAVezuNTw6xjT X-Received: by 2002:a50:d98a:: with SMTP id w10mr518628edj.276.1569453216469; Wed, 25 Sep 2019 16:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569453216; cv=none; d=google.com; s=arc-20160816; b=WF2Tq+11Fz2qZh391ikb8ynfrJT/L/I0xB1lcEoTbqYDn2gk5971NzTpY8SdkRbEtS aMBjVx0z+LIzbkmPHG1rgA+AmPGAQdytnsalJqPe/8Ak9Ua7rFfZzueGgCLOp9Yj50uv aCm7TT1yVIjf6OMiYLL2kFusnz95GKXzDMxeZaXnYF2z4jVzB2usKlCp49emeUBqB0wJ +5QUVLZ9L+c9b6WCH7Ve0GRSMeyWGNzgaSuEUqOjVO/GdXWzN+xJmG/+FUehrQMoCXb0 90pOO7LRw9J2zzV+1/Aw+SQ9WwLpvkPd7XLGK0aqS1ztPkNxcgfjDEF6fxJXpxv2XbMz y8Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=m8hKp84wlcyfetndcEZXmWM6SVMvJSjuhdFo284PuyM=; b=E0Swf9NXgSDt/eJ8dGi2BXSVw/wTFM0rJD9LjloBWGjLtry6e0EhPtv/LAP0rb9Jgt wdacQmFX9mmAhwbAgFWpQeWp0rNiXl/W/VlDjOHoE8wHxwImQA9Jzuze4HSzAFbLZEsP uMe6zcboScZ3reG8fvWxCMRJ9uIPf1ee0iHETyRQsztT6TKVllcxvzLyW0sMQuj0Voms qA2gcNJsTt3O23sMGXYEiwJOINq0VMpRqPBRTd7+ABu1jd9E8/hosQ/DLolHDYABfGhY uF43Y8q6WPx5v+mKh9WUcGGszBHp/BVuldlEwIiBOvk7pTtuVFXf2t+8PY7zOR3YmyxJ j2OQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k53si306783edb.303.2019.09.25.16.13.12; Wed, 25 Sep 2019 16:13:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727850AbfIWTVd (ORCPT + 99 others); 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.