Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1894319ybv; Fri, 21 Feb 2020 05:17:10 -0800 (PST) X-Google-Smtp-Source: APXvYqyAI+lEKSM2mJrdmRGxoNhywafnN1t2B/D+vRCshyjvmD/KJYlM6aGU7HBKYkF0F2VndjRR X-Received: by 2002:aca:2207:: with SMTP id b7mr2000378oic.109.1582291030599; Fri, 21 Feb 2020 05:17:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582291030; cv=none; d=google.com; s=arc-20160816; b=U7QOnlSDAK5Ir9jC5DXwV9PCpwYEWs+NkUCsSzGUVR/uSZH4uezMIXx0mf2Vm8gqXS ejSU4I41f8Y0ga2vjfQQnjRHJ7XgMvpvhS5MGZjeOmU2NPrtOhlf7lu4bEcFZJFkPNHz frYVMhbokNn2LJUcuNtIQ404QuKKKC4K3HTV7S2yATxMII8xs0vCQxU4qleM+WNOqV46 BfZoCgSgF2Ek4ehircss4JHhbeT3GCxm8Z4PxUf9weKWl0apYm7SdAgQdI/XCyDyiE8m tknHDz0Ee5Lg79jgnRDqnYtvVCnet+U076OXG1UcXtdxfXpbXrdePMW3RWsuaMwhqJMX O9HA== 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=zDn5C3xv6dXYKrjaHTGWkXdQBcdK60nBC9wVMKjt8WA=; b=hsMrE1ru6uhteajaR0zQfOQ03pw8sobn8t61Cko7VeS6MBT1x1ZszTYPPc82jaY+U+ PVOrlAJD5ROQyOzeHrAaSmlf1qYJlGt2HqaLcivJQE7iHfrB3Xctw9M02QZSozGJZubq 35feTRx+ySihiYEShrQ7tM2TI2Piq5baIwRMmyrRcHqa0NPhRpBiTBhpNPpZlEL3jEYc 0R7OfLiROOkw6a4S3heZVppWJnKCxYoACW+vnQltMkUTNFcSmt9sVYFfLlzMCTn+GoDX GVqFO7cJ9DZdeaLI4zBE6OMfnQ6G+3dvpk/AAMERBtt0l2kOpNFb1QuEhxI6Wkp5Ukj1 4NJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RbGif9cr; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si1404568otk.77.2020.02.21.05.16.58; Fri, 21 Feb 2020 05:17:10 -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=@gmail.com header.s=20161025 header.b=RbGif9cr; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728473AbgBUNPb (ORCPT + 99 others); Fri, 21 Feb 2020 08:15:31 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:42203 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728085AbgBUNPb (ORCPT ); Fri, 21 Feb 2020 08:15:31 -0500 Received: by mail-io1-f65.google.com with SMTP id z1so2287080iom.9 for ; Fri, 21 Feb 2020 05:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zDn5C3xv6dXYKrjaHTGWkXdQBcdK60nBC9wVMKjt8WA=; b=RbGif9crxh5U8AFJaQcwjKLg3pjkvQblsGUJ/mz0L4vreJUc3yQ1ZD60EwmkYswfBU 7kOYpcKdQQFOv6YaN/h6zb6VFYxTTHuY29xM2Zeh/BO5jNRiIr1M53l6wgAgq0meuvwI cVVxgXOSPqp7ff/Z1TUnuZgTmRoqU4dNOBgiIPgpKuUoVsyCLr5AvVZbi+MHRaCpLhSh 69aBMxqD93DjXsK0Z4FVQAL1D0CQw4yre6Gx7mrFqeiuwzi6c0tLD5LCe0kAvPDyJTmx Q69so67DzaVnClUVXFUaylCppaU+gngz7W82yFriZEPXWxCAJprfiQSnoweZ+cGB7E2U PSIw== 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=zDn5C3xv6dXYKrjaHTGWkXdQBcdK60nBC9wVMKjt8WA=; b=clLEwn9YUa+tj2Fob808mcQ3A+p3AaGMvRNEy4Laxh8kWJivykdtuvF+kBU7pkzner J8+zkg9DrQ3XfsAgK5oeOF4PHDghqXQTYLTXfy/sve31ykETS1h8nThX8mZhFCZ4tTNr +8KIUk6UnvgpglwIk5E/n5geNlwOLm4SIOwMessV3Zsa0tB3W2k8uetvjXyQEUx/5Llg NPypvCNR1BHeYmXU25gc4a1as2X2g5QqX+necfGztE8FM3lqADR3FT+DV79qIFPyUSp8 fVxNzBSCOxvBBWeerKMWKbBv/001kVE925fGD+PIPKpG/Jcwqs0hv1aD88vq4o/kbJdV QzKw== X-Gm-Message-State: APjAAAX4PLm3P0jxbWKMPKnJ6n+YZuxHgjK6qJ4QUaIiSjvu1k+jIHOn Kyr7r4rslOD7ASNbgVEWlJZdQ/Et2WW984iRhwfx X-Received: by 2002:a02:7fd0:: with SMTP id r199mr32144026jac.126.1582290930632; Fri, 21 Feb 2020 05:15:30 -0800 (PST) MIME-Version: 1.0 References: <20200221050934.719152-1-brgerst@gmail.com> <20200221060756.GA3368@light.dominikbrodowski.net> In-Reply-To: <20200221060756.GA3368@light.dominikbrodowski.net> From: Brian Gerst Date: Fri, 21 Feb 2020 08:15:19 -0500 Message-ID: Subject: Re: [PATCH 0/5] Enable pt_regs based syscalls for x86-32 native To: Dominik Brodowski Cc: Linux Kernel Mailing List , "the arch/x86 maintainers" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski 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 Fri, Feb 21, 2020 at 2:07 AM Dominik Brodowski wrote: > > Brian, > > On Fri, Feb 21, 2020 at 12:09:29AM -0500, Brian Gerst wrote: > > This patch series cleans up the x86 syscall wrapper code and converts > > the 32-bit native kernel over to pt_regs based syscalls. > > thanks for your patchset. Could you explain a bit more what the rationale > is. Due to asmlinkage, it doesn't leak "random user-provided register > content down the call chain" (as was the case for x86-64). But it may be > cleaner, and you mention in patch 5/5 that the new way is "a bit more > efficient" -- do you have numbers? The main rationale for this patch set is to make the 32-bit native kernel consistent with the 64-bit kernel. It's also slightly more efficient because the old code pushed all 6 arguments onto the stack whereas the new code only reads the args the syscall needs, with the pt_regs pointer passed in through a register. By efficient I mean that it uses fewer instructions and stack accesses, not that it will actually have a significant difference on a benchmark. -- Brian Gerst