Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3400954iog; Mon, 27 Jun 2022 15:31:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v8eQC8hT83pvnd1WIOnmVWdZgu/lc0Pco3OzSivKwEMVkIWYsZvd/bJpSZZKttPxaEpP/S X-Received: by 2002:a17:903:1108:b0:16a:a0ab:8f89 with SMTP id n8-20020a170903110800b0016aa0ab8f89mr1763596plh.12.1656369114328; Mon, 27 Jun 2022 15:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656369114; cv=none; d=google.com; s=arc-20160816; b=o5DOmGPKBYWKfpS27vhZ90uE/uIsvGnNl806hVZudCU/D9M3cqRYK+nSV9omW5K7y0 51ooP8O4f0aYMuViC+zOwT5YS4mk6qEuj8OWMFODVcHWWrlQqDYeDBnfq7qyxKwZJXgz Pn5psrucIbvEVtxSwhMk2QdG7Kwdv27yNF/26A6wjTJagoY+CDhR76SojTlQa6jPM7o/ 0qHG0CDHtw3bQAOR+aIc2SgeYmDfMM9ohlbABuMNEQtaoXNtY/9W1gpHz+Ku9cluZMpO Yafru7fEG20mkgwS6+emGWNWRQ9yWzKToiF58IILT1TZx4/rtv7RJX0T3kJh1HS7QGPw AlUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5kprwyMC10j/0yi3URTwCF3bwzuTwh6c3zk4yZQegqY=; b=TmPwO20WcU0Np/OMCDZkghEcD0B6R1HoR8Wwu0Yhu1o4a9msEfGtKyU67khUM31OVr ecMPT1lr1GE/wKAW44lqSsNPbcMY3a/SQ4Erd1mIHOL0IEptq+9GfT74SvYlSJ2of8Pz cObfQNB0fOSVO52aZMKDSN90GxxFno4WWB67t8fP5fWsK2p5A79ODBMXxhiEbCa4IyVv jNKfl2ZPuIS/1LjkMGexgA5KEKRqj4DnldAqnylo+0iKMdtjrf6AjFFzhkDgUyAFEdIy 9zx0OThM7oNL4U0/HVK+NIPc7cIHM4SH4Mz7wPbxQ7NtmkygdG1Sxq3Ess8u5nvqtKQi AkGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DvkxLxFk; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm28-20020a656e9c000000b0040d3151251fsi16648731pgb.807.2022.06.27.15.31.41; Mon, 27 Jun 2022 15:31:54 -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=@intel.com header.s=Intel header.b=DvkxLxFk; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241387AbiF0VzB (ORCPT + 99 others); Mon, 27 Jun 2022 17:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240942AbiF0Vyt (ORCPT ); Mon, 27 Jun 2022 17:54:49 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E86FE6263; Mon, 27 Jun 2022 14:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656366889; x=1687902889; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pJ9tvLsAfdeU/ZCRyVdBo/dzzhl6SC3Ni3vJMWSlgKQ=; b=DvkxLxFkbnhAdt9tnz/VplsU33nnKOy+Q2g+r4S65dsbC/GJp1px5Kdw b/Key3ypcew1lrkxob3PDGSguiurm63pkdUy4HxnmrsxNqzeOC4PohB2I 9t1vb2hFK1NSTjSQ0TcYJN6IRUQeNoWDdH3d7+zeCW6/PNe4lE7yHGMO8 cJnmL2CzKHwtkQaI5KQ078wxkGvX2xSjDPxUa/QW6Va5c0rDAn4gJ0WVL 4WHdtrbc+iN3l0PH912k0NMO+/Q6Bj6fSb3Ew5QPBjqwNNxm/NH8RodyP sd2MedpkYLSlLBjV5vqwWExlS/6WQkq/jzrcRJPyPd1a01kNg2Spvj6vL g==; X-IronPort-AV: E=McAfee;i="6400,9594,10391"; a="282662708" X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="282662708" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 14:54:47 -0700 X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="657863433" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 14:54:47 -0700 From: isaku.yamahata@intel.com To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Paolo Bonzini , Chao Gao , Sean Christopherson , Suzuki K Poulose , Anup Patel , Claudio Imbrenda Subject: [PATCH v7 002/102] Partially revert "KVM: Pass kvm_init()'s opaque param to additional arch funcs" Date: Mon, 27 Jun 2022 14:52:54 -0700 Message-Id: <4566737e3c57c5ab17c0bc29d6f4758744b6eed1.1656366337.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Chao Gao 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 Reviewed-by: Suzuki K Poulose Acked-by: Anup Patel Acked-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20220216031528.92558-3-chao.gao@intel.com Signed-off-by: Isaku Yamahata --- 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 a0188144a122..7588efbac6be 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -68,7 +68,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 191992fcb2c2..ca8ef51092c6 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -446,7 +446,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 1549205fe5fe..f8d6372d208f 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 72bd5c9b9617..a05493f1cacf 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -251,7 +251,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 3d9dbaf9828f..30af2bd0b4d5 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -11799,7 +11799,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 c20f2d55840c..d4f130a9f5c8 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1442,7 +1442,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 a67e996cbf7f..a5bada53f1fe 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -5697,22 +5697,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; @@ -5740,10 +5732,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