Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp29827imm; Mon, 4 Jun 2018 12:25:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKTU/ujPN4AZqOmOVtn6UaPJCzuBoQ1woqB8xNYYQh9qED/kXVACoK9XzDOTjPkwe2oFd95 X-Received: by 2002:a17:902:aa48:: with SMTP id c8-v6mr9390817plr.132.1528140342590; Mon, 04 Jun 2018 12:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528140342; cv=none; d=google.com; s=arc-20160816; b=m18ZGxBT0JrS3ezmYGZrkWpKJUbPXaHvhxDluNrJ0E7zescTHeq/DDnRxH9WoYw2Jt km1QS2Tp5r+Y0gcdTNyDLhc1cb0t2re+mYFo9Jex48gQl2vcF24XBiTi4YNpPOC6T/wR 5jeK7pDRg8CLJUnJ5jzpEfhANL+i8zWuJGleu1+BZFebJgDTOc+7PS+tMZ2nG3okeRMN QEgeanTHwMoKSWOhwmyl4B6gDj6+jmlRQNHfMo1gfymb1bSMmyOxnLI4mAlM77+t5aWE x5chRQJFvo42JFT2h3lXygolVILZgEKpGMH/m49ZvnLv7WriNn2VC0IAP+opG1iXx0fM Dnkg== 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=cdjjnO3MY8xL4D5xMhBP0OobmPZGZdYRDT/wTZevvEk=; b=BSYz4QQ52d4zDaI/uMIFxnpZDXEB+8FlyrFB/pv5QR7GcQ5JA/EZSl/rKbW3qGgHdo xgXwPkDz63v346/NlGWDjoa6/P5LM23xHUTZq5uBUasL6QZPiDPtQiPCvcKCQoGETk9s VV69kWk0MQd9Urs31Sl3jryDWj3xiw9tWcjIYOTwiZv2bd9cUZR4W81GSYYjSWeXK6KR 7NGPXy/qVDLiGqSGW975PkY94Hd9yF/BThlGnOxnq0nIT8ZCT2KSuQg0lqSQ4yCkonPW 6jDo88gb/tvNB53UyHqHIQxUD5zXVyr7Mnrsk7fyTuei/yNMtUCNzStB7eIZ6DeMpAOk DCfg== 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 e11-v6si4782682pgt.63.2018.06.04.12.25.27; Mon, 04 Jun 2018 12:25:42 -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 S1751424AbeFDTYz (ORCPT + 99 others); Mon, 4 Jun 2018 15:24:55 -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 S1751135AbeFDTYq (ORCPT ); Mon, 4 Jun 2018 15:24:46 -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="64240681" 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 3/6] x86/fsgsbase/64: Use FS/GS base helpers in core dump Date: Mon, 4 Jun 2018 12:24:26 -0700 Message-Id: <1528140269-26205-4-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 When new FSGSBASE instructions enabled, this read will become faster. Based-on-code-from: Andy Lutomirski Signed-off-by: Chang S. Bae Reviewed-by: Andi Kleen Cc: H. Peter Anvin Cc: Dave Hansen Cc: Thomas Gleixner Cc: Ingo Molnar Reviewed-by: Andy Lutomirski --- arch/x86/include/asm/elf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index 0d157d2..49acefb 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h @@ -10,6 +10,7 @@ #include #include #include +#include typedef unsigned long elf_greg_t; @@ -205,7 +206,6 @@ void set_personality_ia32(bool); #define ELF_CORE_COPY_REGS(pr_reg, regs) \ do { \ - unsigned long base; \ unsigned v; \ (pr_reg)[0] = (regs)->r15; \ (pr_reg)[1] = (regs)->r14; \ @@ -228,8 +228,8 @@ do { \ (pr_reg)[18] = (regs)->flags; \ (pr_reg)[19] = (regs)->sp; \ (pr_reg)[20] = (regs)->ss; \ - rdmsrl(MSR_FS_BASE, base); (pr_reg)[21] = base; \ - rdmsrl(MSR_KERNEL_GS_BASE, base); (pr_reg)[22] = base; \ + (pr_reg)[21] = read_fsbase(); \ + (pr_reg)[22] = read_inactive_gsbase(); \ asm("movl %%ds,%0" : "=r" (v)); (pr_reg)[23] = v; \ asm("movl %%es,%0" : "=r" (v)); (pr_reg)[24] = v; \ asm("movl %%fs,%0" : "=r" (v)); (pr_reg)[25] = v; \ -- 2.7.4