Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3173648rwb; Wed, 30 Nov 2022 16:43:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf6QwomqjH5fzEcIiUr0QjI1ciZxC1/DNwW1TTjnrnNPCrXrbS8pVh7Nl//Z9zJeq0QNFhWi X-Received: by 2002:a05:6a00:2444:b0:558:991a:6671 with SMTP id d4-20020a056a00244400b00558991a6671mr45380664pfj.58.1669855402341; Wed, 30 Nov 2022 16:43:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669855402; cv=none; d=google.com; s=arc-20160816; b=kgFnTaoV7ILZpwdCSGwG8kJwDdN1UjrH70MYVO3MXREWZfmQ5pAbXPJaV2MQxnnYyw Qq4QMNpRyZgbwlZSMxD6r8mawCRUbflFVuT6AB4mZE2OBjEp+YRwTZM7HjqRbXxOcpEE 1sI3YQwgGzgnfTsZtESAXihsSBIkL/VTiA8XYlJbkCFZH6a0rybTgDvUMZfdbwnrju4g swKqMmALmYVdaNKBQMAXJnJ8t725HXH/mCm4S4vQSW8fDGq7YwfPzUGfJPgAm4862Q0E qOK22ueoDn9yU6DVw0OqQa4bSA5yGY5s7VLZsqXQjppAZZ5BnS/lM9NKP0wbxYPFwlfx Pohw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:reply-to :dkim-signature; bh=5yXQhNujyCn0BKG7v31c4OGaNv+fuibQffzvzfRXOMY=; b=gDlGO9nnEAqS4H3peJ8YSILq67YVk2TmEzRtZm3lTvd4Zv5nNnoMZdezLLJEpen2mR RQ97/WBASMPyBTU9HMlhCWsNEicpVZp1k7D5ZBEmH0rvm7Q+DokoJ3ouHuCw38GhWk0q GKfijMpnHYd66LFvEyWtX5SEis5SBoENEIM2fkqcuzjWoiIsgEn4cLIVzIugGzOhSx4J /FKseaXovU0Aa2xc8lLpxZVm3cSGaIXZ/n2UWulBHeM9jygV1+BqQpHPO3bV/+f05p9a D+93F8Lbscd007mqSNDe6giZeCTXwxP8F32e5kT9oFMt0UZryjsEDEXGZBh01YfGh1lz J6mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=h6rsUUCp; 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 u62-20020a638541000000b0046f72960506si2810000pgd.422.2022.11.30.16.43.11; Wed, 30 Nov 2022 16:43:22 -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=@google.com header.s=20210112 header.b=h6rsUUCp; 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 S229988AbiK3XNh (ORCPT + 83 others); Wed, 30 Nov 2022 18:13:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbiK3XM6 (ORCPT ); Wed, 30 Nov 2022 18:12:58 -0500 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C22C9C62E for ; Wed, 30 Nov 2022 15:10:40 -0800 (PST) Received: by mail-pj1-x1049.google.com with SMTP id k7-20020a17090a39c700b002192c16f19aso209895pjf.1 for ; Wed, 30 Nov 2022 15:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding: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=5yXQhNujyCn0BKG7v31c4OGaNv+fuibQffzvzfRXOMY=; b=h6rsUUCphQInF8YIuJSydp7y3K+kWTxAbyRCfeyJQKJ+Y6qbtiTSAEs1qGlDllqT/J MMyCWI1z6QQ9M7p7Zu6QpSl/9m1uIwFhUqPqC0VY2dNxBAtSmKEBK4CCdgkZqO6Ul8Kx fACOhEYDJb6v1xuMAezabk8g2ZSsJuhT+lDS/T3ozQuYyR/lRYpg7LUF046Tas5T+NY5 CeL2ERbYxquxucrniWQA910RogetkvuImYcNKj0ET57pNLum/MqlKCc6KP+V5OUAEk8P PnX37vQ/dZrpTC3Oabzm833Uf9cuKd5yhE1OeJVb9W6pQwUrjh0B5ijm+gc3WgDVn+HL 6XjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=5yXQhNujyCn0BKG7v31c4OGaNv+fuibQffzvzfRXOMY=; b=11kldaleCIWDlWPis30BDA3D+hqfYO2aUMIzwEAMvA5hmsNCxqaoohEVc6aXiu4XO/ o1HfehsRbYOZpaEFBpc3Rv6nYmLd8Hrw31FzVZO2iaktSzKxq1NgkMOgiNySGxYQtlGK K9b20sNuj7l61rAJTUIlnGXlOOSjilGoekV3wWk4E8LZ7wLdYsIMQsxuw2B8CGJlbOca nv0LZS6ViwNq6eVM+VqhLV7dUYR637+grwiL+Ek3McnWuD9wZigr0N34X1ptbDbQam7G 0ZTT9BWpMW4PMy1lSplGaSBPldX0MlDoFeVJf8OJ5PEuvK4MWAKFn5HTxzLp9ETfLDlm ud8Q== X-Gm-Message-State: ANoB5pkpD9HLe1S/utd58ufnGdYep8aM0ujBsbc3uhCaOYOGIbDAMQc4 iN890M2uTc5mk8+fjOJis6Ww8Ut25Pk= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:ec8a:b0:188:640f:f400 with SMTP id x10-20020a170902ec8a00b00188640ff400mr45576276plg.143.1669849818577; Wed, 30 Nov 2022 15:10:18 -0800 (PST) Reply-To: Sean Christopherson Date: Wed, 30 Nov 2022 23:09:08 +0000 In-Reply-To: <20221130230934.1014142-1-seanjc@google.com> Mime-Version: 1.0 References: <20221130230934.1014142-1-seanjc@google.com> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog Message-ID: <20221130230934.1014142-25-seanjc@google.com> Subject: [PATCH v2 24/50] 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 , David Woodhouse , Paul Durrant 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, Yuan Yao , Cornelia Huck , Isaku Yamahata , "=?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?=" , Fabiano Rosas , Michael Ellerman , Kai Huang , Chao Gao , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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()=3D>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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Anup Patel --- 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) } =20 int kvm_arch_init(void *opaque) +{ + return 0; +} + +void kvm_arch_exit(void) +{ +} + +static int __init riscv_kvm_init(void) { const char *str; =20 @@ -110,15 +119,6 @@ int kvm_arch_init(void *opaque) =20 kvm_info("VMID %ld bits available\n", kvm_riscv_gstage_vmid_bits()); =20 - 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); --=20 2.38.1.584.g0f3c55d4c2-goog