Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2684185rwb; Sun, 4 Sep 2022 22:44:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR4qnvTTlrGpc6C82x991A0LZkYDsFp0fu9CZrGYpw4amFdtxRL3eU+257pDhkClz+RfpjJ9 X-Received: by 2002:a17:906:5a64:b0:741:3586:92f with SMTP id my36-20020a1709065a6400b007413586092fmr30517111ejc.721.1662356665266; Sun, 04 Sep 2022 22:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662356665; cv=none; d=google.com; s=arc-20160816; b=ARlm59g4a0fJv5GfO9oGCM//lQPIC8SY9gRjDuNu1KjOxybMkOuAGOPYjHvh6nxP+/ isnPpbLrR4CeIycBn1j8+g+USjuMdL4wYbyuAUsCRUcyIi3bE0zKPsBO6OyFjaS6mmQ2 0fKEyT+E8+UubdMRUnAy2rjkC61FDXPSTLEqdafZDUX4XbFCgTL/pEruiggTbIK6g6Dj E89XCDomy9zfjUKh6GfNmz23sjK2T5SJDZNBnXWWScPP1K2WFssFKRI1eJr9xMPw0GfZ dHfng14X1ocO014nYM3qG6bPur0goSvQN4ZgBLNZBHO95Ig5yvUGwLdLrAiKjgu5/Pg1 WsRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ESO6wND2Dqk/ghcaP2AtueyoRATFHffPJVR5PfmPW/0=; b=BivhBarMUGBvPPJh63jWt8YNs9KHZMef8uiwlGRwvhZnJ4fzLpEheozSjabTM9LQQc TFPbTLYd1WIr+LXcKjOdC+FcILXuAKfYbr4zbRmOCwwlOEeKMhZv+6TOClhZXalccB5q E3rO29QX7kyRoMT9eBxMg55vs19Ox9g8Hkk7W3TjQ+8V05RMH6Ou+U/BH/1xra+dzLSH PlnYkvqk3b4t9qCQFq/BzU7EwnyodtfbbX4PjoXZWIHgavbM26xWy5GJLPL+bLrABNXP HBaAb6NxclWDN1BEBR3eLHBKqdhYtyq7dV3tkppFioSYl2T8zsB3fx2yYEPqQiRouMT4 m7vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bsf3rf+e; 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 z13-20020a05640240cd00b00448aec620e0si8147784edb.17.2022.09.04.22.44.00; Sun, 04 Sep 2022 22:44:25 -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=Bsf3rf+e; 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 S235420AbiIEFgA (ORCPT + 99 others); Mon, 5 Sep 2022 01:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231744AbiIEFf5 (ORCPT ); Mon, 5 Sep 2022 01:35:57 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41F4526AE6; Sun, 4 Sep 2022 22:35: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=1662356156; x=1693892156; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=cQMxScv/eSJNt080rZxewyQzAxe+pGTLshbySipJkFo=; b=Bsf3rf+elELLZMq0F188ifDEtI3Ee18X9P08UsjEHAg1NPZcxRbROW0x nRIDExjnnQMctf6hjBNn5192QlaR9WZMesifHrtOZSH4F1MDygRJVLAVX YSybHm52EfQdFB6ZIldzzEdHEELUidh8RLjEgKyG8nLtHXWQ0ZJUS3aZk 7tbhCyjXlw1kS0cVQLfGBJMddjOglucXgyEuEv6U+ZrzQyANKBq1xexDD k14TdwssCAM8bGH2G0Dpu9DHV9R8NuE0pcVl1JDAFCNQEMqiyWeRjz/3X 75zfimHqmc4nb04NzrAGCu05NrHz3CfgQCwJf+drxKzqZWanAqzppd7u/ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10460"; a="293893746" X-IronPort-AV: E=Sophos;i="5.93,290,1654585200"; d="scan'208";a="293893746" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2022 22:35:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,290,1654585200"; d="scan'208";a="609565717" Received: from yy-desk-7060.sh.intel.com (HELO localhost) ([10.239.159.76]) by orsmga007.jf.intel.com with ESMTP; 04 Sep 2022 22:35:51 -0700 Date: Mon, 5 Sep 2022 13:35:50 +0800 From: Yuan Yao To: isaku.yamahata@intel.com Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Thomas Gleixner , Marc Zyngier , Will Deacon , isaku.yamahata@gmail.com, Kai Huang , Chao Gao , Atish Patra , Shaokun Zhang , Qi Liu , John Garry , Daniel Lezcano , Huang Ying , Huacai Chen , Dave Hansen , Borislav Petkov Subject: Re: [PATCH v3 02/22] KVM: x86: Use this_cpu_ptr() instead of per_cpu_ptr(smp_processor_id()) Message-ID: <20220905053550.ltovrnpu6tlxqje3@yy-desk-7060> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 On Thu, Sep 01, 2022 at 07:17:37PM -0700, isaku.yamahata@intel.com wrote: > From: Isaku Yamahata > > convert per_cpu_ptr(smp_processor_id()) to this_cpu_ptr() as trivial > cleanup. Reviewed-by: Yuan Yao > > Signed-off-by: Isaku Yamahata > Reviewed-by: Chao Gao > --- > 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 0e200fe44b35..fd021581ca60 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 >