Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1157264imm; Wed, 6 Jun 2018 11:19:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKCcHFnffbYyKthsHt6bq8TJSgcBsurPyQsFAmBlnS/+zs7rZSSihjHemrlonQ+1a6ohNFC X-Received: by 2002:a63:b44f:: with SMTP id n15-v6mr3310735pgu.389.1528309191966; Wed, 06 Jun 2018 11:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528309191; cv=none; d=google.com; s=arc-20160816; b=koDVOlesINeGHOrnu0P7lRCWWqGJRjOzioZtBZPcblAxWVpXL4uyMzM/EjIP6FjAFy TTnRR+x2XNqPMbyAfvKb1HyJF0yxGZQuQf2d2SxEAO7xP9Lq45N6b4Q9iFX7v318wy/o nDPiSPYn0Cm9zcQ+J7yGDCo1Jj+minpJOsJTmGDAF3Nd/19sa2KOYpXDsEZOFjDdUqdT fb0ZNHENBKuYoVngiZ1a/F89z5D0PiVYLqelz5T1CJekZpv12f+C9CEkPwy36PLL8Zp8 svvBWKN8PRMgyO8lWJD7dMz9D2p2hUDYlRkqU1F9flCfxVVEyQgMiizDrh5sd1VkcoLs bSvA== 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=deajaan2133QVijKaqaF2q6PcweQYuezubVj+DA+5ohNO/Dc3zo2gq25tr5IoCg2nB IomxVghE0i3hUIb542ZrHX9pfARHW91tc9pxsueojF3ViTdtgMhz0QoYAr12UTLd6eVM sDUUmHAY62AUlsQXPqCxxjI9QsqqbsikFyRVIKcnXWn0dC3gMoE4x3vRtYxNJYF8uxwc FMokqQp0ZbtVgI4oIGnrNVBR6lbhznrTmudnXgv/tHe4i2OroqhrXAkCDEqZ6Gmc1QF1 lzhzw+qRDa658VuVKpo2uzAed2M5TI7l26OXXArcX5p+gY1lWn95NZMh+wThmjfx0Npx hQzg== 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 b13-v6si10417976plm.202.2018.06.06.11.19.37; Wed, 06 Jun 2018 11:19:51 -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 S932757AbeFFQXg (ORCPT + 99 others); Wed, 6 Jun 2018 12:23:36 -0400 Received: from mga17.intel.com ([192.55.52.151]:61007 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753454AbeFFQXd (ORCPT ); Wed, 6 Jun 2018 12:23:33 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2018 09:23:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,483,1520924400"; d="scan'208";a="62323475" Received: from chang-linux-2.sc.intel.com ([10.3.52.139]) by orsmga001.jf.intel.com with ESMTP; 06 Jun 2018 09:23:33 -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 v2 5/8] x86/msr: write_rdtscp_aux() to use wrmsr_safe() Date: Wed, 6 Jun 2018 09:23:16 -0700 Message-Id: <1528302199-29619-6-git-send-email-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528302199-29619-1-git-send-email-chang.seok.bae@intel.com> References: <1528302199-29619-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