From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD13DC4708F for ; Sat, 29 May 2021 08:16:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD7C5610C7 for ; Sat, 29 May 2021 08:16:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229769AbhE2ISU (ORCPT ); Sat, 29 May 2021 04:18:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbhE2IST (ORCPT ); Sat, 29 May 2021 04:18:19 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56790C06174A for ; Sat, 29 May 2021 01:16:43 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id g6-20020a17090adac6b029015d1a9a6f1aso8379361pjx.1 for ; Sat, 29 May 2021 01:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fex-emu.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=552P3X5AIoGxxPcUinhjnI4ENWQ5hjfJcdOghjeB50g=; b=nVG4zATPnvEUnsT20GCN2Y9RrH6Yogs49GvQMGcXGU8y6weZSxMIoccx8xNqN5/bqM ASzT04YhgJ+B3Foab4MaxDIUUgmrSyUuQ+dhavd4NoIzfLE6Tlo4m4XkRXPwuWjwx9ax pbsycT7n9powy4uKf5UqEE7DsSl/lcGHhxUVsHBRVtwW69lLWYGX3wErvK+DWAeGpKDM ld6dqXwu3mg9yUyXVxTLsJNc6S8SA2t2p9A+Nd1bi3GC7+aG+JbAqnzx0C6d3y6hYHLi fkCTcBXloV5vEtcjV7jhRqehIMsw+ncO50vvYkGZMM3VCZ6EZ2BlHrAH+4TpbARBvXG6 X6sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=552P3X5AIoGxxPcUinhjnI4ENWQ5hjfJcdOghjeB50g=; b=Eb2x2e/b8WR+oyALmosyO0ihmUbRozmP2hxWvXj0H113qLiKCGe7LwDhd31X/F6mUI VFEnRDwgpyqQQ+nT5j3qRjly1EbrX08LCbHCNF6/w+itsauNKx9CKycx9rpAxb9j7XVv IATcNatMxKrkmnMjcjDfCUidVCzVaa54h7a9IUBeLT8XX/1TyJwHm7M4j259YBvsYLbC A73BMJvX18kBSemW7s/XiHFWnsS2/QtymTvBYYNaeHp6ezwqkHGi9l3oN3jBIvyftmZi EvJKJrDBu7c5eTed8OG80TJ9M8jEH4blW6obYfbwCicVyL9A34zMeSEQXjtSuAP9392h VD3w== X-Gm-Message-State: AOAM532QW7j9YEKnQ8hU5N+42ovh0XIo8Gd85RMrWW3U5K5UCCoK4yeg Szq3z+lpjFyPg3FkBVhMiyi6Hw== X-Google-Smtp-Source: ABdhPJwC8i3Kx+oHJ3a0r6rH9uYevXBf2fLB8vKPm/rP+tPvcdxw8CoiYaYcwUyjQXkkBymNNkhqnA== X-Received: by 2002:a17:90a:e391:: with SMTP id b17mr8646314pjz.75.1622276202956; Sat, 29 May 2021 01:16:42 -0700 (PDT) Received: from localhost.localdomain (76-242-91-105.lightspeed.sntcca.sbcglobal.net. [76.242.91.105]) by smtp.gmail.com with ESMTPSA id b12sm6613960pgs.52.2021.05.29.01.16.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 May 2021 01:16:42 -0700 (PDT) From: houdek.ryan@fex-emu.org X-Google-Original-From: Houdek.Ryan@fex-emu.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ryan Houdek Subject: [PATCH 0/4] arm64: Implement userspace syscall dispatch Date: Sat, 29 May 2021 01:16:16 -0700 Message-Id: <20210529081620.164422-1-Houdek.Ryan@fex-emu.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ryan Houdek arm64: Implement userspace syscall dispatch The first patch moves the userspace dispatch code from the common syscall entry path. This is necessary since arm64 doesn't support the common syscall entry path. The second patch exposes where the sigreturn landing pad location is. The syscall user dispatch code checks this landing pad to see if it should skip invoking the userspace dispatch path. The third patch is where the userspace dispatcher work is hooked up to arm64 syscall dispatcher. Fairly straight forward, adds a new check to the trace enter and exit paths for user dispatch. The fourth patch just updates the selftests to handle aarch64. The sud_bench application shows a consistent 2.3% overhead on my device when testing. Going from 477ns to 488ns per syscall. Ryan Houdek (4): Move userspace syscall dispatch outside of common entry arm64: Track the sigreturn landing pad location arm64: Enable userspace syscall dispatch arm64: tools: Update syscall user dispatch tests arch/Kconfig | 4 ++++ arch/arm64/Kconfig | 1 + arch/arm64/include/asm/syscall.h | 2 ++ arch/arm64/include/asm/thread_info.h | 4 +++- arch/arm64/kernel/ptrace.c | 24 +++++++++++++++++++ arch/arm64/kernel/syscall.c | 9 +++++++ arch/arm64/kernel/vdso/sigreturn.S | 1 + arch/arm64/kernel/vdso/vdso.lds.S | 1 + include/linux/syscall_user_dispatch.h | 4 +++- kernel/entry/Makefile | 3 ++- kernel/entry/common.c | 3 +-- kernel/entry/common.h | 7 ------ kernel/entry/syscall_user_dispatch.c | 2 -- .../syscall_user_dispatch/sud_benchmark.c | 2 +- .../syscall_user_dispatch/sud_test.c | 9 +++++++ 15 files changed, 61 insertions(+), 15 deletions(-) delete mode 100644 kernel/entry/common.h -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FE97C4708F for ; Sat, 29 May 2021 08:19:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3490E61157 for ; Sat, 29 May 2021 08:19:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3490E61157 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fex-emu.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pg5Pbs1OOXTMT9DxQ84g2HTCWaJhxHbOYfEKz3biQFg=; b=boTqONv7vjvHxG cPJKnueQQun0AkpOoDoOK5eVUBNokfh/hasGQWv5Qul62hMpgSKBuChE87ZyF6DzlmuI7/SiGWCCr FSxsgzpDCS8b8AocIEUpH+tVyup5TIu1dOHfo13MefHCeA6qtS4pDQf1Ht2Bgfhzwt2KKWkMMYhtv 4213fLmrDR364wiiUB2YcmhssVWkWoYTTtWohbjLiRMlU+YbLD7qAbLgRYQH25aT/L/18FY9Zptyw OwBXVo/Ksj5fpkpGnPNx2gO9rZsibtKQDHnowltD90YMf0o65N0TopLL6GAnuT7lru+K/apPFLYKZ SXDmaM5qPzdpIyiCVizA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmu9I-0043Qo-Qh; Sat, 29 May 2021 08:16:48 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmu9F-0043Ol-1m for linux-arm-kernel@lists.infradead.org; Sat, 29 May 2021 08:16:46 +0000 Received: by mail-pl1-x632.google.com with SMTP id z4so2715766plg.8 for ; Sat, 29 May 2021 01:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fex-emu.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=552P3X5AIoGxxPcUinhjnI4ENWQ5hjfJcdOghjeB50g=; b=nVG4zATPnvEUnsT20GCN2Y9RrH6Yogs49GvQMGcXGU8y6weZSxMIoccx8xNqN5/bqM ASzT04YhgJ+B3Foab4MaxDIUUgmrSyUuQ+dhavd4NoIzfLE6Tlo4m4XkRXPwuWjwx9ax pbsycT7n9powy4uKf5UqEE7DsSl/lcGHhxUVsHBRVtwW69lLWYGX3wErvK+DWAeGpKDM ld6dqXwu3mg9yUyXVxTLsJNc6S8SA2t2p9A+Nd1bi3GC7+aG+JbAqnzx0C6d3y6hYHLi fkCTcBXloV5vEtcjV7jhRqehIMsw+ncO50vvYkGZMM3VCZ6EZ2BlHrAH+4TpbARBvXG6 X6sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=552P3X5AIoGxxPcUinhjnI4ENWQ5hjfJcdOghjeB50g=; b=TFUTshRY6g5Y6l67AboeUpCcTliZf7yqy1ZCHyLzzV2KHeb7QLPHvlnyyjcFDUt896 Ev2tm9I9sNouepUdF3+c4hPbPPUvds2HcUKQgV5ZEHe5hbuYsHj5BSgczzmvRd/CucNP 1uefIIpR11j92damf6bWEPp2yQpRVdcNXUgsAj1KpaN3jfk8I5OriKUAyOWuTX1Rj5tG 6KAbSK+0Ys9Gjyv57Mp3UraFYG8mjuHDE1S9Clq3gDkFt/LsG2JLnB2gB316/3h/q5M0 M2YxoXjp/IE+/7O4c1nz5J9WsuZpr4v8uYet1jm05jUUY/nYv3AhHUUsXjGfJK+ww2wB fnYw== X-Gm-Message-State: AOAM532+zALveSuFhCyyM6zG3r+MfmfgzYr49BhAkr7HztvBwywungy8 WHRuBQjoyUTsa6ffugY9dl9h00q8TFoDPJ2x X-Google-Smtp-Source: ABdhPJwC8i3Kx+oHJ3a0r6rH9uYevXBf2fLB8vKPm/rP+tPvcdxw8CoiYaYcwUyjQXkkBymNNkhqnA== X-Received: by 2002:a17:90a:e391:: with SMTP id b17mr8646314pjz.75.1622276202956; Sat, 29 May 2021 01:16:42 -0700 (PDT) Received: from localhost.localdomain (76-242-91-105.lightspeed.sntcca.sbcglobal.net. [76.242.91.105]) by smtp.gmail.com with ESMTPSA id b12sm6613960pgs.52.2021.05.29.01.16.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 May 2021 01:16:42 -0700 (PDT) From: houdek.ryan@fex-emu.org X-Google-Original-From: Houdek.Ryan@fex-emu.org To: Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ryan Houdek Subject: [PATCH 0/4] arm64: Implement userspace syscall dispatch Date: Sat, 29 May 2021 01:16:16 -0700 Message-Id: <20210529081620.164422-1-Houdek.Ryan@fex-emu.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210529_011645_130667_0E410920 X-CRM114-Status: GOOD ( 13.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Ryan Houdek arm64: Implement userspace syscall dispatch The first patch moves the userspace dispatch code from the common syscall entry path. This is necessary since arm64 doesn't support the common syscall entry path. The second patch exposes where the sigreturn landing pad location is. The syscall user dispatch code checks this landing pad to see if it should skip invoking the userspace dispatch path. The third patch is where the userspace dispatcher work is hooked up to arm64 syscall dispatcher. Fairly straight forward, adds a new check to the trace enter and exit paths for user dispatch. The fourth patch just updates the selftests to handle aarch64. The sud_bench application shows a consistent 2.3% overhead on my device when testing. Going from 477ns to 488ns per syscall. Ryan Houdek (4): Move userspace syscall dispatch outside of common entry arm64: Track the sigreturn landing pad location arm64: Enable userspace syscall dispatch arm64: tools: Update syscall user dispatch tests arch/Kconfig | 4 ++++ arch/arm64/Kconfig | 1 + arch/arm64/include/asm/syscall.h | 2 ++ arch/arm64/include/asm/thread_info.h | 4 +++- arch/arm64/kernel/ptrace.c | 24 +++++++++++++++++++ arch/arm64/kernel/syscall.c | 9 +++++++ arch/arm64/kernel/vdso/sigreturn.S | 1 + arch/arm64/kernel/vdso/vdso.lds.S | 1 + include/linux/syscall_user_dispatch.h | 4 +++- kernel/entry/Makefile | 3 ++- kernel/entry/common.c | 3 +-- kernel/entry/common.h | 7 ------ kernel/entry/syscall_user_dispatch.c | 2 -- .../syscall_user_dispatch/sud_benchmark.c | 2 +- .../syscall_user_dispatch/sud_test.c | 9 +++++++ 15 files changed, 61 insertions(+), 15 deletions(-) delete mode 100644 kernel/entry/common.h -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel