Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753474AbdC1PFh (ORCPT ); Tue, 28 Mar 2017 11:05:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53574 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753406AbdC1PFe (ORCPT ); Tue, 28 Mar 2017 11:05:34 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DC6542EF18A Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=oleg@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DC6542EF18A Date: Tue, 28 Mar 2017 16:54:13 +0200 From: Oleg Nesterov To: Andrew Morton , Andy Lutomirski , Linus Torvalds Cc: Denys Vlasenko , "H. Peter Anvin" , Ingo Molnar , Jan Kratochvil , Pedro Alves , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/1] get_nr_restart_syscall() should return __NR_ia32_restart_syscall if __USER32_CS Message-ID: <20170328145413.GA3164@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 28 Mar 2017 14:54:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 860 Lines: 30 Hello, get_nr_restart_syscall() is still buggy, TS_I386_REGS_POKED can't really help and should probably die. The fix just adds the __USER32_CS check, but perhaps we can avoid these "fundamentally broken" checks altogether? Is __NR_ia32_restart_syscall/__NR_restart_syscall the part of ABI? OK, we probaly can't remove them, at least right now. But what if we simply add the new syscall number, #define __NR_new_restart_syscall 383 #define __NR_ia32_new_restart_syscall 383 so that it doesn't depends on bitness and we can just do static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs) { BUILD_BUG_ON(__NR_ia32_new_restart_syscall != __NR_new_restart_syscall); #ifdef CONFIG_X86_X32_ABI return __NR_new_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT); #else return __NR_new_restart_syscall; #endif } ? Oleg.