Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp165789ybv; Thu, 6 Feb 2020 20:21:06 -0800 (PST) X-Google-Smtp-Source: APXvYqz9Ma58G7KmVKoUZSSNplDRcjG5sLyB8sSSkMvVMNClCHwz6MT0irnPC8PJxxAXcN1AQREx X-Received: by 2002:aca:c256:: with SMTP id s83mr852521oif.57.1581049266300; Thu, 06 Feb 2020 20:21:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581049266; cv=none; d=google.com; s=arc-20160816; b=Wu9KtznEzTU6K4ekhJFNRBnQSJnehUQ/UvUBFswBqk71T0KihYB9+KdumhgLHOtvhN CB1mPlFA5CUddMCflWNgoG8C33PBPbLjLKpId8jG5ZxU3T2dzPhiCil26wBL7q+exk9Y B9rDTWjVr5zrcjOfgIiYQ6PXufKvd+GAV1CXPC+8gCxHn7xs3wzXN8gW8vHcobCrpVEE hIMP8Fj3ZysAJWk5lwPcdM9oc+uUk8voqjxEFF0FMImxuBQXtK/VoVpL+Lk7GelIQlu+ FRljwdHDjtky4bdubwClutyTaw//22BkMUj/EgGuzrd8H2c//DxA4f56Lw8YQp4v36gO Qzmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ev46U6iBOib6o9q8Qh8+dDicovJUIR8jQU2YCK33vLQ=; b=kVRlmj7pvrL50pqd76J0NNxBjed39KLRnB56NefTBqlo8hpFzQdQU7rOHODnN/ISgE y/9SouqjI1nURziNUbaB26QQMSZss3Kft/uWwUIDzWDbKmfqYy/Dc9AThqgyWI3KIoYO ZUodNgADd8A7o9Mzpsr5PPl7hX82BQUZ9u/WJBdOOfTMiti6L4oz+7EoaP22t6Et0v4F OjZjVkBfDqFOdlp4u7DcPt1JxZhTOIBSlTp6EYp/Fys5riA7fWtGaUPkt/VHDtBNCnDo ERqstYulVcZlWvlJ+s+vB/LLaj1hFbnqJ4xnoUaWGOLcrFuvHAeU5ZLxTKDVdLi45YKP brIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si3484764oih.154.2020.02.06.20.20.53; Thu, 06 Feb 2020 20:21:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727441AbgBGESu (ORCPT + 99 others); Thu, 6 Feb 2020 23:18:50 -0500 Received: from mga06.intel.com ([134.134.136.31]:62270 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726956AbgBGESu (ORCPT ); Thu, 6 Feb 2020 23:18:50 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 20:18:49 -0800 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="225254696" Received: from xiaoyaol-mobl.ccr.corp.intel.com (HELO [10.255.30.164]) ([10.255.30.164]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Feb 2020 20:18:46 -0800 Subject: Re: [PATCH v3 3/8] x86/split_lock: Cache the value of MSR_TEST_CTRL in percpu data To: Arvind Sankar Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , hpa@zytor.com, Paolo Bonzini , Sean Christopherson , Andy Lutomirski , tony.luck@intel.com, peterz@infradead.org, fenghua.yu@intel.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200206070412.17400-1-xiaoyao.li@intel.com> <20200206070412.17400-4-xiaoyao.li@intel.com> <20200206202346.GA2742055@rani.riverdale.lan> From: Xiaoyao Li Message-ID: Date: Fri, 7 Feb 2020 12:18:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200206202346.GA2742055@rani.riverdale.lan> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/7/2020 4:23 AM, Arvind Sankar wrote: > On Thu, Feb 06, 2020 at 03:04:07PM +0800, Xiaoyao Li wrote: >> Cache the value of MSR_TEST_CTRL in percpu data msr_test_ctrl_cache, >> which will be used by KVM module. >> >> It also avoids an expensive RDMSR instruction if SLD needs to be context >> switched. >> >> Suggested-by: Sean Christopherson >> Signed-off-by: Xiaoyao Li >> --- >> arch/x86/include/asm/cpu.h | 2 ++ >> arch/x86/kernel/cpu/intel.c | 19 ++++++++++++------- >> 2 files changed, 14 insertions(+), 7 deletions(-) >> >> diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h >> index ff567afa6ee1..2b20829db450 100644 >> --- a/arch/x86/include/asm/cpu.h >> +++ b/arch/x86/include/asm/cpu.h >> @@ -27,6 +27,8 @@ struct x86_cpu { >> }; >> >> #ifdef CONFIG_HOTPLUG_CPU >> +DECLARE_PER_CPU(u64, msr_test_ctrl_cache); >> + > > Why does this depend on HOTPLUG_CPU? > Sorry, my bad, It should be under CONFIG_CPU_SUP_INTEL