Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp651386rwi; Wed, 2 Nov 2022 16:45:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4y9xfXBk+QPImBo7Bo1CTiO2K64GOPcIhO5vqIr4Y4WWAS2rA9yXoMNWIdLugAKYlQ/NVZ X-Received: by 2002:a05:6402:414d:b0:451:73f0:e113 with SMTP id x13-20020a056402414d00b0045173f0e113mr27284171eda.207.1667432716635; Wed, 02 Nov 2022 16:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667432716; cv=none; d=google.com; s=arc-20160816; b=BmQCrPPYdysJr16FLFw2W8XMc9ocipOB8SjF4bvA5EPr71ytn6WrVcf6xM2iVbJDsk NewhjpyJQOOOcHIwryLqtSVWaFUMLKK01OtVaxnIe6GSlnw6S+6LAU6pyl8S9emM5kkc mbdYTPzdK5J+YivnpA11CnzFaIQ9W5TzvA0kYiSc3IpRU5nES3pl77QRokpbf5IsdYVZ Yy2eOaFwL8AuYblxOuNMmhpqONky/jSvsccvfL5DX0s4pIkIzvf8mcrbcPSozq6OlBzq NKapWwLKfbSUJe2CSGlGckMvGkPwcvMMEEzJNHXnUBJL/07UPssoLGCDQMeoaC9q1zUZ 8w7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=/lqn4M/Too7/hLjEdNjj07wzHVUwU9le6KZacsTk8SY=; b=lm7zoG828qog2vctZRdeAWVROWXuKZK3SIsyFbOVJRN9LVXDTGVEHn4okYxOwMc8oM fUSXPV8ePYZwQfRz/Xi+8tEISdrot0pg4QAIo4VTJca0UYUvzXhJUhAgnEhYXTziP8g/ AYLc6BPwD33ggbq99rqgIN4GOWaJ05viYJC7juNh7/wVzkImwTSFoYFOM/1QwVdnSwRw IlSdQJ3OwazcJaBI22aBobBz5T0IMbIn9xCHBUJLpremT+E2+MC8nw1s+iJeplh/LWkf DWlqMZYPhIF7xPD2/AKaiPcpxXOFoRkhrXyeIluhELFdQVtT7OpEaI8fQMA02TBTzEIf sADQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=jpZ4+tq6; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ka18-20020a170907991200b00791910ecd0fsi14572104ejc.540.2022.11.02.16.44.53; Wed, 02 Nov 2022 16:45:16 -0700 (PDT) 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=@google.com header.s=20210112 header.b=jpZ4+tq6; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbiKBXYa (ORCPT + 97 others); Wed, 2 Nov 2022 19:24:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbiKBXW5 (ORCPT ); Wed, 2 Nov 2022 19:22:57 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9C09B7F7 for ; Wed, 2 Nov 2022 16:20:12 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-368036d93abso582267b3.18 for ; Wed, 02 Nov 2022 16:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=/lqn4M/Too7/hLjEdNjj07wzHVUwU9le6KZacsTk8SY=; b=jpZ4+tq6rgM4hZWXweQJqfxuirRlrRpN+o4JwlpzpCNTf2A1sJCTA6DFTlQxCFhgbt sLPS4JguQacCAQKGId9cUa8Po003/wEsvkFZ2dOMw9iNk7lA7jWRoh5OFZzRfWNs6e3X DneEijHQrn4rLICnTKWJFk513kvZJ3K123XsKZ8FoBZdWOMtOvWDKENXD0/AJPQsCKjG rrWvKtMA58cnJHMchHTeytkk5Oc3RF3YtWKf69zqcXqxFh7WlsD0FI+Jf5mEVKngU/vv wyh2CqSaqQR9rkwiquK7nfr1sE2Ot7UFYqlBaM19WPnwV+Bbr0Tz+aWWsDk+unGGDNDW oUvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/lqn4M/Too7/hLjEdNjj07wzHVUwU9le6KZacsTk8SY=; b=rTfWodSyGNlXG2D0EUmdLCc961cIM3h2Eeji230edN9KmvabEVrElmPjkTCt5YrYYT OjJX/bbyxSqHDRU92FJJXPnsU9US1JHhSKSVlxviPdYhy7nAzgZfG+MbOzQw30i9VcG3 4Lz4uc+lZpTWFYNA61gBoFF+v4gr2zQ69P0rb5D2hbzIMH08JPWqBF95s6p0UL/HdIMb 5NoN42CW/ZG+9qGPe7pltVHEWSG713QP739CxXbdUxdhnw+6hJqux+6f0BvQ14DBAekS YvIjz/sJ28+EyHGS9l0+slEv5220hNvk4R5KTOblxMHJVdzJHKDzZlG3UiCG6r/wbxHt LI9A== X-Gm-Message-State: ACrzQf3eJmQ96jAdVwmeltgKW9yKVNuEQKnq13R114U47RD+f8g9yVz+ LK+eK05AQ6GhWpKQ0YIhBPb8NVAbyDk= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:e694:0:b0:6ca:2610:76fd with SMTP id d142-20020a25e694000000b006ca261076fdmr171916ybh.607.1667431191239; Wed, 02 Nov 2022 16:19:51 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 2 Nov 2022 23:18:49 +0000 In-Reply-To: <20221102231911.3107438-1-seanjc@google.com> Mime-Version: 1.0 References: <20221102231911.3107438-1-seanjc@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Message-ID: <20221102231911.3107438-23-seanjc@google.com> Subject: [PATCH 22/44] KVM: RISC-V: Do arch init directly in riscv_kvm_init() From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Sean Christopherson , Vitaly Kuznetsov Cc: 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=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 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 --- 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