References: <6a4b8afd-0e6a-e2e7-ed24-7650a4d742bf@xenomai.org> From: Jan Kiszka Message-ID: <51da76cf-b6ee-9943-26e8-c91db5cb6b7f@siemens.com> Date: Fri, 15 Dec 2017 15:24:26 +0100 MIME-Version: 1.0 In-Reply-To: <6a4b8afd-0e6a-e2e7-ed24-7650a4d742bf@xenomai.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] ipipe: 4.4 BUG on x86, maybe on 4.9 as well List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philippe Gerum Cc: Xenomai On 2017-12-14 20:44, Philippe Gerum wrote: > On 12/14/2017 08:28 PM, Jan Kiszka wrote: >> Hi Philippe, >> >> something got broken with the exception path rework: >> >> [ 2.619458] debug: unmapping init [mem 0xffffffff81b43000-0xffffffff81ee5fff] >> [ 2.622011] BUG: using __this_cpu_read() in preemptible [00000000] code: init/1 >> [ 2.623446] caller is __this_cpu_preempt_check+0x13/0x20 >> [ 2.624724] CPU: 2 PID: 1 Comm: init Not tainted 4.4.105+ #689 >> [ 2.626073] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014 >> [ 2.628911] I-pipe domain: Linux >> [ 2.630083] ffffffff81993439 ffff88003fb43c10 ffffffff813afa45 0000000000000002 >> [ 2.631427] ffff88003fb38000 ffff88003fb43c50 ffffffff813db5eb ffffffff82c57340 >> [ 2.631427] ffff88003fb43c98 0000000000000002 ffff88003fb44000 0000000000000000 >> [ 2.631427] Call Trace: >> [ 2.631427] [] dump_stack+0xb2/0xdd >> [ 2.631427] [] check_preemption_disabled+0x17b/0x1c0 >> [ 2.631427] [] __this_cpu_preempt_check+0x13/0x20 >> [ 2.631427] [] do_page_fault+0x3f/0x60 >> [ 2.631427] [] page_fault+0x27/0x60 >> [ 2.631427] [] ? __clear_user+0x42/0x70 >> [ 2.631427] [] clear_user+0x49/0x80 >> [ 2.631427] [] padzero+0x24/0x40 >> [ 2.631427] [] load_elf_binary+0x8fe/0x10f0 >> [ 2.631427] [] ? ipipe_unstall_root+0x58/0x90 >> [ 2.631427] [] search_binary_handler+0x97/0x1d0 >> [ 2.631427] [] do_execveat_common.isra.40+0x5d6/0x7e0 >> [ 2.631427] [] ? do_execveat_common.isra.40+0x54f/0x7e0 >> [ 2.631427] [] ? path_openat+0x1440/0x14e0 >> [ 2.631427] [] ? rest_init+0xd0/0xd0 >> [ 2.631427] [] do_execve+0x2c/0x30 >> [ 2.631427] [] run_init_process+0x2b/0x30 >> [ 2.631427] [] kernel_init+0x3d/0xe0 >> [ 2.631427] [] ret_from_fork+0x40/0x70 >> [ 2.631427] [] ? rest_init+0xd0/0xd0 >> >> Unless you have some immediate idea, I will debug this tomorrow. Issue >> disappears when I revert the related patches in the ipipe queue. >> > > Issue may be in the changes affecting IPIPE_DO_TRAP() [4e180c151]. The > sequence used to be prologue -> handler -> restore_root, it is now > prologue -> restore_root -> handler, which basically means that the > stall bit fixup is no more, ... a fixup. Right, this is broken. The previous code was well matured, it just excluded the case int3 for dyn-ftrace, kprobe etc. so far. While gaining that support would be valuable, I would still recommend to revert the changes for now and redesign the int3 handling carefully on top. Jan -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux