Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4146507ybc; Tue, 26 Nov 2019 04:39:06 -0800 (PST) X-Google-Smtp-Source: APXvYqx/fXzefDtiB3W6eCkV3vkr3uvj/U5QuRkZgkQMZtDUfy2TBdY2ubQIheYJry5njRCcZalP X-Received: by 2002:a50:e68c:: with SMTP id z12mr25803625edm.53.1574771946253; Tue, 26 Nov 2019 04:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574771946; cv=none; d=google.com; s=arc-20160816; b=UJVdsu//DJLiyvMLceykaUAbhfRs8Sn8BhAzZVgeTeiFAU5jTwfcPhW4tTOYVJlXs9 ovJkseVWUAJsQlaRdpYBHF9e4Spr5SMB+5qHDjXQFVyP2Be5WNxWTWPm11SbX/YcrOgu vzurD6UBcsdknFUbPW2nJzbBB57g0nt27xpxtGBUWi00b73M4YhBvy9wcmAQ5JCCyBXH zMavn3Tn6sKdGhbEgmh45h5u5B/sK2hdcbRrPvfyEfCPN36/90U+aji3QIE2UTX7clpj 8YUExv2e4w+Kg6E+PKEMjX/s2K9c8FR3gjjYBNlp0ixdVYmPkEAv8Idf0Uzq7uA+VqWQ FU2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1QxjabJ2+H9ENscnaiv9GHcq5iJDs19EC3SBNqZp5m4=; b=KoWzrQpsvUt9nExDA7JAk7sfNNPp4kzKn/CWc3W3hMD9AzjHE9C8Uf2NHZPrqkV/Sp vrgR2vitd8LCxguqs0/tceoaQf04p5dkb8b+lSs54I6kHvIrz86hM8Ot5Hf0ToJx6RAX IrpQGGshKmc5ROY8EMnvesay52xuGs/l1rFzlIBPu772+F+57TDxsoA8ULyqI5pOSBaA LPqdS4nl6dT6FWcQn6kLnW9vB1a8sJIZYluUNh+PnSAKODj1XDL5OFCoSz2+Ci2v93Ou iesofT1yktF3LWxyHgwXfbHzliuhj2rbR+hQXrLtIRLFezINPeHBL6kkNWIRX0M0PlPc B1uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="LZ/RWi0S"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si6658151ejy.365.2019.11.26.04.38.41; Tue, 26 Nov 2019 04:39:06 -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=@redhat.com header.s=mimecast20190719 header.b="LZ/RWi0S"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726200AbfKZLIK (ORCPT + 99 others); Tue, 26 Nov 2019 06:08:10 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:53878 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725911AbfKZLIK (ORCPT ); Tue, 26 Nov 2019 06:08:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574766489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1QxjabJ2+H9ENscnaiv9GHcq5iJDs19EC3SBNqZp5m4=; b=LZ/RWi0S+xJcoRvf93O4mo9BevSZ5FrZDAqt8lQQHDsPfTKCeO1HRgLq5h5nZUdlVht5tY wO0Z0/MwFWNRskdzTAJZi7VDbEY3Pa2U51Zap4Ul/es7HlOf1LjLgI17SzVJTXIT5LWQBJ oWN0ir45JLcv3AmQagjRxa8JxXvyA4c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-hba4pxdaN9mom16cpi2g8g-1; Tue, 26 Nov 2019 06:08:05 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA952100550D; Tue, 26 Nov 2019 11:08:03 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.44]) by smtp.corp.redhat.com (Postfix) with SMTP id 174745D6BE; Tue, 26 Nov 2019 11:07:58 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 26 Nov 2019 12:08:03 +0100 (CET) Date: Tue, 26 Nov 2019 12:07:58 +0100 From: Oleg Nesterov To: Andrew Morton Cc: Andy Lutomirski , Borislav Petkov , Ingo Molnar , Jan Kratochvil , Linus Torvalds , Pedro Alves , Peter Anvin , Thomas Gleixner , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] ptrace/x86: introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall() Message-ID: <20191126110758.GA14051@redhat.com> References: <20191126110659.GA14042@redhat.com> MIME-Version: 1.0 In-Reply-To: <20191126110659.GA14042@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: hba4pxdaN9mom16cpi2g8g-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/26, Oleg Nesterov wrote: > > This patch adds the sticky TS_COMPAT_RESTART flag which survives after > return to user mode, hopefully it allows us to kill TS_I386_REGS_POKED > but this needs another patch. Alternatively we could add ->compat_restart into struct restart_block, logically this is the same thing. Rather than changing syscall_return_slowpath() we could introduce a new helper, say, =09void set_restart_block_fn(struct restart_block *restart, fn) =09{ =09=09restart->fn =3D fn; =09=09set/clear TS_COMPAT_RESTART or restart->compat_restart =09=09depending on TS_COMPAT =09} but this patch looks simpler to me. Oleg.