Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp30232imm; Mon, 4 Jun 2018 12:26:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLKMYwxiNBc8z54RWJsXDkAAwUBH5W4eo7I6Jb79cVhLntKU/aHrCH7I7p8oWAgAfsb41rv X-Received: by 2002:a62:4ad3:: with SMTP id c80-v6mr758112pfj.23.1528140373068; Mon, 04 Jun 2018 12:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528140373; cv=none; d=google.com; s=arc-20160816; b=pjcH4Q3temYVGnUsanhjUyTBdrYyx3R8PIMugvpVA6p16bgPe013nhf03IWoQZy1MK V8SeX3933z0WbG13qo2OL7rk9AaKiyAgP75YW2j6NoVSxYHMfLtq5a2etV76XK/nXqP0 hOnLrp8b5Kx32mTCGHncA7u6RF4t07fy1sbvKbep0i4XhcwkTsqr0KR2+ysn99gedX3X cHR90Yq7pC6cj8vmmIz4o2KOYyo7mLISHO8nd+l4BxU05bhOaBrygP9Er0KiuBsbWhTr 6sw77GVjK0J4Sq53725OYb9XQt9WJ+3sECXoS2exBGBKtqOVQC21IzkIyojc4hgPmUXz 7SbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ho6Id80EmA+7cheYZDiNJvoDGy3/2VCNRv+qipPYzO8=; b=NWwig6rTHBqIzI5gj+f6qe2D5eV5Q71pla/r5+s3pWkaSy3TUKSzPktoMDnRapHTMG o+6hUDT+oEmFB5HYaytbj5a3WRMNXFGycJKC93/yK1o+tYovpfgcLcJ669Wn84LbD3tD Gw+l7SmEG1cmmQj1e7d7b8RNsfN7GSFwtDq4TcuBGhtA2L+FVOYSQDEWLukp2vNCu7PH Vq7EnSy+rypz7ol35RohUpBsIFmvd2IAGLU55TjnGppoMjP6fkdBY0TGTDU82h4bpBsN dqg3Am3TaeOJQytIpkyad2RrPr1v5nSbjQIu5bsIwqp1VHRD1oyCq+hKc3ektxi1oE+i 3G+Q== 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 b9-v6si8633584pfh.358.2018.06.04.12.25.58; Mon, 04 Jun 2018 12:26:13 -0700 (PDT) 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 S1751352AbeFDTYw (ORCPT + 99 others); Mon, 4 Jun 2018 15:24:52 -0400 Received: from mga05.intel.com ([192.55.52.43]:40503 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbeFDTYr (ORCPT ); Mon, 4 Jun 2018 15:24:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2018 12:24:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,476,1520924400"; d="scan'208";a="64240693" Received: from chang-linux-2.sc.intel.com ([10.3.52.139]) by orsmga002.jf.intel.com with ESMTP; 04 Jun 2018 12:24:45 -0700 From: "Chang S. Bae" To: Andy Lutomirski , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar Cc: Andi Kleen , Dave Hansen , Markus T Metzger , "Ravi V . Shankar" , "Chang S . Bae" , LKML Subject: [PATCH 5/6] x86/msr: write_rdtscp_aux() to use wrmsr_safe() Date: Mon, 4 Jun 2018 12:24:28 -0700 Message-Id: <1528140269-26205-6-git-send-email-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528140269-26205-1-git-send-email-chang.seok.bae@intel.com> References: <1528140269-26205-1-git-send-email-chang.seok.bae@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using wrmsr_safe() can make code a bit simpler by removing some condition check Suggested-by: H. Peter Anvin Signed-off-by: Chang S. Bae Cc: Andy Lutomirski Cc: Andi Kleen Cc: Dave Hansen Cc: Thomas Gleixner Cc: Ingo Molnar --- arch/x86/include/asm/msr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index 04addd6..09bec62 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h @@ -317,7 +317,7 @@ static inline int wrmsrl_safe(u32 msr, u64 val) #define write_tsc(low, high) wrmsr(MSR_IA32_TSC, (low), (high)) -#define write_rdtscp_aux(val) wrmsr(MSR_TSC_AUX, (val), 0) +#define write_rdtscp_aux(val) wrmsr_safe(MSR_TSC_AUX, (val), 0) struct msr *msrs_alloc(void); void msrs_free(struct msr *msrs); -- 2.7.4