Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1300567rwn; Thu, 8 Sep 2022 17:19:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR6nRVkoN4CYILhq36w1flsD4A6mLhZ/JHzPIRZjroXs1UKhEqv+gXYRQKKNtJcj65UDfdWy X-Received: by 2002:a05:6512:168a:b0:492:ca8a:ae6f with SMTP id bu10-20020a056512168a00b00492ca8aae6fmr3766268lfb.533.1662682777538; Thu, 08 Sep 2022 17:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662682777; cv=none; d=google.com; s=arc-20160816; b=p+Y4kFxT+r0R2iNzPFSeh6vnpfDOK1zDl87s+8pqDRfV08gUD91TAtj7f4dUgSDuVT rwrNNaPOqGcZ6bRE8Ih6uJwfkh+TMhhpyOSg+sSa7TI4aLhRGKYa9OwpDFc330ZhTJIB fPYDtUWsA/2PVC/TDrd8mE7CBkTSStNi2pf2tYjZ3qznM3mnohHsCxw3tmx747EO3XZg Ct5QgSMAK62HANJVwoXxLCSXTBkqu9zRI7OKETeXySHCErHsoKIY/t7Tf3yLQDBqv8H8 2hPJRrKAm3+bWA37LOV+3YAlhFNQF/yMkhhjt59Gb3dqaNriVdeNc/Vr4+OpKQf4SQ9Q 7BQw== 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=b4cCi8Ji4tpnAkO3DlLMxcaXegpyFELNA6j0WFQEtmw=; b=vLihSI0BtvR6Qvgj5gXNTAu65rwNLFFc/F55/KpLu6TmJ7/F4qN+ldHEQ5MuWurDTo ts0e6tRl5HCaYHr8o0Hbc/W/9fGAg5Lqw5TJh2XnZNir855Ttp6PkR+huttH3BxNVKjk +cN40djiJfU1eTIv4CprgjUNXpGjtlCFwvMeVz7s/rRBQsknbTaUSUKbcqalIxOSIdbH kqETKl6m9ay46E4rqNf5cwYQIbJSF6l4T2PNkQh8K9H5tHw+1P6q5/j37T4qnRvC5Zfe R9jALaSuf6h4esS1zp0KU/yXoh8B34iebOaowzh9lUNL/0T0tZzn4h3MlqIrsClRhyS8 5sYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Q39K/vKE"; 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 k5-20020a05651c10a500b002643046536bsi150179ljn.91.2022.09.08.17.19.08; Thu, 08 Sep 2022 17:19:37 -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="Q39K/vKE"; 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 S229985AbiIHX0L (ORCPT + 99 others); Thu, 8 Sep 2022 19:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiIHX0H (ORCPT ); Thu, 8 Sep 2022 19:26:07 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1AEAE3D77; Thu, 8 Sep 2022 16:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662679564; x=1694215564; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q5um5aONO7+CjLGrGHvgwAkBekvzLE2bkGPRvzcCfEc=; b=Q39K/vKEvmoLdphyj5URhVrc7L6IN3NR2ZaSHlcy5nMlEcip1OK6rrOD PZhMCzEd6E8NwPDe8lbWEvtyK/U3Fk3HhYUk7ehg8jdDrEPcQ3kr9ZaKJ MV3ZtRDIEjCvpUEHjafPgPxL5BV8HtxdcNRFgSidqAHJcZ2GbImO5WiKp oUSvDeLYUe55e9kUvZNFUIs3puNmqmyz+T5ly9NwjP8rHf23PYlZn64hu kqsgsA9sijWdHoP7GVy0lzWPrj+NHmLohywhqFJsFgUkqv0UENA5laWli apAHA6QudqTxL0XUATQKBUBqxAhNDg8e9wHB9IohqwA5dTO5+B+yAJogY Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="298686973" X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="298686973" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 16:26:03 -0700 X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="610863144" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 16:26:03 -0700 From: isaku.yamahata@intel.com To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Marc Zyngier , Will Deacon , Yuan Yao Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Kai Huang , Chao Gao , Atish Patra , Shaokun Zhang , Qi Liu , John Garry , Daniel Lezcano , Huang Ying , Huacai Chen , Yuan Yao Subject: [PATCH v4 02/26] KVM: x86: Use this_cpu_ptr() instead of per_cpu_ptr(smp_processor_id()) Date: Thu, 8 Sep 2022 16:25:18 -0700 Message-Id: <199c87dbdb8d3ec10e650c4919709257e887ba1c.1662679124.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.4 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: Isaku Yamahata convert per_cpu_ptr(smp_processor_id()) to this_cpu_ptr() as trivial cleanup. Signed-off-by: Isaku Yamahata Reviewed-by: Chao Gao Reviewed-by: Yuan Yao --- arch/x86/kvm/x86.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 73dccc952dd1..0368eab6a7b5 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -428,8 +428,7 @@ static void kvm_user_return_msr_init_cpu(struct kvm_user_return_msrs *msrs) int kvm_set_user_return_msr(unsigned slot, u64 value, u64 mask) { - unsigned int cpu = smp_processor_id(); - struct kvm_user_return_msrs *msrs = per_cpu_ptr(user_return_msrs, cpu); + struct kvm_user_return_msrs *msrs = this_cpu_ptr(user_return_msrs); int err; kvm_user_return_msr_init_cpu(msrs); @@ -453,8 +452,7 @@ EXPORT_SYMBOL_GPL(kvm_set_user_return_msr); static void drop_user_return_notifiers(void) { - unsigned int cpu = smp_processor_id(); - struct kvm_user_return_msrs *msrs = per_cpu_ptr(user_return_msrs, cpu); + struct kvm_user_return_msrs *msrs = this_cpu_ptr(user_return_msrs); if (msrs->registered) kvm_on_user_return(&msrs->urn); -- 2.25.1