From patchwork Tue Jul 18 22:33:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 9850061 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 A058360392 for ; Tue, 18 Jul 2017 22:37:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C039285CB for ; Tue, 18 Jul 2017 22:37:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8072A285D8; Tue, 18 Jul 2017 22:37:08 +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 D379B285CB for ; Tue, 18 Jul 2017 22:37:06 +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 1dXb4K-0000NV-Rw; Tue, 18 Jul 2017 22:34:16 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXb4J-0000N8-Ga for xen-devel@lists.xenproject.org; Tue, 18 Jul 2017 22:34:15 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id 27/0E-02185-6EC8E695; Tue, 18 Jul 2017 22:34:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRWlGSWpSXmKPExsXiVRuso/usJy/ SYPNvTovvWyYzOTB6HP5whSWAMYo1My8pvyKBNePG8oKCCRwVXy4uZmpg3MfWxcjFISQwk1Hi 1q5ZLCAOi8ArFokDrw6ygjgSAv2sEsd33GHqYuQAcuIkVjRKdzFyApmVEoda9rOA2EICShJbN yxlhpj0j1FidstTJpAEm4CWxJ6G+UwgCRGB2RwSi7vOgK0QEPjIJnFjy2GwFmaBFiaJJ/+2gb UIC7hJPN0/gR1kHYuAqsT+Pz4gYV4BS4mN+xaxQFxhLPH3iz6IySlgJbH8Pg/EEZYSvb0NLBM YBRcwMqxi1ChOLSpLLdI1tNRLKspMzyjJTczM0TU0MNbLTS0uTkxPzUlMKtZLzs/dxAgMuHoG BsYdjL+P+x1ilORgUhLl3aqcFynEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgvdQN1BOsCg1PbUiL TMHGPowaQkOHiURXhtg+AvxFhck5hZnpkOkTjEac0w6sP0LE8erCf+/MQmx5OXnpUqJ8y4AmS QAUppRmgc3CBaTlxhlpYR5GRkYGIR4ClKLcjNLUOVfMYpzMCoJ8x4DmcKTmVcCt+8V0ClMQKc I++aAnFKSiJCSamDcOW3Fba/X99dtlV3rVBviUJYZLWCyLYy7+YO3CdPdfI+1m+KvVjZwlyw7 4/0l59x+rd9t6fqnFOu+GqlGMN6uWaGVz/zsyP2Im9t3Nn28Efy0Zs79WdczTiYt/pL6ofpyu 5a9jjPXTTnFRsH4W7eN3ocs/fEky4C7+ee1QFnrVQzb2zadmPtbiaU4I9FQi7moOBEAUZ7A4c QCAAA= X-Env-Sender: thgarnie@google.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1500417252!106135695!1 X-Originating-IP: [74.125.83.44] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35759 invoked from network); 18 Jul 2017 22:34:14 -0000 Received: from mail-pg0-f44.google.com (HELO mail-pg0-f44.google.com) (74.125.83.44) by server-8.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Jul 2017 22:34:14 -0000 Received: by mail-pg0-f44.google.com with SMTP id v190so20058454pgv.2 for ; Tue, 18 Jul 2017 15:34:13 -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=qfGEbYwMqFL7aIBdpS6vKb/VAnP9eMx8y12A55amh00=; b=V+ViCeUrVVji20+jg+C0JkbBWk+1jUzUJPO2GPHgYsOdc4J+x2f9jKffp3Yrr6PDL8 99LfECJm3/Gtoo0IH2mIuLF8x7yMs2Cz3oThUHIbzHLDTjmaQ0gicunIpZ2WBrZe8L0b /2VUqvmbrRUrnVdgKmwDJ3aoH7XbVy0BcUPSV13fJpEdht/y6ZCyzmqzQ9CKqwAUwFiB SP55DodB759ymw/8oVIs6bADRwlm0A5Eg8smGe97wvt5Bqq9cCqPH/FmgNjp3lopfUlt jxdoBm7JLWsaJk6hl0oKweRCZSsgBvlgDMzJrDex+ZqekGIz9Bz6FrNnx4ZWe+wHOUwf KiPQ== 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=qfGEbYwMqFL7aIBdpS6vKb/VAnP9eMx8y12A55amh00=; b=TYWwt/EJfyygWCA6vOjiPLdPRkSjZ5XCCs+bvlbXu64Q0HhGBGHpp8PqqLj5wBkpAS pIe3NyuXENjmKGbYqL9bWOgTzvYpywK/BCJouXZBXNXhnZYfSBwOYhN4RE7hr9MxuX2G 8yqsp1SxmSzmZUe6/wLYZ8ocHrWB4PXF2VfkonsGRGBWrnG0iRHTnjg1HSXxwfdgkrL4 gbQy6xoVvZPZa2IkMxrWG7p2gJc4LDqvqVVhEGjjqcurbROR687k1jfMvXAi+oMQjxM8 KpzxNRq+h1RCiz4Tc+XjcB0vXOmM6pLY+SyMsTRVkci2Vk6KRHHRVAmeW1a3fImldPKk 6HfA== X-Gm-Message-State: AIVw11265BnNm2kD8iccuBxwl1HtmghWIbAvjEst7C3025rzppqMadIr vcentpV1xDb+XSIA X-Received: by 10.98.212.91 with SMTP id u27mr3910418pfl.157.1500417251726; Tue, 18 Jul 2017 15:34:11 -0700 (PDT) Received: from skynet.sea.corp.google.com ([100.100.206.164]) by smtp.gmail.com with ESMTPSA id b6sm6444242pgn.67.2017.07.18.15.34.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Jul 2017 15:34:11 -0700 (PDT) From: Thomas Garnier To: Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Thomas Garnier , Arnd Bergmann , Matthias Kaehlcke , Boris Ostrovsky , Juergen Gross , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Joerg Roedel , Andy Lutomirski , Borislav Petkov , "Kirill A . Shutemov" , Brian Gerst , Borislav Petkov , Christian Borntraeger , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Tejun Heo , Christoph Lameter , Kees Cook , Paul Gortmaker , Chris Metcalf , "Paul E . McKenney" , Andrew Morton , Christopher Li , Dou Liyang , Masahiro Yamada , Daniel Borkmann , Markus Trippelsdorf , Peter Foley , Steven Rostedt , Tim Chen , Ard Biesheuvel , Catalin Marinas , Matthew Wilcox , Michal Hocko , Rob Landley , Jiri Kosina , "H . J . Lu" , Paul Bolle , Baoquan He , Daniel Micay Date: Tue, 18 Jul 2017 15:33:13 -0700 Message-Id: <20170718223333.110371-3-thgarnie@google.com> X-Mailer: git-send-email 2.13.2.932.g7449e964c-goog In-Reply-To: <20170718223333.110371-1-thgarnie@google.com> References: <20170718223333.110371-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 02/22] x86: Use symbol name on bug table 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 Replace the %c constraint with %P. The %c is incompatible with PIE because it implies an immediate value whereas %P reference a symbol. 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/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index 39e702d90cdb..2307e2aceb00 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -37,7 +37,7 @@ do { \ asm volatile("1:\t" ins "\n" \ ".pushsection __bug_table,\"a\"\n" \ "2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n" \ - "\t" __BUG_REL(%c0) "\t# bug_entry::file\n" \ + "\t" __BUG_REL(%P0) "\t# bug_entry::file\n" \ "\t.word %c1" "\t# bug_entry::line\n" \ "\t.word %c2" "\t# bug_entry::flags\n" \ "\t.org 2b+%c3\n" \