Received: by 10.213.65.68 with SMTP id h4csp40845imn; Mon, 19 Mar 2018 18:53:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELtlojxhDD8yrscfdWlXdviXF6GU+5aURoC1SrIWOEquuFqXGN9QeGzv8WfLq1cKHHfx/7XT X-Received: by 10.99.101.5 with SMTP id z5mr8240217pgb.301.1521510811517; Mon, 19 Mar 2018 18:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510811; cv=none; d=google.com; s=arc-20160816; b=1K4uWq0l1Myxb3dQ/t0Xye8+r/WfDHEYi3kS69dVPjw5TTV6KxMisMoHS3JtPAejU1 ZuLqBynJZFG94ws8aA/VhkRKcC6jap2nCLWhE14nzg+r7QmCB9X8UpsuHdvYb98bJcJ7 2/NZUywWasTAZoc/mtdvPT6kdqGwY9JC6J5RSxiGdbyGlam1lyk5mGxj4/S5zXM5XUTB 6eGlDhvmZ1Og4BqbhxhmxM2KQ49ccX+1G51e0NL8pn2spAStZWUQLzcVV5/EK8wkepYZ LK+p5g15RiVOQKEIgxpEQ9ggN3FhVwH5/wqNR1Ir5v9dfRZGiAk3wTVdrCnxiO0wARtV q5gA== 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=te2LfQrku775jUdptdB1gmYPW4AydeVfBhrIT+H2UFo=; b=edv8wrUf65gK4ZGDDlJABiEXRUmTYYEUhdXfta+V8cvjfMwjVUOSX3cppsGuFsBwWL HmEkoUgrNE4uPpAEpyjU3veIRFctzkWbSUuVVJ908jB2l2oCFx8uJz+HmR9WBzUXgFPh pplm6RQ5AfdHQ9qEt/9htQyhsVXUZn9E/JShRFtKpqEh3ecpOKiV2egBqsYEyc/73Bzc WQMCLHFjPOwAnczZx6WqB1sie3+HzvhjzLXYPxftrGCRzyRmYElGT9olTGiLBqDuqbLO ol0wnTR1nEu4unMa76cKk0/iH+Fki7lIgiWxAAaw9uT57Ibe98997+q6Ak1WOlsAE2q/ fFYg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n28si395278pgf.284.2018.03.19.18.53.17; Mon, 19 Mar 2018 18:53:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S971842AbeCSU6c (ORCPT + 99 others); Mon, 19 Mar 2018 16:58:32 -0400 Received: from mga14.intel.com ([192.55.52.115]:62509 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965566AbeCSSIv (ORCPT ); Mon, 19 Mar 2018 14:08:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2018 11:08:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,331,1517904000"; d="scan'208";a="39330566" Received: from chang-linux.sc.intel.com ([143.183.85.144]) by fmsmga001.fm.intel.com with ESMTP; 19 Mar 2018 11:08:50 -0700 From: "Chang S. Bae" To: x86@kernel.org Cc: luto@kernel.org, ak@linux.intel.com, hpa@zytor.com, markus.t.metzger@intel.com, tony.luck@intel.com, ravi.v.shankar@intel.com, linux-kernel@vger.kernel.org, chang.seok.bae@intel.com Subject: [PATCH 03/15] x86/fsgsbase/64: Use FS/GS base helpers in core dump Date: Mon, 19 Mar 2018 10:49:15 -0700 Message-Id: <1521481767-22113-4-git-send-email-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521481767-22113-1-git-send-email-chang.seok.bae@intel.com> References: <1521481767-22113-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 be switched to be faster. Based-on-code-from: Andy Lutomirski Signed-off-by: Chang S. Bae Reviewed-by: Andi Kleen Cc: H. Peter Anvin --- 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..2bdd38f 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_shadow_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