Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp652224rwi; Wed, 2 Nov 2022 16:45:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZNMVbOwD5HZsmzWtIjlNPOvjWcfShkMnQLrukpV81m9vrTdzicjFN/coUcjuNQAAsjGn7 X-Received: by 2002:a17:907:2c74:b0:7a1:d333:f214 with SMTP id ib20-20020a1709072c7400b007a1d333f214mr26877276ejc.14.1667432759534; Wed, 02 Nov 2022 16:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667432759; cv=none; d=google.com; s=arc-20160816; b=q6apIH3KsUZu3c116QkuJwX7TMQ3FZWybOuKAUqnduSI0mZ8cP0A2v1khfwnBnnSLw w+OsQXixgvHIklPpoFMHqZ2rhToDTsVjvlACF5CFS49pk8jyrgoyKHUfvZun98IosEJv XCEI3ROkYV5zpv6MXQ/GSnLgax14h4R0iErY4ZtooF4H/F4S0C9HjMjhHaWxv283TDyL mC8qnFNIYVcYracRud6lUFBtsfr16rzR8WC7SGs9QpLsRf2fgdOw+kDIfmrkI2ouo7E5 sZD+nGyV8b/AwHQUIN3U5ba3rDgtJ+ZuIisQFid2YYrKG+qsd7DRwf/E+dp9oPcQrl+i nvJg== 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=gDhPLBi4i5H6cHaf8a2jrjVYop+4Ek8Lw09caIJYwao=; b=QmCvOk/WG4aMyvs8SrAc0RevPpwpb/UWjhilZ6gUVXlGrBCSvIpl3ko2SZizBQa/nS onGJG+Ju+c6gUzGqflBTVz+XdaqeC907+UterKqJYKNVbOfExUkLLuvGyVu9Znsx8M7Q WcIHpLYKP3vYTId5+J9KO/4RmXSf0+CLiybAwLB+F9zg7EJGXQB3mUvAoDJQBMvbUcmb dgzg+jwOqFmYsH9Huog6SFJpbFg1gOp1ETtGToJf8E/4Z/6/smAVPZzUXJX7FXRcHPOL wXCaay4RzVfOK5+zs95MIbgki7bj+Em3ktL20KrRMV8nxjf6P6huS+mye/TAlHHj8KLs 2jPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=TuudOMSX; 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 gs36-20020a1709072d2400b007879bb73291si17562614ejc.807.2022.11.02.16.45.36; Wed, 02 Nov 2022 16:45:59 -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=TuudOMSX; 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 S231316AbiKBXXY (ORCPT + 97 others); Wed, 2 Nov 2022 19:23:24 -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 S231221AbiKBXV4 (ORCPT ); Wed, 2 Nov 2022 19:21:56 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A88E21AC for ; Wed, 2 Nov 2022 16:20:05 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id o7-20020a170902d4c700b001868cdac9adso220374plg.13 for ; Wed, 02 Nov 2022 16:20:05 -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=gDhPLBi4i5H6cHaf8a2jrjVYop+4Ek8Lw09caIJYwao=; b=TuudOMSXAL7adsZOBmgYh538VYcYhWF5nhP0M4YVJQfWwg0r4dUZ36mJ33yxVd2Fh8 AhcLUX3yIkB9ibk1KInatQW3m5g/Xb1UjUv/pTYWyo/nNdUKM/jwJQkQp9VPPXPIpTse emwOM/6/Ktd+5NIL8TVzYVk2VxBsALjv/ypuxQqcHFi3jRRp2B55ZXqSfMnLEtC/HxSc stovQRZYEuaPtf2QjvJsPbzEyMHUcGd/vQxkSYwoxM9lz3prJOeJu1qYoXRdsdqvf9E7 tjo5AfcasIg3m/lx8wa0nQ72JaxhhT6f9hdOGOiYZcTNcwLRRLBhpjRIkPPAdq+gGp5w JrtA== 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=gDhPLBi4i5H6cHaf8a2jrjVYop+4Ek8Lw09caIJYwao=; b=1YwTt8fmTB5q/3yFxGeVAO/qwX889UM2s+E+ybaiRHPDqRhRAtndZXKN2gtAVLMITW k1AZG5PfAng1r5OL5ijwoJNksxttkWMvwgZ5RfAEUkx79TRyO9g5UfVDAokXnyAorL4d 6bFYB1r1hp3oWpAWnyfqmuGkkH0DM8TtcZus0qT22eO51gxc9xeo5VxF0QG3W+iLnUIl T3OoB4Kqwwxc0usRpEEgB3KZOo9AZ4eeVXsOueYvNcJrnQKKI5KlLDt/1yiG+VO29I1W RkOpYlT8V/93rfVlTvvG4ygkt5U8J3VQ5GlwpB+DBeMSCz9zyZayc63mi+WRBZQCp6Zn m8DA== X-Gm-Message-State: ACrzQf0mX9bePXU0562eCwQMYR+SC0tROJdN3sozzkJjpv59R9rPrsBA buZK61OOSeewO2zjM2GOlKynzYXRgOM= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:f28b:b0:186:b069:63fc with SMTP id k11-20020a170902f28b00b00186b06963fcmr27593726plc.38.1667431187773; Wed, 02 Nov 2022 16:19:47 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 2 Nov 2022 23:18:47 +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-21-seanjc@google.com> Subject: [PATCH 20/44] 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 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 Invoke kvm_mips_emulation_init() directly from kvm_mips_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(). 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/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 int ioctl, unsigned long arg) int kvm_arch_init(void *opaque) { - return kvm_mips_emulation_init(); + return 0; } void kvm_arch_exit(void) @@ -1636,6 +1636,10 @@ static int __init kvm_mips_init(void) if (ret) return ret; + ret = kvm_mips_emulation_init(); + if (ret) + return ret; + ret = kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE); if (ret) -- 2.38.1.431.g37b22c650d-goog