Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1370777ybl; Tue, 3 Dec 2019 06:13:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwrfiYQhTAegtnKNW0KteOfKgKAM4m4J1kdDBmVjAD+bxMySpl3VxCs+UHwJ+FKuDRMCW0G X-Received: by 2002:aca:57d4:: with SMTP id l203mr3719599oib.113.1575382428066; Tue, 03 Dec 2019 06:13:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575382428; cv=none; d=google.com; s=arc-20160816; b=sBIX3L5J/FBAyvEi7GwbaM+j7ERtNbk6frtjaM63LAkKppMd8Mji6taqf/OdBbSZjM bxPSGgm0deNMFEO92oC5lXINSIFrTC4LMG+aYIYNk/AsYaJVe3T9y0H+FymHI8awCwvG zIhVCu4Miy/YaVocmfTPZJ+dgVQw/7VzHIgYB7kwlcGN3YViMzjFBPqn/+Jd7Lwn4Zf6 LpYj4ZpL8P7m8wuDpGiAIHUJ7Fx9i7ZKeEP1hFY+K9AjSvITJMl4ua5PHlzvgICYKCyU 9kvMBjYLILRKLiHLT3cPAgcZC3K2kRRWje+/YfrYzxr2t90apBYjRzG+xN2sjsMwjW85 vlSg== 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=VWT0o3rfY4Pg9dfGakNcTQJLoFgbG8ngbgCDLw3/UgM=; b=EDY7N0F4174V3wztwXGmv9QixnIplXQ7HWW5OSq0nhGvKlIwieyPyQd0ymNL/qPZRZ PWyozaOU8O2jTUJ8lAZ2fWrg1PGbTCSWI2+oFKoetfOXY/QO9wOKch0YmlW15Qd0oVlJ yiXuhill2tOvv36/lFna2ioXjW+92/lsEAsmawdJoWT4vVwsXwZLF+09mDQNQ2BmVclk ZcyaxSKgaqHE7q5xF8i1Qfqs32j7Aq0WdHosO1bSjnXrrKBVYzgdSvNuIQWg+kK8iv93 tv/v+EItDo6jeW7ineReQQX6S65ZV0vgiD9lcUkjurKi9hSmUYrO7FvNlX90+R9yeg0g Z4dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gZbmEpU2; 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 m2si1144875otq.176.2019.12.03.06.13.35; Tue, 03 Dec 2019 06:13:48 -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=gZbmEpU2; 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 S1726115AbfLCOMy (ORCPT + 99 others); Tue, 3 Dec 2019 09:12:54 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:50573 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725848AbfLCOMx (ORCPT ); Tue, 3 Dec 2019 09:12:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575382372; 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=VWT0o3rfY4Pg9dfGakNcTQJLoFgbG8ngbgCDLw3/UgM=; b=gZbmEpU2xPqAW+c9vhEPnbBVWqp5jZ600bb1QbxekplWgvKbMxFmPIBI0FVk7Tft91/U73 bXAHximrhM31j7o8AYHacSZQz7Xeq7YVb868Esel3PYkK4IdwOSTtWLNvVOVZP66KhSISV XgiT2PHXRgakHu5ISc7S/VSXVe4NEek= 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-42-YNys2k-UPEi9zA0jrKbA7g-1; Tue, 03 Dec 2019 09:12:49 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F0828C1F55; Tue, 3 Dec 2019 14:12:47 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.44]) by smtp.corp.redhat.com (Postfix) with SMTP id B55B819C68; Tue, 3 Dec 2019 14:12:40 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 3 Dec 2019 15:12:46 +0100 (CET) Date: Tue, 3 Dec 2019 15:12:39 +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: [PATCH v2 0/4] x86: fix get_nr_restart_syscall() Message-ID: <20191203141239.GA30688@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.84 on 10.5.11.23 X-MC-Unique: YNys2k-UPEi9zA0jrKbA7g-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 This version follows the latest recommendation from Linus, arch_set_restart_data() just saves ti->status in restart->arch_data. Andy, I can add another patch or change 4/4 to save the syscall number instead, I am fine either way. However, personally I dislike restart->arch_data, imo 3/4 is all we need. I agree, set_restart_fn() is better than the ugly ERESTART_RESTARTBLOCK check in syscall_return_slowpath() added by v1. But to me the x86-only arch_data field in restart_block is much worse than the sticky TS_ flag. To remind, there is another reason for the "transient" 3/4, 4/4 is not easily backportable. Oleg. --- arch/x86/include/asm/processor.h | 9 --------- arch/x86/include/asm/thread_info.h | 15 ++++++++++++++- arch/x86/kernel/signal.c | 24 +----------------------- fs/select.c | 10 ++++------ include/linux/restart_block.h | 1 + include/linux/thread_info.h | 12 ++++++++++++ kernel/futex.c | 3 +-- kernel/time/alarmtimer.c | 2 +- kernel/time/hrtimer.c | 2 +- kernel/time/posix-cpu-timers.c | 2 +- 10 files changed, 36 insertions(+), 44 deletions(-)