Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp599854pxb; Tue, 15 Feb 2022 23:22:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDW50g4zT2u3CNZMvS5QxyUouuPwQcpFEdDur32gRxo2VBb15nJhaqk3mrWrLRWr8emgUo X-Received: by 2002:a65:560c:0:b0:34e:2e6:542c with SMTP id l12-20020a65560c000000b0034e02e6542cmr1244092pgs.90.1644996122174; Tue, 15 Feb 2022 23:22:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644996122; cv=none; d=google.com; s=arc-20160816; b=FHj9R9kiZOLtkQnveeY/OosJ6K45kAQPrMeGv1OQarsU/nxNxOi9XQGzmvTKp0OvdH zySni7rVMd3YUBkLj7pn0YZdc7PKhgM1jLQC1agubvS7hvJVRBPVIBNr0DwvrWUPRMJG 5NqLkUWI7mVNh1L0+R8CyVxERIQHbn6+1YVnUs+0K4fwJxbOKmASIdmiQaoVzPhqKaz9 nB9ClfuodoMuo9uSiyZuWNZdz3hde5xSGkY/uSbcbcsk9b+ts+gOWJoIOpD5jj+I18QS ZuoKtC4BgKeStIGlwioIUFzsjnd9FXhL3b4xvDPYtPxK20hxRWynogFyu+9gVpeKr5A6 VyTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jwhFIm2pjxqH4S1QMmhp69WD0Yx/q3G7DzS41sze+Fs=; b=Mt4BtobZfBczqqI1swENAcJTSf7Yo1dzRCbljtcfLDBoNDsp5mLtuyvBKzIt2pLpcN FCMEUnwzdkHMSL7T5z0hAXJlf4wouYfhcOsRKCle756BMJAfTCl3gb+/4xg152QsP9aS Xt5y2+h8hL8nO9MrOy7/cxzhKZk0Q+m1CHWfMSqLmmdn8uiIoJTH8RQrm6JTE0ykLW4J rD6e7HWkW64Fr82YyGEXTkpp6aYazzxfwpm3qqk3r+K5Eu66QGHe6M6OY+1Mie8nFN7h +CUcMkiANIxbjA7EJDmGMrAAbxkNhzQ84G76fyID0eO3bLlfcSc01y6E9wjSLjMtfKDX 3bcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b="riYhJ/NF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r3si16094261pjd.45.2022.02.15.23.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:22:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b="riYhJ/NF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 086BDFDFA1; Tue, 15 Feb 2022 22:52:06 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243544AbiBPD0Z (ORCPT + 99 others); Tue, 15 Feb 2022 22:26:25 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiBPD0Y (ORCPT ); Tue, 15 Feb 2022 22:26:24 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAFD0FEB32 for ; Tue, 15 Feb 2022 19:26:10 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id x3-20020a05600c21c300b0037c01ad715bso649084wmj.2 for ; Tue, 15 Feb 2022 19:26:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jwhFIm2pjxqH4S1QMmhp69WD0Yx/q3G7DzS41sze+Fs=; b=riYhJ/NFDeUTP+27duj6KaHVTshaiOQWoiNe0wD5HsocnEG4P2zjeu1WJJDyF+7tg8 HCeN+YgLtAuAqFdXC5u5r4J1kreE47Ve+t4e9Tzc3e/bR6dW6cfCEx+AULlAjs0UFA7b 5iYtqizK/2DbwQ3MdQzFC5ShahlfHXfxfbRTyv3sjEKEHhbO96isAQ/oJlBBafJ4RfO6 Ik2sa+YCrQVXyZRleWwPOmZS9xfiQMBjan/DE793V7AulbEAwpf909pO0yRuMLybh51Z HNPSzg49iXmvLcs5NFrZBcGz1w3jwq6ATwFOagq0fPdiZtS5k3qPuXa39lc6+Ewfq3Uz nhCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jwhFIm2pjxqH4S1QMmhp69WD0Yx/q3G7DzS41sze+Fs=; b=NA5Y5R/XGxmMoAMYgqmP3N0YygCPNquckYyJ8Q183vPSbce9XtUVcYXzH1A0Hc6jLo zKTGfmFnXUNaFNZ08crEUrN68W+oABtEBnB0zyRAF+XbQRaX+tYlNC0svXD45v1RLVob RT5UhRWKQ0K5Mhj28wg0+unp1Lz/yW+ojF9XPdZvV0V1dxSUGB7YxoPr6AKzJOzDM38o LNvXVywIdSFNKP95F3wtR5Goc3eOT1resbXabXzdLEPb1Dl7jn7tycxZAsxi9c35bA+5 IXjoZ7ZLaAfDaCjzmlYWhw8HaPy5ciO5GsO9lZQxI1LcFxUHQhmkSujP30zdpGTKnygR QT2g== X-Gm-Message-State: AOAM532/iewXHkRKY/bSJQs5HqYsdkPhhX6w8I0V5dE1CpQpAGHkTsVs CqN74V4YUsZyeph7K1wotiPsRGexmAn6RXP+ckmq3A== X-Received: by 2002:a7b:cf16:0:b0:37b:c4c9:96c6 with SMTP id l22-20020a7bcf16000000b0037bc4c996c6mr683144wmg.59.1644981969162; Tue, 15 Feb 2022 19:26:09 -0800 (PST) MIME-Version: 1.0 References: <20220216031528.92558-1-chao.gao@intel.com> <20220216031528.92558-3-chao.gao@intel.com> In-Reply-To: <20220216031528.92558-3-chao.gao@intel.com> From: Anup Patel Date: Wed, 16 Feb 2022 08:55:55 +0530 Message-ID: Subject: Re: [PATCH v4 2/6] Partially revert "KVM: Pass kvm_init()'s opaque param to additional arch funcs" To: Chao Gao Cc: Sean Christopherson , Marc Zyngier , KVM General , Paolo Bonzini , kevin.tian@intel.com, Thomas Gleixner , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Huacai Chen , Aleksandar Markovic , Thomas Bogendoerfer , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , David Hildenbrand , Claudio Imbrenda , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Sven Schnelle , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Maciej S. Szmigiero" , Bharata B Rao , Nicholas Piggin , Nick Desaulniers , linux-arm-kernel , kvmarm@lists.cs.columbia.edu, "linux-kernel@vger.kernel.org List" , linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv , linux-s390@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Wed, Feb 16, 2022 at 8:46 AM Chao Gao wrote: > > This partially reverts commit b99040853738 ("KVM: Pass kvm_init()'s opaque > param to additional arch funcs") remove opaque from > kvm_arch_check_processor_compat because no one uses this opaque now. > Address conflicts for ARM (due to file movement) and manually handle RISC-V > which comes after the commit. > > And changes about kvm_arch_hardware_setup() in original commit are still > needed so they are not reverted. > > Signed-off-by: Chao Gao > Reviewed-by: Sean Christopherson For KVM RISC-V: Acked-by: Anup Patel Regards, Anup > --- > arch/arm64/kvm/arm.c | 2 +- > arch/mips/kvm/mips.c | 2 +- > arch/powerpc/kvm/powerpc.c | 2 +- > arch/riscv/kvm/main.c | 2 +- > arch/s390/kvm/kvm-s390.c | 2 +- > arch/x86/kvm/x86.c | 2 +- > include/linux/kvm_host.h | 2 +- > virt/kvm/kvm_main.c | 16 +++------------- > 8 files changed, 10 insertions(+), 20 deletions(-) > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index ecc5958e27fe..0165cf3aac3a 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -73,7 +73,7 @@ int kvm_arch_hardware_setup(void *opaque) > return 0; > } > > -int kvm_arch_check_processor_compat(void *opaque) > +int kvm_arch_check_processor_compat(void) > { > return 0; > } > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c > index a25e0b73ee70..092d09fb6a7e 100644 > --- a/arch/mips/kvm/mips.c > +++ b/arch/mips/kvm/mips.c > @@ -140,7 +140,7 @@ int kvm_arch_hardware_setup(void *opaque) > return 0; > } > > -int kvm_arch_check_processor_compat(void *opaque) > +int kvm_arch_check_processor_compat(void) > { > return 0; > } > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 2ad0ccd202d5..30c817f3fa0c 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -423,7 +423,7 @@ int kvm_arch_hardware_setup(void *opaque) > return 0; > } > > -int kvm_arch_check_processor_compat(void *opaque) > +int kvm_arch_check_processor_compat(void) > { > return kvmppc_core_check_processor_compat(); > } > diff --git a/arch/riscv/kvm/main.c b/arch/riscv/kvm/main.c > index 2e5ca43c8c49..992877e78393 100644 > --- a/arch/riscv/kvm/main.c > +++ b/arch/riscv/kvm/main.c > @@ -20,7 +20,7 @@ long kvm_arch_dev_ioctl(struct file *filp, > return -EINVAL; > } > > -int kvm_arch_check_processor_compat(void *opaque) > +int kvm_arch_check_processor_compat(void) > { > return 0; > } > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 577f1ead6a51..0053b81c6b02 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -252,7 +252,7 @@ int kvm_arch_hardware_enable(void) > return 0; > } > > -int kvm_arch_check_processor_compat(void *opaque) > +int kvm_arch_check_processor_compat(void) > { > return 0; > } > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 9b484ed61f37..ffb88f0b7265 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -11509,7 +11509,7 @@ void kvm_arch_hardware_unsetup(void) > static_call(kvm_x86_hardware_unsetup)(); > } > > -int kvm_arch_check_processor_compat(void *opaque) > +int kvm_arch_check_processor_compat(void) > { > struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index f11039944c08..2ad78e729bf7 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -1413,7 +1413,7 @@ int kvm_arch_hardware_enable(void); > void kvm_arch_hardware_disable(void); > int kvm_arch_hardware_setup(void *opaque); > void kvm_arch_hardware_unsetup(void); > -int kvm_arch_check_processor_compat(void *opaque); > +int kvm_arch_check_processor_compat(void); > int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); > bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu); > int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 83c57bcc6eb6..ee47d33d69e1 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -5643,22 +5643,14 @@ void kvm_unregister_perf_callbacks(void) > } > #endif > > -struct kvm_cpu_compat_check { > - void *opaque; > - int *ret; > -}; > - > -static void check_processor_compat(void *data) > +static void check_processor_compat(void *rtn) > { > - struct kvm_cpu_compat_check *c = data; > - > - *c->ret = kvm_arch_check_processor_compat(c->opaque); > + *(int *)rtn = kvm_arch_check_processor_compat(); > } > > int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, > struct module *module) > { > - struct kvm_cpu_compat_check c; > int r; > int cpu; > > @@ -5686,10 +5678,8 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, > if (r < 0) > goto out_free_1; > > - c.ret = &r; > - c.opaque = opaque; > for_each_online_cpu(cpu) { > - smp_call_function_single(cpu, check_processor_compat, &c, 1); > + smp_call_function_single(cpu, check_processor_compat, &r, 1); > if (r < 0) > goto out_free_2; > } > -- > 2.25.1 >