From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22F03C47062 for ; Thu, 1 Apr 2021 17:45:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70B4361284 for ; Thu, 1 Apr 2021 17:45:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236255AbhDARoO (ORCPT ); Thu, 1 Apr 2021 13:44:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234574AbhDARiF (ORCPT ); Thu, 1 Apr 2021 13:38:05 -0400 Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB4CC02FE94; Thu, 1 Apr 2021 09:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Date:Message-ID:From:Cc:To; bh=m/fhQBoIS2Ry4FN35jTMDrpVXQElvBfJuR2zw8YjBR8=; b=rjM/JiaSCTDtwzRn1bvABQ1ETe ESRd9Axo3R60B+iHazD05eaRpyJagq1NfzDf1+A3kZJBP7tDY33G9L0KtQz78lnyfCeVWizBZk0Y+ L1GPrVCHtHWPRJOi6+7pGZdCQhlBgYdDq9Z7BuVwIBOMK7GkLZiznxtR2G4aPPCwHzrhTmRrxujWO XMhmTpPC2LKD8FnU8Q1jn6BkU8qjTyYqdNFLLk0fD7nwXUdDQ8qTZrfBpKVxXaRY7fSRJiNAUFA0S eSJCmLldPegdfFcRVYBQYOYmH9n0khNekPsLqstFxpxohWyj+hEGDBm6QQ10JGCtAtZ/opQGojC5N UXssgbHlMBR4T7I7fy68avXlhlHnyArnMuOee3LQKmjCo6SSDnHvoogfVCjxXY/+1stFrcN/dvBb6 TGhq6M9viPslWohIqtZpsEnu9zUaI2/wX6IpDa95Q9quzetuDIgNL1o22rC6iz1+mzu1UmxoUEBqj o7I+cLYX+oSeRdjLQmV3LSdU; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim) id 1lRzkW-00080B-18; Thu, 01 Apr 2021 16:00:48 +0000 To: Linus Torvalds Cc: Jens Axboe , io-uring , "Eric W. Biederman" , Oleg Nesterov , Linux Kernel Mailing List References: <20210326003928.978750-1-axboe@kernel.dk> <8efd9977-003b-be65-8ae2-4b04d8dd1224@samba.org> <358c5225-c23f-de08-65cb-ca3349793c0e@samba.org> <5bb47c3a-2990-e4c4-69c6-1b5d1749a241@samba.org> From: Stefan Metzmacher Subject: Re: [PATCH 0/6] Allow signals for IO threads Message-ID: <2d8a73ef-2f18-6872-bad1-a34deb20f641@samba.org> Date: Thu, 1 Apr 2021 18:00:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Am 01.04.21 um 17:39 schrieb Linus Torvalds: > On Thu, Apr 1, 2021 at 7:58 AM Stefan Metzmacher wrote: >> >>> >>> Ok, the following makes gdb happy again: >>> >>> --- a/arch/x86/kernel/process.c >>> +++ b/arch/x86/kernel/process.c >>> @@ -163,6 +163,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, >>> /* Kernel thread ? */ >>> if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) { >>> memset(childregs, 0, sizeof(struct pt_regs)); >>> + if (p->flags & PF_IO_WORKER) >>> + childregs->cs = current_pt_regs()->cs; >>> kthread_frame_init(frame, sp, arg); >>> return 0; >>> } >> >> Would it be possible to fix this remaining problem before 5.12 final? > > Please not that way. > > But doing something like > > childregs->cs = __USER_CS; > childregs->ss = __USER_DS; > childregs->ds = __USER_DS; > childregs->es = __USER_DS; > > might make sense (just do it unconditionally, rather than making it > special to PF_IO_WORKER). > > Does that make gdb happy too? I haven't tried it, but it seems gdb tries to use PTRACE_PEEKUSR against the last thread tid listed under /proc//tasks/ in order to get the architecture for the userspace application, so my naive assumption would be that it wouldn't allow the detection of a 32-bit application using a 64-bit kernel. metze