Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5039439ybc; Tue, 26 Nov 2019 20:08:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzjRFZGjUhZKsss9gZ7nvDgG+n9t+OR0/yd+VLPgC+5FIU0pW8YzWATJONDZ2skD5I94cv4 X-Received: by 2002:a50:88c1:: with SMTP id d59mr29901569edd.127.1574827709468; Tue, 26 Nov 2019 20:08:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574827709; cv=none; d=google.com; s=arc-20160816; b=OePOuCDMgKtEsh071CaOvO/5WkPkw6v7qSpqYZkrbcfvtHwtFpRBMbeKc4Jko/EAWQ GtQggN7uebydIS+CsVbfEwuWJmXDHYcMdIGcLTwzBC6Sra2sImnsbKmKn6JZT40ICoTo HVvVmPutfsUIM9mDatc8711bExX2BUjwfThTce6TyTM+s2m2ytBwKZDjPl6lBoYpTVdF 59Gk6TAJlE0jafebXdS/PJVUHmIsgxyTmKKPy+tftsksRHlh5Ydki9l5spiZXs5ccfwT hoNEbx5lhIt+Fz71MIk16L25OYKb5LvvBCj5DCmBPuT3w25MnK53bi9F5+sWDmdznHDD wZXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rd62a4+kKdVGM6mxx4wZ7hE246doAaPmYNs4HO65uTc=; b=nJjPPnt/K/ahsxDeE6dCuIOAYUevA5g5wUcXDgD2F+15dCUMLOo/To2QMEUXIhnylP U9Qcf62al6HmkBzY6ZRP/zV3qdKO9PSF1wFP9kR2fbcalL29tZk3nUdDleJHNMpoU127 rk0wweN0NDJbUUx8l3Gb/2bZ8jz6SzFWnfHfkE08WmSDRbkVTscfRJ4ye4JJbLyPSX89 2fNZEoXQ/L/1D3McCPf9k++NgWx5JCOhurd6oi5JqEePU0Shu18HzP8PrIrehc4hhcPZ lbPvtpZt9xLfbLbHCTjvTQ779rf6rU/gamVA3fCUiKO7KhZe/JV6XS9dlxN+GtFCSbxI rqPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=f2lBh8HS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o22si9143156edv.175.2019.11.26.20.07.51; Tue, 26 Nov 2019 20:08:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=f2lBh8HS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbfK0EEa (ORCPT + 99 others); Tue, 26 Nov 2019 23:04:30 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37045 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726525AbfK0EE3 (ORCPT ); Tue, 26 Nov 2019 23:04:29 -0500 Received: by mail-lj1-f196.google.com with SMTP id d5so22781097ljl.4 for ; Tue, 26 Nov 2019 20:04:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rd62a4+kKdVGM6mxx4wZ7hE246doAaPmYNs4HO65uTc=; b=f2lBh8HSNpUVoEVI7YAMjgFbAjJ4qgZOSy1I+ycg6K4sEyb1f6UqlcqcJgY8LlrEaY C2cwcHjQqk6W16tM9JIvKKArAVS8TolUZdFdX844nnJq42jJOxmEslFLvYYxAZQNOz/J FtVpsiY8U/lssN472Ro2p7e2XrppLWv+x8l9o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rd62a4+kKdVGM6mxx4wZ7hE246doAaPmYNs4HO65uTc=; b=P7yVcvTWdOf38la/IHvZAEiiIEWgqPJBdqgh1EOTjCRqTo2yGuHzAcOigRN+wV0XAV AHzCXijspnp1Z7lkNdVOh9ZPfULBPE7gg/M9LaPU9VoYXEvs+2jaWvN3hcDBMkuI+BJU hwDz5Iwiyy+5DcOtOqEpAvAxeSU8SspprkZzzO96FcuwQWjKWV41YXQCWZehjeuVqoAH 8k2j+6eXffvCavOK3bEQkoV921omk81S1jECV1qtcLK4m+bsWjmuuqO9b0Svq1pTuPCN 1OiO/1Bcne06ZyFvkTMJqCFAx3LBpK5YU5b8AMMROkIGxfz5f3oUHJGASAaW8AsAdz5U FNNg== X-Gm-Message-State: APjAAAVG9nEqEVjDz/P7E537BSJuuzebxZ0isgxbS524al/mKZD932P8 PVRTIDDlvliFjjYTi1pWUlLixmsw4Sw= X-Received: by 2002:a2e:85d5:: with SMTP id h21mr28752855ljj.243.1574827466467; Tue, 26 Nov 2019 20:04:26 -0800 (PST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id f11sm1634693lfa.9.2019.11.26.20.04.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Nov 2019 20:04:25 -0800 (PST) Received: by mail-lf1-f44.google.com with SMTP id f16so15943785lfm.3 for ; Tue, 26 Nov 2019 20:04:24 -0800 (PST) X-Received: by 2002:a19:4bd4:: with SMTP id y203mr24700097lfa.61.1574827464261; Tue, 26 Nov 2019 20:04:24 -0800 (PST) MIME-Version: 1.0 References: <20191126110659.GA14042@redhat.com> <20191126110758.GA14051@redhat.com> In-Reply-To: <20191126110758.GA14051@redhat.com> From: Linus Torvalds Date: Tue, 26 Nov 2019 20:04:08 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ptrace/x86: introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall() To: Oleg Nesterov Cc: Andrew Morton , Andy Lutomirski , Borislav Petkov , Ingo Molnar , Jan Kratochvil , Pedro Alves , Peter Anvin , Thomas Gleixner , Linux Kernel Mailing List , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 26, 2019 at 3:08 AM Oleg Nesterov wrote: > > Alternatively we could add ->compat_restart into struct restart_block, > logically this is the same thing. That sounds like the better model to me. That's what the restart_block is about: it's supposed to contain the restart information. I'd much rather see the system call number added into the restart block (or just the "compat bit" - but we have that X32 case too, so why not put it all there). And then the get_nr_restart_syscall() hack goes away and is just "set state from the restart block". How painful would that be? I guess right now we always just set all the restart_block info manually in all the restart cases, and that could make it a bit painful to add this kind of architecture-specific flag, but it _sounds_ conceptually like the right thing to do. I definitely don't love the "magic sticky bit in thread status" field model. Linus