Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1096666rwb; Sun, 6 Nov 2022 19:23:52 -0800 (PST) X-Google-Smtp-Source: AMsMyM4oK078o4REpP0uX8oJLf1BTHTKVuAHu798OhlAaehGAev55UYWjeqlQvCatgNTuQvY/BzU X-Received: by 2002:a17:902:e84f:b0:187:11a7:b1b with SMTP id t15-20020a170902e84f00b0018711a70b1bmr44298818plg.110.1667791431836; Sun, 06 Nov 2022 19:23:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667791431; cv=none; d=google.com; s=arc-20160816; b=rck7cHKBkcxVVta9S5RlSDox6Izpx64uoIPPGJve2U/o+9kAqwX4ccpwVUc3WMMbyt IHl0n9ly13RoAK/l7FUyj+Q7fcXqCFpben0NbdgJL77RRn1Gj9QupIj95jZcHaY4UlJD 7lUFmMdzvAvOZ7tKB+yqhg5A+/9cP591CWObRE1xnQo+jYuy6DPU5bKRf8mN/p72klaA G704ODJ/s5waFtaDS6onwlRpeH9njFDcLlzGEsGbzoyvG3+KHfWajVDiBaCtp9r4mHOt 3iYxsPkZ3RfHiSyKEuWadw55e5lYkVlEd36gG9vhjMR+HvOKpWH4FW3LDe6JaF6NqxnK l7Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YDkpvmLdCcNS/SK5D2IL8ltTmU7MAjuwj9on9XdxjqM=; b=XK2OY3WpeOW4n6TWI+K/gAIMWJepanaGTdFhUxqr2eg4cyvrjOfekJv7RHOaHXtAff lXnlCX6g6XGnkvg2ks7z8JBqrQmoyDF/IjraZoqGEHf56Ye5on82w7GkyfRu/ruoFZBt gy7xV8MwDmb2uF/Yad52eY/q9+EjSMIINNqdUNRkIU0fnqU6qSWw0L8ALflVIJr1zFUk b95TvBT7uUISMnW7LGvRKRR3/7d16eFds/D6Hpgu/LZBx+RR6djlHh+LEc0rUoSLfC5N OBqm83ZE0+85TZDa1AgcHaag/2uBWXFxrUnEyTxPaDwQ0tB0EMJ38cqAoXgYfP2EjSu+ mMIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=O2GdYT7c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw11-20020a17090b180b00b00205ee3e845bsi10111897pjb.116.2022.11.06.19.23.36; Sun, 06 Nov 2022 19:23:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=O2GdYT7c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbiKGDFU (ORCPT + 95 others); Sun, 6 Nov 2022 22:05:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230302AbiKGDFR (ORCPT ); Sun, 6 Nov 2022 22:05:17 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9109560FF for ; Sun, 6 Nov 2022 19:05:16 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id d26so26666697eje.10 for ; Sun, 06 Nov 2022 19:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YDkpvmLdCcNS/SK5D2IL8ltTmU7MAjuwj9on9XdxjqM=; b=O2GdYT7cMyZAwXXzVaGGer2516sCwb8nVa+3zH1uKyisQxoW9HAvhvHCOOJeufiTbl F3Np7E0Q60MoiXXzv7QKKfVpPuct8EOqbYhrz0wkX1SdRI+8oB73JExLBlUhlEORndI0 oR5Ci6Q9Zji0dGkOeDy61S11yj8qgzFtdaxDEMNt1vXTTwBDofXJXEd/zzO2opd/NDJm j1f/gZ4KRV3uPIBqcQXujsk4akPpTe+2a2n4m0j+UpZ//j9kycunMnHpdO3L/Ji7eqnQ U523Q+8cijpVSXguZZnGJMRJTHTEr5k6EgUTEZqzTJSespExVQpXPGZ+H7/pFHIEuIGk PlTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YDkpvmLdCcNS/SK5D2IL8ltTmU7MAjuwj9on9XdxjqM=; b=0GdjoDFa5v5krUxUd+UDLBpi199Ti0b+oKTP3HspDZCv4GYwy+WAAnPBodVISvAPZj hlxIEIibJ+ZcGIxNYMfgrCfvDbwbeGCXuwPQhnkrzQTpwxtOy4DIlp4UdVJz/wsafles WzMnILGEO1tCnprahdYUURRg6l9GpnuaTtkLFBbNO4uPETzLGwt3D9XvyVRxX2BZtEkU +KBX6nEmpn6JC8H6g186Ol9wobtnyJMMhAUeWXT9L7P8+MGGkpvcAZFZOr4dD6ftctLR +huTFni8MJACHsSPoKSZCJGOHEl3PS0j5jzUKtCgHW+9Lb03P5nTpfnWAt18AfwUFvGw n2RQ== X-Gm-Message-State: ACrzQf1X6yAt2xhHqpRmYooKxYxf9GczRlWFRRpmGQ+b3mmFUTeHfvXL zoZq5R8VF3z6ziPQ7kyJ+PqXW0yMB7GU0HhgD8uRlQ== X-Received: by 2002:a17:906:eec7:b0:733:189f:b07a with SMTP id wu7-20020a170906eec700b00733189fb07amr46182007ejb.230.1667790314965; Sun, 06 Nov 2022 19:05:14 -0800 (PST) MIME-Version: 1.0 References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-23-seanjc@google.com> In-Reply-To: <20221102231911.3107438-23-seanjc@google.com> From: Anup Patel Date: Mon, 7 Nov 2022 08:35:03 +0530 Message-ID: Subject: Re: [PATCH 22/44] KVM: RISC-V: Do arch init directly in riscv_kvm_init() To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Vitaly Kuznetsov , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Atish Patra , David Hildenbrand , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Isaku Yamahata , Fabiano Rosas , Michael Ellerman , Chao Gao , Thomas Gleixner , Yuan Yao Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 3, 2022 at 4:49 AM Sean Christopherson wrote: > > Fold the guts of kvm_arch_init() into riscv_kvm_init() instead of > bouncing through kvm_init()=>kvm_arch_init(). Functionally, this is a > glorified nop as invoking kvm_arch_init() is the very first action > performed by kvm_init(). > > Moving setup to riscv_kvm_init(), which is tagged __init, will allow > tagging more functions and data with __init and __ro_after_init. And > emptying kvm_arch_init() will allow dropping the hook entirely once all > architecture implementations are nops. > > No functional change intended. > > Signed-off-by: Sean Christopherson For KVM RISC-V: Acked-by: Anup Patel Regards, Anup > --- > arch/riscv/kvm/main.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/arch/riscv/kvm/main.c b/arch/riscv/kvm/main.c > index a146fa0ce4d2..cb063b8a9a0f 100644 > --- a/arch/riscv/kvm/main.c > +++ b/arch/riscv/kvm/main.c > @@ -66,6 +66,15 @@ void kvm_arch_hardware_disable(void) > } > > int kvm_arch_init(void *opaque) > +{ > + return 0; > +} > + > +void kvm_arch_exit(void) > +{ > +} > + > +static int __init riscv_kvm_init(void) > { > const char *str; > > @@ -110,15 +119,6 @@ int kvm_arch_init(void *opaque) > > kvm_info("VMID %ld bits available\n", kvm_riscv_gstage_vmid_bits()); > > - return 0; > -} > - > -void kvm_arch_exit(void) > -{ > -} > - > -static int __init riscv_kvm_init(void) > -{ > return kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE); > } > module_init(riscv_kvm_init); > -- > 2.38.1.431.g37b22c650d-goog >