Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1204804rwb; Thu, 22 Sep 2022 11:31:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6A+TozLxUFa20jx2t3O498PnTfvMy/PJV4XCxZOA8ozwMRVGa38ltjnLrzVBfsKoN0ZzAM X-Received: by 2002:a17:90b:3852:b0:203:a68c:9a7c with SMTP id nl18-20020a17090b385200b00203a68c9a7cmr16970017pjb.119.1663871503417; Thu, 22 Sep 2022 11:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663871503; cv=none; d=google.com; s=arc-20160816; b=UwcTGtDY1BXEDNDpsGtSVAkhZbHXVMPs1qB/h0B4htJ6O/uJpRsWGzhmuKF009ch0k AQPifov83E7gNdv9kvmaidlEVgKxSPmGtJrW6EJW5D0WLeu08lAxY3RwoEyMxlk5v+6c MGYSnW4e5mLJrOw+PHhPmVOHuHR2YuJyTSy6OYHsVqaMkrwhdfetxBs4HthFtAaEGQVD hxjRW+OE7ucscq3osN7HxnnAVKrZsY6chD5drMpmUwsKwkvMQZoNWQJPZDACKC06pn+q 7r8ahkXsGrqtcn9b/KZqgJFrP4OiJ0nZv7Yfo/XLbRfOQvCwToWwW0syPeNB0JxSXpDE zQPA== 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=UE6za4IQBriSXYlqnKZjseY4/c1ee/w7t0IHj8Y4In4=; b=Af1igUE3k3X8I3qpfEk9xlDBe/DWOR/DrQ7bKAsJmEyo3/7i5oRbAaGCPAfJsrWGij V2PhgaxNM0qHxFDaVSrrVQeUqy7g+GvCpAUOk0ShsXyNpJbrUbc7Zkswwp6087sxAkY6 zC/tairTeCCg825qN3e+eTCrgT6lv1Obj+Cyog40JndhkfG/QyAvIL+qwI6pqDobifjV BTeuiErAphpMYJjPM70juBJOnRC+y82Act2qUxxQftV1zoZn8yKilRLfjX1kVCCwIFZA dRAFlHsV5CM7kz7GJaUoQv37Z/wku/IsPmNc/FiuJbNWRm9+I9EVqa6+vFB5pjR3VrGB rLig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hrQVtJDy; 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 c27-20020a63725b000000b0043417e65cb7si7239616pgn.347.2022.09.22.11.31.30; Thu, 22 Sep 2022 11:31:43 -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=hrQVtJDy; 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 S231856AbiIVSVb (ORCPT + 99 others); Thu, 22 Sep 2022 14:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230161AbiIVSVW (ORCPT ); Thu, 22 Sep 2022 14:21:22 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC7F210AB0F; Thu, 22 Sep 2022 11:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663870881; x=1695406881; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FvgmsUs8lZSxyh4Y20DUAz52tAJaGD/FMSGQt1yYizU=; b=hrQVtJDyWatL6xxGM/5SfG8asl7eIXjGs78PNuYijbsN0guws9YqjR0Y mzrumyZPkpTmgSTH9r0SutGOVJ+51Uahzjj/5S2FimO2z5BOVkXlO9QMg /QNDXdYD2KSnL9GpMIrqduQBN8/CKeMFev8mJl8pF31DDPT00dJSe7smi lHdJv6Imfax3kCaZ61DP0T52pRuqSL4B0LltcutnjyWmlpt8bHV5OnWO5 gkyqRmdV0p61Jmpeui5bZA0/GeVX4d7gtThwDkJuJxs+Mh9YYgygrIFcx 1h0C6QcKNKxYixL54qUv1FYIeDxUz9wvusirzlRbu1sc5qn25oDi22bhA Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="386675930" X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="386675930" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 11:21:13 -0700 X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="653086630" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 11:21:13 -0700 From: isaku.yamahata@intel.com To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Thomas Gleixner , Marc Zyngier , Will Deacon Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Kai Huang , Chao Gao , Atish Patra , Shaokun Zhang , Daniel Lezcano , Huang Ying , Huacai Chen , Dave Hansen , Borislav Petkov , Yuan Yao Subject: [PATCH v5 02/30] KVM: x86: Use this_cpu_ptr() instead of per_cpu_ptr(smp_processor_id()) Date: Thu, 22 Sep 2022 11:20:31 -0700 Message-Id: <851653aeb7230572e5b41cc617e89eeae38be24b.1663869838.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 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 9e1b3af4a074..7fc19533a484 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