From: Thomas Garnier Subject: [RFC 19/22] x86/pie: Add option to build the kernel as PIE for x86_64 Date: Tue, 18 Jul 2017 15:33:30 -0700 Message-ID: <20170718223333.110371-20-thgarnie@google.com> References: <20170718223333.110371-1-thgarnie@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 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 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 In-Reply-To: <20170718223333.110371-1-thgarnie@google.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" List-Id: linux-crypto.vger.kernel.org QWRkIHRoZSBDT05GSUdfWDg2X1BJRSBvcHRpb24gd2hpY2ggYnVpbGRzIHRoZSBrZXJuZWwgYXMg YSBQb3NpdGlvbgpJbmRlcGVuZGVudCBFeGVjdXRhYmxlIChQSUUpLiBUaGUga2VybmVsIGlzIGN1 cnJlbnRseSBidWlsZCB3aXRoIHRoZQptY21vZGVsPWtlcm5lbCBvcHRpb24gd2hpY2ggZm9yY2Vz IGl0IHRvIHN0YXkgb24gdGhlIHRvcCAyRyBvZiB0aGUKdmlydHVhbCBhZGRyZXNzIHNwYWNlLiBX aXRoIFBJRSwgdGhlIGtlcm5lbCB3aWxsIGJlIGFibGUgdG8g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