From patchwork Thu Aug 10 17:26:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 9894333 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 923CB60236 for ; Thu, 10 Aug 2017 17:29:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79B6A285F0 for ; Thu, 10 Aug 2017 17:29:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D2AA286CF; Thu, 10 Aug 2017 17:29:16 +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=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1AB542867D for ; Thu, 10 Aug 2017 17:29:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfrEb-0007h1-I6; Thu, 10 Aug 2017 17:27:01 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfrEZ-0007en-S3 for xen-devel@lists.xenproject.org; Thu, 10 Aug 2017 17:26:59 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id CC/D7-01729-3679C895; Thu, 10 Aug 2017 17:26:59 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPIsWRWlGSWpSXmKPExsXiVRusrZs0vSf S4PZNaYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPl7h8sBX/ZKm7M+s/awHiLtYuRi0NIYDqj xNqHTYwgDovAKxaJ7nsHwTISAv2sEh83zGbrYuQEcuIk5i55xwRhV0rsOfKRBcQWElCS2LphK TPEqH+MEm93f2IHSbAJaEnsaZjPBJIQEVgqKHGy9RrYDmaBFiaJJ/+2gY0SFnCTuDF9OdgoFg FVicaeV6wgNq+ApcTOE01Qq00knrROYgSxOYHi05bNZIZYbSEx9ddKpgmMAgsYGVYxahSnFpW lFukaG+glFWWmZ5TkJmbm6BoamOrlphYXJ6an5iQmFesl5+duYgQGWD0DA+MOxgmr/A4xSnIw KYnyFn/qjhTiS8pPqcxILM6ILyrNSS0+xCjDwaEkwcs/rSdSSLAoNT21Ii0zBxjqMGkJDh4lE d6tU4HSvMUFibnFmekQqVOMlhxNH7Z8YeKYdGA7kHw14f83JiGWvPy8VClxXmuQeQIgDRmleX DjYPF4iVFWSpiXkYGBQYinILUoN7MEVf4VozgHo5IwryvIFJ7MvBK4ra+ADmICOijCtxPkoJJ EhJRUA+MKqYdr+PbPqP3p+dl3beY1YaM9+5f4u/XlN6vzvn5sZ/5rm0uy55TM62qne5avr/ja c3m9LOdBFsb4z71GGUoavaWx+zbmXrzem3rIsthS/v+ja+qKu/icVTeIiNz8fHDNpfWCv8tWv 8icNz/Eds6WeRZhXRctZmyYrrt6fd00174tfiXMSduVWIozEg21mIuKEwGfRx7WwgIAAA== X-Env-Sender: thgarnie@google.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1502386017!91246785!1 X-Originating-IP: [74.125.83.43] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64153 invoked from network); 10 Aug 2017 17:26:58 -0000 Received: from mail-pg0-f43.google.com (HELO mail-pg0-f43.google.com) (74.125.83.43) by server-13.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 10 Aug 2017 17:26:58 -0000 Received: by mail-pg0-f43.google.com with SMTP id l64so5397685pge.5 for ; Thu, 10 Aug 2017 10:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mBrgigOZ++Fz56c2isXtglsiWkpOhuRw2dTPklpkhmE=; b=i4SC78rVJxvjSyvor7RguGIdKFrbdO7UtzSYriLx2cS0Dhc4XOknh1J6YISH/5x1ox 6TnczgBXYDbGFBFJr3RkA5bhVB8rNWxaE5Zj3WfcK/PVF0QRID7N/xSvCLvNacpwJpNG 2mnVnNM0g7AGiSBOnojvy9EB2C2bkXBiUKR8C9iVd88q8qGcQjxYWGrciEu4PIMWzJ62 eQY3t4+fqn4gswelZXSXHyDfnoxVMMxRzgxu9jpaFXhVhHrn1rAfMHP3AivQrbaInXab lO6G7pvAveRukHwxeT8C9Grn6hxA50bz9v0KEIzhqnwlgZt+nHbU1qkB09av4oNHG7bq I+jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mBrgigOZ++Fz56c2isXtglsiWkpOhuRw2dTPklpkhmE=; b=XjnpfDz9152h05JW+PHKRE3qhHjIafccBNpdkxR7nXmhNyftC5gBxSvjJmbz0wR6UT cWN6ZZi6yfLMGhQSCUPkigQDLVAzfDrOYjJ6BeY0GJ9YZpVST7bAnTaKxb8BbHabtyDs psav5a8yzNMvHhhqb6l5NDdyL5cW3djxoBGwa10boREl8ns6Swp5+8VJWaCbWUzkduPj fzyTwxeI3+sasxJKbQJ43BkL40WYcPhAyJVwtOsLhKtVPV2WWDdTQLTg5pRjJhSXDUTU GUFlat2rAJHSLe3501Eg+EWrH6Ym8Du++5tMz/TsjBF7pWLjYrwzbTA5xEnQMj2AeJvm fqZw== X-Gm-Message-State: AHYfb5gYnKFQJAelHM8JEwLwjema/fbHXSdkGojDzvicpYS+KUKPqz72 yOW5ivBgF00bHDCa X-Received: by 10.84.236.71 with SMTP id h7mr14213252pln.348.1502386016385; Thu, 10 Aug 2017 10:26:56 -0700 (PDT) Received: from skynet.sea.corp.google.com ([172.31.92.33]) by smtp.gmail.com with ESMTPSA id p77sm11894925pfi.153.2017.08.10.10.26.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Aug 2017 10:26:55 -0700 (PDT) From: Thomas Garnier To: Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Arnd Bergmann , Thomas Garnier , Matthias Kaehlcke , Boris Ostrovsky , Juergen Gross , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Joerg Roedel , Tom Lendacky , Andy Lutomirski , Borislav Petkov , Brian Gerst , "Kirill A . Shutemov" , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Tejun Heo , Christoph Lameter , Paul Gortmaker , Chris Metcalf , Andrew Morton , "Paul E . McKenney" , Nicolas Pitre , Christopher Li , "Rafael J . Wysocki" , Lukas Wunner , Mika Westerberg , Dou Liyang , Daniel Borkmann , Alexei Starovoitov , Masahiro Yamada , Markus Trippelsdorf , Steven Rostedt , Kees Cook , Rik van Riel , David Howells , Waiman Long , Kyle Huey , Peter Foley , Tim Chen , Catalin Marinas , Ard Biesheuvel , Michal Hocko , Matthew Wilcox , "H . J . Lu" , Paul Bolle , Rob Landley , Baoquan He , Daniel Micay Date: Thu, 10 Aug 2017 10:26:01 -0700 Message-Id: <20170810172615.51965-10-thgarnie@google.com> X-Mailer: git-send-email 2.14.0.434.g98096fd7a8-goog In-Reply-To: <20170810172615.51965-1-thgarnie@google.com> References: <20170810172615.51965-1-thgarnie@google.com> Cc: linux-arch@vger.kernel.org, kvm@vger.kernel.org, linux-pm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org, linux-crypto@vger.kernel.org, kernel-hardening@lists.openwall.com, xen-devel@lists.xenproject.org Subject: [Xen-devel] [RFC v2 09/23] x86: pm-trace - Adapt assembly for PIE support X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Change assembly to use the new _ASM_GET_PTR macro instead of _ASM_MOV for the assembly to be PIE compatible. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier --- arch/x86/include/asm/pm-trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/pm-trace.h b/arch/x86/include/asm/pm-trace.h index 7b7ac42c3661..a3801261f0dd 100644 --- a/arch/x86/include/asm/pm-trace.h +++ b/arch/x86/include/asm/pm-trace.h @@ -7,7 +7,7 @@ do { \ if (pm_trace_enabled) { \ const void *tracedata; \ - asm volatile(_ASM_MOV " $1f,%0\n" \ + asm volatile(_ASM_GET_PTR(1f, %0) "\n" \ ".section .tracedata,\"a\"\n" \ "1:\t.word %c1\n\t" \ _ASM_PTR " %c2\n" \