Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3158024rwb; Wed, 30 Nov 2022 16:27:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5M6iwMdsk9nppHtI8etg1+E0gdHCntXwzTjcGqufBZ5F45WvhX6MgpcuDaJgTZCr9OvXKK X-Received: by 2002:a17:906:2345:b0:7ad:adfe:1ceb with SMTP id m5-20020a170906234500b007adadfe1cebmr45803000eja.89.1669854457263; Wed, 30 Nov 2022 16:27:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669854457; cv=none; d=google.com; s=arc-20160816; b=Ry2KoHWOuJ6dYPPg4WAOjKmV2eGG/OqkwKPHrFgAYAdsfifga85Y1BSWWMV4CnZFNh Yx6yL4xlX2Aar4T2APwWGncSH09wams8aUJ/iBK06H+2kL02kYFp11b6uBrLcHydw0K5 6G85J3zc72wel8nN/G50pM1FvhXjqxdnjo2Ip6ZjgcAxYwA0o6aTl0POT0dz1U4CRuEJ 0dnxAWlnJU4X1gpRAIhZd9ycf2/1Q2118R+PffepH7z9BhjKBJecg/iXji/2prNaWRsM Rvdo6+wNeaNnJuS+iTGbowEJV4qy3kpzBQR27KoO7+6ktM+ot5JcHD/nXSxZTxn2+5Y/ aBpA== 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=uj+BMG24gpugAApyuMjfHhGTokqhj/HfOHcPzx/7Ixc=; b=ndZ1S7ZWFq8v1BXGN2RZ+VCZJxms2QZ2nYF8FiwE9TG4jRnh07zfqclGfe7fgxkFnW +WMzMSzwep5W93is3MUKM8weDHvI8IzWuXST+lSkqyDiSOHXV/0hetJ1Y1MCSvm00npP JWsNIntGccPG+dxlYXZRNa02twFh+ozjWD/DcvRisIxVizFe9ZqSGNJ/lJf8S/H58Po3 Tfzoo/O/JoYcj9jdiwrRL3+0ysMsEClFIsAU6uQxA6kOyjb6oMgdXE6zsCbO31jgGfuZ FyElHFmr/A2rAiLQroSqFI4+3kA8CZ3bX3mntItT/gnvHW3UFvFydltFpF4aYlYekXuQ S5Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=rXveYksP; 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 q21-20020a056402033500b00459060fce1bsi2135772edw.574.2022.11.30.16.27.17; Wed, 30 Nov 2022 16:27:37 -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=rXveYksP; 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 S229897AbiK3XNT (ORCPT + 83 others); Wed, 30 Nov 2022 18:13:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbiK3XMd (ORCPT ); Wed, 30 Nov 2022 18:12:33 -0500 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 679F89B7B0 for ; Wed, 30 Nov 2022 15:10:32 -0800 (PST) Received: by mail-pg1-x549.google.com with SMTP id l186-20020a6388c3000000b00478410026bfso84752pgd.10 for ; Wed, 30 Nov 2022 15:10:32 -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=uj+BMG24gpugAApyuMjfHhGTokqhj/HfOHcPzx/7Ixc=; b=rXveYksPcbHAdLQWx0Se3mgCcQvIusgWV2YBwsk350kO+gwstaEEoshUZTFpuvac++ pLds7vX8HQyFV+EXcCsNs4Huph1CvEcQOXAAAxG85uCm3rCCbxscdft2ZxjRveL1foHX Lrax89MRhf3bE1bAwMOLphkpziYLo/XzKTjZtkj0KrWsaZWT2gVodfm1c5joltsrB5eF W0icMxnX0hgljPZjSz6UkymZcq3fcWnGh4feMzJb8fuOAJykHj0A+tcjteTkrK4SYiHc +b7l66OJ0teH4JUbB2xCLD5wxFKLZ8CELPJsM7W7cN4l69kYm6xFX8ZvCrFTJGzWVhEq HM9A== 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=uj+BMG24gpugAApyuMjfHhGTokqhj/HfOHcPzx/7Ixc=; b=6jtbORmMU0aEwv3Gfa+0U6yzWKCj0RxUBMXiNfwGVXodDLlv4rzIxIdGMblj6JFsx6 a3P9qU5RP3V4KD5x9FP7F7zsu+QLLhzkYkppkZShAPCNCB3yEWU8psyB7xu5vT8CpPWv lz79ZRNPdvvEGtotGbGojwDZB7vcEuqCRVuKCFegFUSZPvVFKqj1H35i+GE0O3Sc6BI+ SoP+kqU9yK50co13Xjh1Ztq9/KBW0PXy1TVpKWmslAPwnu0v4ZTBKswyTovwiwkR7tqo JZyNyNv5Ui0n8HFoNE2ie+tALyzfZbaKg4hIlTK54+vcDVtAABbGogWNetyZQQvDhlZ7 8UeA== X-Gm-Message-State: ANoB5pnfR5vsmHoBqqsZhOSzLcOR69UEdm6lp9h1a9WyLnTLPWL/g8BK CR8jeZE3+LMF33COomMVqysfyF7glIA= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:1624:b0:573:993b:ea6d with SMTP id e4-20020a056a00162400b00573993bea6dmr46050829pfc.10.1669849814934; Wed, 30 Nov 2022 15:10:14 -0800 (PST) Reply-To: Sean Christopherson Date: Wed, 30 Nov 2022 23:09:06 +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-23-seanjc@google.com> Subject: [PATCH v2 22/50] KVM: MIPS: Setup VZ emulation? directly from kvm_mips_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 Invoke kvm_mips_emulation_init() directly from kvm_mips_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(). 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 --- arch/mips/kvm/mips.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c index f0a6c245d1ff..75681281e2df 100644 --- a/arch/mips/kvm/mips.c +++ b/arch/mips/kvm/mips.c @@ -1012,7 +1012,7 @@ long kvm_arch_vm_ioctl(struct file *filp, unsigned in= t ioctl, unsigned long arg) =20 int kvm_arch_init(void *opaque) { - return kvm_mips_emulation_init(); + return 0; } =20 void kvm_arch_exit(void) @@ -1636,6 +1636,10 @@ static int __init kvm_mips_init(void) if (ret) return ret; =20 + ret =3D kvm_mips_emulation_init(); + if (ret) + return ret; + ret =3D kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE); =20 if (ret) --=20 2.38.1.584.g0f3c55d4c2-goog