From: Thomas Garnier Subject: [PATCH v1 25/27] x86/pie: Add option to build the kernel as PIE Date: Wed, 11 Oct 2017 13:30:25 -0700 Message-ID: <20171011203027.11248-26-thgarnie@google.com> References: <20171011203027.11248-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-doc@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.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 , Arnd Bergmann , Thomas Garnier , Kees Cook , Andrey Ryabinin , Matthias Kaehlcke , Tom Lendacky , Andy Lutomirski , "Kirill A . Shutemov" , Borislav Petkov , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Juergen Gross , Chris Wright , Alok Kataria , Rusty Russell , Tejun Heo In-Reply-To: <20171011203027.11248-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 aXRoIFBJRSwgdGhlIGtlcm5lbCB3aWxsIGJlIGFibGUgdG8gbW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AgICAg ICAgaWZkZWYgQ09ORklHX0NDX1NUQUNLUFJPVEVDVE9SX0FVVE8KKyAgICAgICAgICAgICAgICAg ICAgICAgICQod2FybmluZyBDYW5ub3QgdXNlIENPTkZJR19DQ19TVEFDS1BST1RFQ1RPUl8qIHdo aWxlIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRpbmcgYSBwb3NpdGlv biBpbmRlcGVuZGVudCBrZXJuZWwuIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg RGVmYXVsdCB0byBnbG9iYWwgc3RhY2sgcHJvdGVjdG9yIFwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKENPTkZJR19YODZfR0xPQkFMX1NUQUNLUFJPVEVDVE9SKS4pCisgICAgICAg ICAgICAgICAgICAgICAgICBDT05GSUdfWDg2X0dMT0JBTF9TVEFDS1BST1RFQ1RPUiA6PSB5Cisg ICAgICAgICAgICAgICAgICAgICAgICBLQlVJTERfQ0ZMQUdTICs9IC1EQ09ORklHX1g4Nl9HTE9C QUxfU1RBQ0tQUk9URUNUT1IKKyAgICAgICAgICAgICAgICAgICAgICAgIEtCVUlMRF9BRkxBR1Mg Kz0gLURDT05GSUdfWDg2X0dMT0JBTF9TVEFDS1BST1RFQ1RPUgorICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgICAgICQoZXJyb3IgZWNobyBDYW5ub3QgdXNlIFwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ09ORklHX0NDX1NUQUNLUFJPVEVDVE9SXyhS RUdVTEFSfFNUUk9ORykgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSBi dWlsZGluZyBhIHBvc2l0aW9uIGluZGVwZW5kZW50IGJpbmFyeSBcCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFVwZGF0ZSB5b3VyIGNvbXBpbGVyIG9yIHVzZSBcCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIENPTkZJR19YODZfR0xPQkFMX1NUQUNLUFJPVEVDVE9SKQor ICAgICAgICAgICAgICAgIGVuZGlmCisgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBLQlVJ TERfQ0ZMQUdTICs9ICQoc3RhY2tzZWctZmxhZykKKyAgICAgICAgZW5kaWYKK2VuZGlmCitlbmRp ZgorCiBlbHNlCiAgICAgICAgIEtCVUlMRF9DRkxBR1MgKz0gLW1jbW9kZWw9a2VybmVsCiBlbmRp ZgotLSAKMi4xNS4wLnJjMC4yNzEuZzM2YjY2OWVkY2MtZ29vZwoKCl9fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClhlbi1kZXZlbCBtYWlsaW5nIGxpc3QKWGVu LWRldmVsQGxpc3RzLnhlbi5vcmcKaHR0cHM6Ly9saXN0cy54ZW4ub3JnL3hlbi1kZXZlbAo=