From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 936F3138331 for ; Mon, 26 Feb 2018 14:18:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D460AE0878; Mon, 26 Feb 2018 14:18:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9D7E2E0878 for ; Mon, 26 Feb 2018 14:18:03 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 01CC5335C0C for ; Mon, 26 Feb 2018 14:18:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 545631EA for ; Mon, 26 Feb 2018 14:18:00 +0000 (UTC) From: "Alice Ferrazzi" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alice Ferrazzi" Message-ID: <1519654659.f98193ddca07dc67810a96082be4e2a6d8026a66.alicef@gentoo> Subject: [gentoo-commits] proj/linux-patches:4.15 commit in: / X-VCS-Repository: proj/linux-patches X-VCS-Files: 0000_README 1700_ia64_fix_ptrace.patch X-VCS-Directories: / X-VCS-Committer: alicef X-VCS-Committer-Name: Alice Ferrazzi X-VCS-Revision: f98193ddca07dc67810a96082be4e2a6d8026a66 X-VCS-Branch: 4.15 Date: Mon, 26 Feb 2018 14:18:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 725a2da6-6b85-4098-b627-e9dc829f5fe0 X-Archives-Hash: c63cd5f8fa5f83e6223127341f69ea0b commit: f98193ddca07dc67810a96082be4e2a6d8026a66 Author: Alice Ferrazzi gentoo org> AuthorDate: Mon Feb 26 14:17:39 2018 +0000 Commit: Alice Ferrazzi gentoo org> CommitDate: Mon Feb 26 14:17:39 2018 +0000 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f98193dd ia64 fix ptrace 0000_README | 6 +++- 1700_ia64_fix_ptrace.patch | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/0000_README b/0000_README index af0f948..8e1b91f 100644 --- a/0000_README +++ b/0000_README @@ -75,6 +75,10 @@ Patch: 1510_fs-enable-link-security-restrictions-by-default.patch From: http://sources.debian.net/src/linux/3.16.7-ckt4-3/debian/patches/debian/fs-enable-link-security-restrictions-by-default.patch/ Desc: Enable link security restrictions by default. +Patch: 1700_ia64_fix_ptrace.patch +From: https://patchwork.kernel.org/patch/10198159/ +Desc: ia64: fix ptrace(PTRACE_GETREGS) (unbreaks strace, gdb). + Patch: 2300_enable-poweroff-on-Mac-Pro-11.patch From: http://kernel.ubuntu.com/git/ubuntu/ubuntu-xenial.git/patch/drivers/pci/quirks.c?id=5080ff61a438f3dd80b88b423e1a20791d8a774c Desc: Workaround to enable poweroff on Mac Pro 11. See bug #601964. @@ -93,7 +97,7 @@ Desc: Ensure that /dev/root doesn't appear in /proc/mounts when bootint withou Patch: 2901_allocate_buffer_on_heap_rather_than_globally.patch From: https://patchwork.kernel.org/patch/10194287/ -Desc: Patchwork [v2] platform/x86: dell-laptop: Allocate buffer on heap rather than globally +Desc: Patchwork [v2] platform/x86: dell-laptop: Allocate buffer on heap rather than globally. Patch: 4200_fbcondecor.patch From: http://www.mepiscommunity.org/fbcondecor diff --git a/1700_ia64_fix_ptrace.patch b/1700_ia64_fix_ptrace.patch new file mode 100644 index 0000000..6173b05 --- /dev/null +++ b/1700_ia64_fix_ptrace.patch @@ -0,0 +1,87 @@ +From patchwork Fri Feb 2 22:12:24 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: ia64: fix ptrace(PTRACE_GETREGS) (unbreaks strace, gdb) +From: Sergei Trofimovich +X-Patchwork-Id: 10198159 +Message-Id: <20180202221224.16597-1-slyfox@gentoo.org> +To: Tony Luck , Fenghua Yu , + linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org +Cc: Sergei Trofimovich +Date: Fri, 2 Feb 2018 22:12:24 +0000 + +The strace breakage looks like that: +./strace: get_regs: get_regs_error: Input/output error + +It happens because ia64 needs to load unwind tables +to read certain registers. Unwind tables fail to load +due to GCC quirk on the following code: + + extern char __end_unwind[]; + const struct unw_table_entry *end = (struct unw_table_entry *)table_end; + table->end = segment_base + end[-1].end_offset; + +GCC does not generate correct code for this single memory +reference after constant propagation (see https://gcc.gnu.org/PR84184). +Two triggers are required for bad code generation: +- '__end_unwind' has alignment lower (char), than + 'struct unw_table_entry' (8). +- symbol offset is negative. + +This commit workarounds it by fixing alignment of '__end_unwind'. +While at it use hidden symbols to generate shorter gp-relative +relocations. + +CC: Tony Luck +CC: Fenghua Yu +CC: linux-ia64@vger.kernel.org +CC: linux-kernel@vger.kernel.org +Bug: https://github.com/strace/strace/issues/33 +Bug: https://gcc.gnu.org/PR84184 +Reported-by: Émeric Maschino +Signed-off-by: Sergei Trofimovich +Tested-by: stanton_arch@mail.com +--- + arch/ia64/include/asm/sections.h | 1 - + arch/ia64/kernel/unwind.c | 15 ++++++++++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/arch/ia64/include/asm/sections.h b/arch/ia64/include/asm/sections.h +index f3481408594e..0fc4f1757a44 100644 +--- a/arch/ia64/include/asm/sections.h ++++ b/arch/ia64/include/asm/sections.h +@@ -24,7 +24,6 @@ extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchli + extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[]; + extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[]; + extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[]; +-extern char __start_unwind[], __end_unwind[]; + extern char __start_ivt_text[], __end_ivt_text[]; + + #undef dereference_function_descriptor +diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c +index e04efa088902..025ba6700790 100644 +--- a/arch/ia64/kernel/unwind.c ++++ b/arch/ia64/kernel/unwind.c +@@ -2243,7 +2243,20 @@ __initcall(create_gate_table); + void __init + unw_init (void) + { +- extern char __gp[]; ++ #define __ia64_hidden __attribute__((visibility("hidden"))) ++ /* ++ * We use hidden symbols to generate more efficient code using ++ * gp-relative addressing. ++ */ ++ extern char __gp[] __ia64_hidden; ++ /* ++ * Unwind tables need to have proper alignment as init_unwind_table() ++ * uses negative offsets against '__end_unwind'. ++ * See https://gcc.gnu.org/PR84184 ++ */ ++ extern const struct unw_table_entry __start_unwind[] __ia64_hidden; ++ extern const struct unw_table_entry __end_unwind[] __ia64_hidden; ++ #undef __ia64_hidden + extern void unw_hash_index_t_is_too_narrow (void); + long i, off; +