Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp630690pxb; Thu, 19 Nov 2020 09:45:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQfrVoPJzPMPv/IoDrwiqO/5AXHNiTnxbWQi5mczyQAZobg4Pou+Sauor37Ff5B5iNqdtP X-Received: by 2002:a17:907:20ac:: with SMTP id pw12mr2011699ejb.245.1605807940128; Thu, 19 Nov 2020 09:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605807940; cv=none; d=google.com; s=arc-20160816; b=nNbufX7S9AKUGqSbSpAHlE4HnOaBmh1I3oMKNEnWmUO8W33dXDF36AsGPhWbgGMBC3 260fY4FEtUbLCjruOsZ1Zg1v+3JwRTWhg/KIurA4U8h2hQF6oO2CMYFsvxULDj8WxNy8 +bqDi/dMR2sz+OPHaJZLZUAcqFOtKUf4hK1uOH/zB/o9OfZfhUKyz9GA0vtH04Mqk7Cn ngZlF3HIVUr+m2G9QpxK1U+/LQeC940e6icqwyzqJvrR5mudauCwcR9b1KVV+b9Ayor8 ba6nEjtOhdWEX8uaVRTn9VkPmEU1Kc+Y4FklDkKfv2W0PPC1v9b5Hl4ButzKLKbZAeJ/ FMxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from; bh=J14hf32ndPdJdTpHgZ4rYdOP/UaKVz32ra3I0rfUZNo=; b=g28Lq+Y1y5ErueTvnOOevqSJvpnLjsetd5ZWurDxDcGV1dPUiRcaInkVGRx2TMIchN MdpBsgFcWKzIMsSBx+gN/xvJBlka0piUdxmWZajGotNrGr1/TVGL+5h7NcXwKSlCloj6 IveDQuV5ogobqv+JqfrjecfIlmiDizeGGI4DjpTmYE2ZBMNz6jk5zsMwqg16YiYzhbVR 4MR6lvYTYFHpiiFX7/psqayOsVPWTpUBQRaPxVHBkDmnqsH1l3xKZe6mqwvWRKu1UU9L 71wW44UEDoe7fWGxg29TkitzXJ/z4pw2E9TWSY2fIcvcQn9UpKwqvll102wB4kr3n8YP V9cA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si275289ejg.247.2020.11.19.09.45.16; Thu, 19 Nov 2020 09:45:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728660AbgKSRnL (ORCPT + 99 others); Thu, 19 Nov 2020 12:43:11 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51660 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726593AbgKSRnK (ORCPT ); Thu, 19 Nov 2020 12:43:10 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 4F6B71F45ABF From: Gabriel Krisman Bertazi To: luto@kernel.org, Rich Felker Cc: tglx@linutronix.de, keescook@chromium.org, christian.brauner@ubuntu.com, peterz@infradead.org, willy@infradead.org, shuah@kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-kselftest@vger.kernel.org, x86@kernel.org, gofmanp@gmail.com, kernel@collabora.com Subject: Re: [PATCH v7 3/7] kernel: Implement selective syscall userspace redirection Organization: Collabora References: <20201118032840.3429268-1-krisman@collabora.com> <20201118032840.3429268-4-krisman@collabora.com> Date: Thu, 19 Nov 2020 12:43:05 -0500 In-Reply-To: <20201118032840.3429268-4-krisman@collabora.com> (Gabriel Krisman Bertazi's message of "Tue, 17 Nov 2020 22:28:36 -0500") Message-ID: <87a6vdmedy.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Gabriel Krisman Bertazi writes: > Introduce a mechanism to quickly disable/enable syscall handling for a > specific process and redirect to userspace via SIGSYS. This is useful > for processes with parts that require syscall redirection and parts that > don't, but who need to perform this boundary crossing really fast, > without paying the cost of a system call to reconfigure syscall handling > on each boundary transition. This is particularly important for Windows > games running over Wine. I raised a discussion about this on libc-alpha, as requested by Florian. At the moment, there was some back and forth on why the use-case is not done by seccomp, but a more interesting point about user_notif was raised by Rich Felker (cc'ed). SIGSYS, as a signal handler, is limited in what can be done inside it. Rich suggested the user_notif design is a better solution. I understand that from a Wine perspective, SIGSYS suffices for their work, but would it make sense to extend SUD interface to support a user_notif-like interface? Would this be acceptable as future work to be added when/if needed, or should we design it from the start? The existing interface could be extended with a flags field as part of the opcode passed in argument 2, which is currently reserved, and then return a FD, just like seccomp(2) does. So it is not like the current patches couldn't be extended in the future if needed, unless I'm mistaken. -- Gabriel Krisman Bertazi