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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2B80C433FE for ; Mon, 7 Nov 2022 03:05:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbiKGDFS (ORCPT ); Sun, 6 Nov 2022 22:05:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbiKGDFR (ORCPT ); Sun, 6 Nov 2022 22:05:17 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EDD060E6 for ; Sun, 6 Nov 2022 19:05:16 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id f27so26760142eje.1 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=QOWfFXaiCMH+uTg1IVF1PkBsmMAMvGfljPDyFm6pO762pbpOB2T5/EROkt/u/Bi+VP d1ScnvYg8SHgfC3OVPWcbNKHyg9A+1lI56wSkuOVvP6jNgS1w6zHNP9eSo1NeTcjaJTF ZQ+A+klpJH0EO9933wvRnqsDpeSykaLoqfKlO7BGViZKycWf1aMX2lbar0p82ks/nz9W fHGkqRqXTT1OUMy8izJtUGKjnJhosQdOhuKbQ+K6gD557RyUJdjIQFf+mcWna1WF6NRB 6gs4UUUObPnLQrtJcksHvambspRgRu4c/5lk16PjxszkjqXczmQVSVKqVp69yByv9inM N55g== X-Gm-Message-State: ACrzQf0AHhY1Fly2qrZHET+ULlmlqRRgY4sJRdPiG4RSrgZ961qSXad/ mQpbXwoQ2/pZ/8TXfbk0uPSwpwkLpix6NFe8hGFQ/g== X-Google-Smtp-Source: AMsMyM525hQagKYMIlOIdqQEy/Sx/ht089FGqr8YQw810BAnhG6hulq/sfu3BFpHCBMEkVy5m+xwSwFEwA0SvamrVJs= 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" Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 >