From patchwork Mon Oct 31 01:37:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wanpeng Li X-Patchwork-Id: 9404957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E62560588 for ; Mon, 31 Oct 2016 01:40:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C88128DF6 for ; Mon, 31 Oct 2016 01:40:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F38928E3A; Mon, 31 Oct 2016 01:40:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C99028DF6 for ; Mon, 31 Oct 2016 01:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757623AbcJaBhP (ORCPT ); Sun, 30 Oct 2016 21:37:15 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36120 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757611AbcJaBhN (ORCPT ); Sun, 30 Oct 2016 21:37:13 -0400 Received: by mail-pf0-f195.google.com with SMTP id n85so7282703pfi.3; Sun, 30 Oct 2016 18:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hSrqBm+XuoBVrjo3lLB5tTQ6IQRO10zpL7Je/1L0x0M=; b=XBfnHrqWQzzMsGpchThSNyKqNiXk6tLG1lnHEiYuPCj0Q6BtVeUv1tqnW8npMW0tfB PhGrj0XuY1DrGU0ayykVd8YYZM0gNOCCieyQ+vCUngRCJFDcxifPVbuXjwkJgoU7CIAs wDZafhnswesfOnqZflioZPOKtgI70XClTxjsZpNyT8z+XGLGw48JKiReNq46nGTDc3Kk i6AWBOnmchfUkQhuBJm4dlnDm3sLCsh8gDy3ZBrXqtMbfHh1DYMiQisadrQHlbmHord5 6PySNdeTJ5unKY3oI/IypPpVjVLLts8+nHNC2YDzsXvA3WeRnqlP4Irg1RC9GAP3c/NS tupQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hSrqBm+XuoBVrjo3lLB5tTQ6IQRO10zpL7Je/1L0x0M=; b=UD2uOYsdjYj8gT1vSSdsvCqjnm9VpdyxtjZkhGmvjXNc/4pDgsi+Z2Hl3kbHvXKzPe tHmJzR/HKaFwjXmJHNVEDEnC8tqCndDzC8AQ1r1OBKhPERCvAtyjjn9wwCy1gfPnLWn4 E43Y+3MA4CgEv77fbY3A4Iut2sq2RZ42NgiuRSjXypPBWtHK8FukpgpppvQq5CVV8htk f2JdtglVcFgpvHWsEtw1dgSuaykuz6BEn/gYbFIRP5moWc3D+bIuYLYB79Qts/pYqa70 mbrOkO7cgaQSUxJZHZWdnU9I/TP9jOy+f6eJN6H103Ks2Gsar86x+jC3+CwT/eMRSCoQ TQBg== X-Gm-Message-State: ABUngvf+Xsr4eyVB3p58CXdFMZMS1ThrC5LdOEhbEa5keDapcoVVgzRkiDkilUSjVUERkA== X-Received: by 10.98.53.199 with SMTP id c190mr35824198pfa.63.1477877832226; Sun, 30 Oct 2016 18:37:12 -0700 (PDT) Received: from kernel.kingsoft.cn ([114.255.44.132]) by smtp.gmail.com with ESMTPSA id bz12sm9369804pac.13.2016.10.30.18.37.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 30 Oct 2016 18:37:11 -0700 (PDT) From: Wanpeng Li X-Google-Original-From: Wanpeng Li To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Ingo Molnar , Mike Galbraith , Peter Zijlstra , Thomas Gleixner , Paolo Bonzini , Borislav Petkov , Wanpeng Li Subject: [PATCH v7 1/2] x86/msr: Add write msr notrace Date: Mon, 31 Oct 2016 09:37:01 +0800 Message-Id: <1477877822-4437-2-git-send-email-wanpeng.li@hotmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477877822-4437-1-git-send-email-wanpeng.li@hotmail.com> References: <1477877822-4437-1-git-send-email-wanpeng.li@hotmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wanpeng Li Add write msr notrace, it will be used by later patch. Suggested-by: Peter Zijlstra Suggested-by: Paolo Bonzini Acked-by: Paolo Bonzini Cc: Ingo Molnar Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Paolo Bonzini Cc: Borislav Petkov Signed-off-by: Wanpeng Li Reviewed-by: Borislav Petkov --- arch/x86/include/asm/msr.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index b5fee97..eec29a7 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h @@ -115,17 +115,29 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr, } /* Can be uninlined because referenced by paravirt */ -notrace static inline void native_write_msr(unsigned int msr, +static notrace inline void __native_write_msr_notrace(unsigned int msr, unsigned low, unsigned high) { asm volatile("1: wrmsr\n" "2:\n" _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_wrmsr_unsafe) : : "c" (msr), "a"(low), "d" (high) : "memory"); +} + +/* Can be uninlined because referenced by paravirt */ +static notrace inline void native_write_msr(unsigned int msr, + unsigned low, unsigned high) +{ + __native_write_msr_notrace(msr, low, high); if (msr_tracepoint_active(__tracepoint_write_msr)) do_trace_write_msr(msr, ((u64)high << 32 | low), 0); } +static inline void wrmsr_notrace(unsigned msr, unsigned low, unsigned high) +{ + __native_write_msr_notrace(msr, low, high); +} + /* Can be uninlined because referenced by paravirt */ notrace static inline int native_write_msr_safe(unsigned int msr, unsigned low, unsigned high)