Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4135413rwe; Tue, 30 Aug 2022 05:21:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR72oZNLC5ezjB7n3TzM0d7kULC1Sxs0FRbXwHYzmsahzWBvmivbRcPT2C2ZlTtyuMBzRgCL X-Received: by 2002:a65:6417:0:b0:42b:2f13:8477 with SMTP id a23-20020a656417000000b0042b2f138477mr17725050pgv.329.1661862107158; Tue, 30 Aug 2022 05:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661862107; cv=none; d=google.com; s=arc-20160816; b=XgZqg2fFtvATqYCIhfooLHJ52i0Lhf4FstZMGmygucddTLsTYxIcG/Uqxxis0z/PIG O6VTFDa2DWvPJgEvFmWApYUAfVTd3Q6+Y2SyA+3ZFkoIQDe1wmGTIwlptgnE0/kjStMR XXQvZu79N8jWfoJNdOO8d7gsa593c8uRVKS92vWmgeB9yPy4nE0ubAU4GeTu+aH0WIBT ouL39dGGlMcIKuQQ+eJg61d3LFX0x/Taxe20a812ZGEzJmgiV4Nvx6mvSh7/XZv9yU8Z xqskV2GzKnSuEe90s29g7RjzzvPPDozOrVxJ+OMxr0tVpoK42IxAxCgg1Mz8W/JV0QE6 z6YA== 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=wBSG8623spB/PmG9QabV92hoiTX9lvME7Ulq9MMNwkA=; b=pUV0snWCerc3F/qpUYnfxC4VhxYsVLvDQ64KB1z91Wg9ZHdS/0NmM9uf4wGzi4090o D4lyYs8RRLf28bmwKrUXHO6XKeOpJGc2nMsaF5F/HLD8RueR/24kIodyzoO6OedAClNq +mtmsHlt0lVahlbLq3KOwl6F4Xd+TGXSn5wr9Qk8ClBPyLE7I4gQrAQWi+nW9cFURb4Y dEsMZFKbOxj/GkXSIjG1wsbUuFcG6/aOKrfhbcNQ2ZbT4XY3MACnB1pv0aGfNRxXXD8n LyYX/Y6DQWbEFihCzlm0yf75CGrM/PO2oGn7Un0+cjjU8RH6r7PNgOdj++levn339UsZ ldtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LaHzgX5H; 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 u11-20020a170903124b00b001713e8ccf07si13968998plh.376.2022.08.30.05.21.34; Tue, 30 Aug 2022 05:21:47 -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=LaHzgX5H; 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 S230221AbiH3MCG (ORCPT + 99 others); Tue, 30 Aug 2022 08:02:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbiH3MB5 (ORCPT ); Tue, 30 Aug 2022 08:01:57 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94525E5892; Tue, 30 Aug 2022 05:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661860916; x=1693396916; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uz16PyoQFhukf/H8M5ipcGMQZYTZukV44jdncTSqdg4=; b=LaHzgX5HONWfv61ahX7wnCj6Q+1pZNS0ESF5VHjD/+XIMKA/lJJaG34+ U/2AgSY7ZldcDo8WpEeyUBR0uBZbhBmsTb4EsH44St6tyfN79R6ZRv1Xb pb/eHAwl0iXaREcjo7wzclG6bW6VUiRLgXQXkNmaNjwIbhbh0tmvN/xly xQOLIxPUVeOypN3lD3/C2K1Rfod5yc3KcUVyKy86D8zCG8J75/6wuqU/Y gJjuwPlFObFAneVVSg3OQsP/yDGbejJySaqm1ZZSfAOAIGcYDBG9xlSiE IHKTIfmUkr0A+p9HIgpQ1SHWW05rrykRvC6iX47TuXx7Lt7DxYPKobb/J Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="356870956" X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="356870956" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 05:01:54 -0700 X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="787469613" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 05:01:54 -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 , Sean Christopherson , Kai Huang , Chao Gao , Will Deacon Subject: [PATCH v2 02/19] KVM: x86: Use this_cpu_ptr() instead of per_cpu_ptr(smp_processor_id()) Date: Tue, 30 Aug 2022 05:01:17 -0700 Message-Id: <920dfe48e7255c2224a799386d720f34b4479e1a.1661860550.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 --- 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 16104a2f7d8e..7d5fff68befe 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -416,8 +416,7 @@ EXPORT_SYMBOL_GPL(kvm_find_user_return_msr); 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); struct kvm_user_return_msr_values *values = &msrs->values[slot]; int err; @@ -449,8 +448,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