Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp357463pxk; Thu, 24 Sep 2020 07:19:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyWsXUIWlI/ASHNkwv1PKVAFcUye0yaHc2e1X/qapkKHyTY1ESvHVUJ3SvKm4S7hGqm3UW X-Received: by 2002:a05:6402:44c:: with SMTP id p12mr103688edw.157.1600957159002; Thu, 24 Sep 2020 07:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600957158; cv=none; d=google.com; s=arc-20160816; b=xj0SsgEE47nTISUJKolRAsKlzdPQajXbaTWT4zJLJUUBk8/ogR6KSintwvhD2t5Dd4 DV2RmX6tYDuqsXoWbcpzJwHmZoOjOa+W6ydVhWTfirS1rf/RoHaeNp73zdjc1jT7cG3O Yi4xQkxmYA033UhlOAs90YNBzVc183n+zlgFp/UZ4JHIZzrALP8nYd7sgu8q0aAu2LQD VL19Kous52lpi2dUljpQZrZjFqTFU5k+crHHCpvY9DGYKX/7orGkjMToE0+bcQ460s7t yDakKP9sE/MAdGwpZqHRzcKfe9JSMiSttmEP/yhaA4ohcI6e85p2xNqgc53MScvLJceW Tezw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EATK8UYhF6QjpQ7ze5Yh7cYtMGpiiPgRYaZZWNM3PGw=; b=sSLgvodzBjpqBfFmVAnbQdFIzCPRtY2XuLR/ljZrwoP1P1WPZ3I8qM22Jom77NbE3k f7BgRcRkzlWQDTnH/ZyiYMFprHBdmmQok9i+nooW92HBvQoLWwkQ2jWi4+XiWQhevEXj vpkqsqmNN67ib1qpf9qnTPJpiIlIQzplKHS3hpMd64nrO+TPAOcPRI+YoayjZNRIxEj+ Tae17LMv8hTzm5x7zbEK7rvt/+SOg2GK5tWkrViX45ogG3YxbT5ikienDUtQETN2HR1b svMXZeJf1TiS8Ibi5/nIC4Q+g/LzJ3U9FvYeVZZAKckZSrGmaHP/sFJfi+HgFIACksLg isKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SJimvUVK; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si2052527ejk.485.2020.09.24.07.18.55; Thu, 24 Sep 2020 07:19:18 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SJimvUVK; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728159AbgIXORB (ORCPT + 99 others); Thu, 24 Sep 2020 10:17:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727859AbgIXORB (ORCPT ); Thu, 24 Sep 2020 10:17:01 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F4073C0613CE; Thu, 24 Sep 2020 07:17:00 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id r19so1770422pls.1; Thu, 24 Sep 2020 07:17:00 -0700 (PDT) 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=EATK8UYhF6QjpQ7ze5Yh7cYtMGpiiPgRYaZZWNM3PGw=; b=SJimvUVKP3YEpu5dbZp6nclj4PoP4GI+5FVjQ8crLl6qV9jI/jhWrK0lfimZtmOx6+ mL4TiT24Ma+WYUyPm+d9i/NzLQTlpIIkM91dkJRza3wdWcUvcX5mO2ztLegu+Faz13bd aiYvSWKry4Go4mqNuA5xJHEhFAaeXzsmB0kYAg5AATlP8PnkJGbZCsxUOcfc4AYJt66h O7ToiK+nkRI+ZdMGXj7ytt9vV2U+R6zRBE/aCMP6VGIVfFUpwaCm65KWSw2OLULeAsLM 2kBAw7c0HTRDuFAeQTVSMTpwMKMuvLnTsAN+qr4gGxfCU2iIa4w6Befzl0JtV/W8B7ks geOw== 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=EATK8UYhF6QjpQ7ze5Yh7cYtMGpiiPgRYaZZWNM3PGw=; b=hsz/qBwC4cxYixlW2CoDEKqz4YGV6rWIOwtxJv5D7ZlDgfR1u3MU+ggpMeNt/Z28+/ +QWcw1l7f4e6OUVpBFLEVHQz+yKOehQ4eA+DNfIR4HUBRlyMoHAFAM9c42oZ6r5Z5suG /x+v3x27xoPy1g1BoXN0gmBMQTOa/BmiW9RfFgLra2ONNKDonRtYOM4pqkdC96+Ez4dw P+mBCzoqHGgTRAr55LAWF9XhpTfCsmPLCb7Z9SEIjRJVutnyc3smQ3MdCny6cjcFBNiU nFLPLYpAok76XRU6wSn6urQ+w7Q0vRQeccqJ01w80qBXdHh/u99cYwB2wg6Q/Y/i5OtD 5oBg== X-Gm-Message-State: AOAM5331FKPz2Uj76VqA/Dx1BmCLFYjgjynSfrI2oHp2MuZM1E0cibBe 6SzVTLxd+NGdR2pvQWRwymm4uoX7Wja35n8J3kA= X-Received: by 2002:a17:90b:3252:: with SMTP id jy18mr4034944pjb.1.1600957020491; Thu, 24 Sep 2020 07:17:00 -0700 (PDT) MIME-Version: 1.0 References: <20bbc8ed4b9f2c83d0f67f37955eb2d789268525.1600951211.git.yifeifz2@illinois.edu> <7042ba3307b34ce3b95e5fede823514e@AcuMS.aculab.com> In-Reply-To: <7042ba3307b34ce3b95e5fede823514e@AcuMS.aculab.com> From: YiFei Zhu Date: Thu, 24 Sep 2020 09:16:48 -0500 Message-ID: Subject: Re: [PATCH v2 seccomp 2/6] asm/syscall.h: Add syscall_arches[] array To: David Laight Cc: "containers@lists.linux-foundation.org" , YiFei Zhu , "bpf@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Aleksa Sarai , Andrea Arcangeli , Andy Lutomirski , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jack Chen , Jann Horn , Josep Torrellas , Kees Cook , Tianyin Xu , Tobin Feldman-Fitzthum , Tycho Andersen , Valentin Rothberg , Will Drewry Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 8:47 AM David Laight wrote: > I doubt the compiler will do what you want. > Looking at it, in most cases there are one or two entries. > I think only MIPS has three. It does ;) GCC 10.2.0: $ objdump -d kernel/seccomp.o | less [...] 0000000000001520 <__seccomp_filter>: [...] 1587: 41 8b 54 24 04 mov 0x4(%r12),%edx 158c: b9 08 01 00 00 mov $0x108,%ecx 1591: 81 fa 3e 00 00 c0 cmp $0xc000003e,%edx 1597: 75 2e jne 15c7 <__seccomp_filter+0xa7> [...] 15c7: 81 fa 03 00 00 40 cmp $0x40000003,%edx 15cd: b9 40 01 00 00 mov $0x140,%ecx 15d2: 74 c5 je 1599 <__seccomp_filter+0x79> 15d4: 0f 0b ud2 [...] 0000000000001cb0 : [...] 1cc4: 41 b9 3e 00 00 c0 mov $0xc000003e,%r9d [...] 1dba: 41 b9 03 00 00 40 mov $0x40000003,%r9d [...] 0000000000002e30 : [...] 2e72: ba 3e 00 00 c0 mov $0xc000003e,%edx [...] 2eb5: ba 03 00 00 40 mov $0x40000003,%edx Granted, I have CC_OPTIMIZE_FOR_PERFORMANCE rather than CC_OPTIMIZE_FOR_SIZE, but this patch itself is trying to sacrifice some of the memory for speed. YiFei Zhu