Message ID | 20221102231911.3107438-23-seanjc@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp200903wru; Wed, 2 Nov 2022 16:25:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5cAOYHyuupOMqnsViD8udcQwBUFMxrvmPG5uZ0qO2wEmwTXSne53IjTNKf2ZXqt71uWw21 X-Received: by 2002:a05:6a00:1706:b0:56d:3028:23f0 with SMTP id h6-20020a056a00170600b0056d302823f0mr23848080pfc.59.1667431502719; Wed, 02 Nov 2022 16:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667431502; cv=none; d=google.com; s=arc-20160816; b=cO8vBN31bvT9vwfxCOT9ZkWoRFVfw4Nx8vh5o49cIz5dyzbfsDIwEDYvWt4u7s+ILC PH1Xt0shje5C//YadaML9c/7by66wAPq/UIR9UkxQ67wIQmCRfQs4S5Sx1RoT7FRLv/5 1SGFxcU9GgPl7R2S91NzQoWyORNeaUobQCdsqT5s1FOxw/XI8MpeuI1rDBCtNFvzKXt1 kWb4FHd5qTQ8bx3VjaNsuYAUg1eSMsWVRRUlJVjL56ZLzotb4/3t+gT30XriLBzA+l3v Qg/n5x0/RaJBIAvrSfvoF1pmdwqFvarEl/T6DIUKkEgzC5porIeWjdhy9Q5P5nLhDsVr QVWA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i129-20020a625487000000b005397c4ad9e1si5919107pfb.134.2022.11.02.16.24.50; Wed, 02 Nov 2022 16:25:02 -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 <rfc822;yves.mi.zy@gmail.com> + 99 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Wed, 2 Nov 2022 16:20:12 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-368036d93abso582267b3.18 for <linux-kernel@vger.kernel.org>; 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 <seanjc@google.com> 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 <seanjc@google.com> To: Paolo Bonzini <pbonzini@redhat.com>, Marc Zyngier <maz@kernel.org>, Huacai Chen <chenhuacai@kernel.org>, Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>, Anup Patel <anup@brainfault.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Christian Borntraeger <borntraeger@linux.ibm.com>, Janosch Frank <frankja@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Sean Christopherson <seanjc@google.com>, Vitaly Kuznetsov <vkuznets@redhat.com> Cc: James Morse <james.morse@arm.com>, Alexandru Elisei <alexandru.elisei@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Atish Patra <atishp@atishpatra.org>, David Hildenbrand <david@redhat.com>, 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 <isaku.yamahata@intel.com>, Fabiano Rosas <farosas@linux.ibm.com>, Michael Ellerman <mpe@ellerman.id.au>, Chao Gao <chao.gao@intel.com>, Thomas Gleixner <tglx@linutronix.de>, Yuan Yao <yuan.yao@intel.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748428655521009276?= X-GMAIL-MSGID: =?utf-8?q?1748428655521009276?= |
Series |
KVM: Rework kvm_init() and hardware enabling
|
|
Commit Message
Sean Christopherson
Nov. 2, 2022, 11:18 p.m. UTC
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 <seanjc@google.com>
---
arch/riscv/kvm/main.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
Comments
On 3/11/22 00:18, 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 <seanjc@google.com> > --- > arch/riscv/kvm/main.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
On Thu, Nov 3, 2022 at 4:49 AM Sean Christopherson <seanjc@google.com> 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 <seanjc@google.com> For KVM RISC-V: Acked-by: Anup Patel <anup@brainfault.org> 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 >
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);