Message ID | 20221102231911.3107438-21-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 l7csp200646wru; Wed, 2 Nov 2022 16:24:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46un/l8EUbOhgrCMT2+f5HMhGDrims4JiXMUxQGjKmZbbZi1rOq+K0MeRn3JP9bW1RLCt7 X-Received: by 2002:a05:6a00:23cc:b0:56c:12c0:aaf7 with SMTP id g12-20020a056a0023cc00b0056c12c0aaf7mr27654157pfc.0.1667431463408; Wed, 02 Nov 2022 16:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667431463; cv=none; d=google.com; s=arc-20160816; b=SWpZr18gFahtcLRl4idXeshfNjPJlgZHC3Dx1PU8By86gkMGj8hlXjDgbhBj7T6Tb9 zaFQc+CXd1pUYVwug4LXU0aHyKDsW3BoCybxtoYVAs8N5jMr8xVI15rk9O3TBwX9PDV1 /EN8+3n0sR0TdhOcTkpNLjWFCqRfHRcv9myyecHdsJAQUCD48/wAr2Bd11+lijcmeAI4 C4/8TdxsgyoBnWONPHAEQEI+39pzyGReLDhhmAoG3aJjoEQhVNgp/AVmFvOFZGPCfJgH qnonusKA/fDvhzT8eEQyj87Z1dweugtfCgi0b8wVMonwVvBp5PGfW1xWY61yo59j6PeP oJ/Q== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t17-20020a170902e85100b0018729febdaesi12287484plg.122.2022.11.02.16.24.09; Wed, 02 Nov 2022 16:24:23 -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 <rfc822;yves.mi.zy@gmail.com> + 99 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Wed, 2 Nov 2022 16:20:05 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id o7-20020a170902d4c700b001868cdac9adso220374plg.13 for <linux-kernel@vger.kernel.org>; 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 <seanjc@google.com> 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 <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?1748428613664790877?= X-GMAIL-MSGID: =?utf-8?q?1748428613664790877?= |
Series |
KVM: Rework kvm_init() and hardware enabling
|
|
Commit Message
Sean Christopherson
Nov. 2, 2022, 11:18 p.m. UTC
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 <seanjc@google.com>
---
arch/mips/kvm/mips.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Comments
On 3/11/22 00:18, Sean Christopherson wrote: > 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 <seanjc@google.com> > --- > arch/mips/kvm/mips.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
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)