Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp991276ybf; Fri, 28 Feb 2020 11:36:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzW1xljLdHZDKRCyfAXWg6hFz3ZsK6uuGEz69Ks+ZODjAYrhSSWwreb4C4lWR3La+hqXaWn X-Received: by 2002:aca:4995:: with SMTP id w143mr1801240oia.62.1582918603330; Fri, 28 Feb 2020 11:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582918603; cv=none; d=google.com; s=arc-20160816; b=XgLl3LyGSehDdegXV3QQAjy9NP0T5afxLKB7b/KStHpnWLEIkULPXolt253BEcHSYA m416X/vfyTuDGA25qdvSFrOn9xz7xrpUA2ERDCRvGKEcy4iCqg2UGvpSQjUfowlhm5XS XhnDAUkwmmg+fcRmGqjuVwMM4+IsbeMDkMWBX2g4JZUxHXeFkogHWVS26DMz2r6wBn79 PicLxFwUccmmEPwgIekso6a3LmijfPueVEgp3NfngiLDAG4eob79EZ634YwZb5WiBG4f QM4quKF5y5lyiC1VGWlgRzTupxL1V8/phBfHLXpDltHlfA4XPqV6fe20voFT3j9pU8YZ Oz2g== 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=17XG1LK9a/nSJjEWbs0F5bJvFWVmmZgYl1lDakBKzp8=; b=ZOiS5Vz/Y1IWdUK0CE6ye9bZTciTLUyhdhIviKPl67s/qketnjYuv/whqdHC1L13ql em5FECWuP+NcQTUw8wh8Lsqdn7tHoeXs0exgAQVZL5CliqjRky8PJzuEEuEM5PzsecYQ tJOLN2ZnxAX3qtul4sxiyqoNgR+DC/VVQaak/yO0LcOTRfCd5iEcer5A/gQ20vth9pat kTow/lbXGP+oSSX3tpkU1AUTYlsZNoXwOGhdYRUWsICl09JFiU1sLbpncW0LlfbFxfd9 c/7r95Z7y0BMCkbhTjolR4MPqD+wdZCdfeK98BNF8SwlOte3IZnTnRCK2pnYH3uTqUiE WcYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cDe1ajsE; 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 s4si691599otd.37.2020.02.28.11.36.31; Fri, 28 Feb 2020 11:36:43 -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=cDe1ajsE; 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 S1727067AbgB1Te4 (ORCPT + 99 others); Fri, 28 Feb 2020 14:34:56 -0500 Received: from mail-il1-f196.google.com ([209.85.166.196]:46748 "EHLO mail-il1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgB1Te4 (ORCPT ); Fri, 28 Feb 2020 14:34:56 -0500 Received: by mail-il1-f196.google.com with SMTP id t17so3694834ilm.13 for ; Fri, 28 Feb 2020 11:34:55 -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=17XG1LK9a/nSJjEWbs0F5bJvFWVmmZgYl1lDakBKzp8=; b=cDe1ajsEpaa5yX4viE/vaEEEt3AHZ2DoFHxaZxX+sYNnBrSlU3a9bLy19sPYRsiXTl L41muiufsI13WkuRDqQQXnKw+FA2ulMzW6Dl1O3uJLKX22aey7q0BrXfmoSBKLSNrfOX HbrdiQqzcQR1of1/PBF3CDf/z46C/9tif040Zl+pFQF3ToCmBb0x/ziMxfVlnkgG/KUq E9w2pFbeZKl6MlbzYrnxpJMOQZHXxLhyjxYLSSgdDRv4Wf9UB07w9/BEc1JTAoDcYovd AAc3yY4Z953DR8XTtb5hPJ5ydnIeCw2NySzhZwY2RhzAL56p7ns+9d/nSD9YQVcLEb7b Wm+w== 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=17XG1LK9a/nSJjEWbs0F5bJvFWVmmZgYl1lDakBKzp8=; b=I1wlDGomGVKt1LmC9aCWAvA/+8o6h6bg7mxfxnmP9aMcomFoDnI2qSiHv6TBtISUEf E6qghK4z1G5LMC/4ayMxt4bDh7kTqO/XCU+p8kwyCJrMka9+5mDJ0lU6AUEyxcHCOOu0 8Qr1FzW9GxjgMXwWwzUgPVzBBiZ0vM3N/Uws98ukmhefusMesYq7r4i+Rc385xvL2r/4 HKpKnvCRb8PdHZSINNftLq5IZFh9Rd2eP+0/9bw0AbXz+CBIOaEyu2jcPKvlIetwT0Os idNmUrgObY3+7b70yGt57Eljom0KpycEUoxDbhgV3esJuOuHD7FItK42LlBFWpMZefJH J2ig== X-Gm-Message-State: APjAAAW5CLVDw9oSd8Tx9/Ll4yb3gXuqlIYtZxVz9VMlwfqtKHPJDOBD zRggLC/qC3B3M1U6jQMSYTLpY3xSnz8m1tvghdb+ X-Received: by 2002:a92:9a02:: with SMTP id t2mr5532571ili.11.1582918495364; Fri, 28 Feb 2020 11:34:55 -0800 (PST) MIME-Version: 1.0 References: <20200227132826.195669-1-brgerst@gmail.com> <20200227132826.195669-2-brgerst@gmail.com> In-Reply-To: From: Brian Gerst Date: Fri, 28 Feb 2020 14:34:44 -0500 Message-ID: Subject: Re: [PATCH v3 1/8] x86, syscalls: Refactor SYSCALL_DEFINEx macros To: Andy Lutomirski Cc: LKML , X86 ML , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Dominik Brodowski 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 28, 2020 at 1:33 PM Andy Lutomirski wrote: > > On Thu, Feb 27, 2020 at 5:28 AM Brian Gerst wrote: > > > > Pull the common code out from the SYSCALL_DEFINEx macros into a new > > __SYS_STUBx macro. Also conditionalize the X64 version in preparation for > > enabling syscall wrappers on 32-bit native kernels. > > > > Signed-off-by: Brian Gerst > > --- > > > > > -#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ > > - static long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ > > - static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ > > - __IA32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__) \ > > - __X32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__) \ > > - static long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ > > - { \ > > - return __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\ > > - } \ > > - static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) > > +#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ > > + static long \ > > + __se_compat_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__)); \ > > + static inline long \ > > + __do_compat_sys##name(__MAP(x, __SC_DECL, __VA_ARGS__)); \ > > + __IA32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__) \ > > + __X32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__) \ > > + static long \ > > + __se_compat_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__)) \ > > + { \ > > + return __do_compat_sys##name( \ > > + __MAP(x, __SC_DELOUSE, __VA_ARGS__)); \ > > + } \ > > + static inline long \ > > + __do_compat_sys##name(__MAP(x, __SC_DECL, __VA_ARGS__)) > > > > This hunk looks like a pure anti-cleanup. I much prefer slightly long > lines over messy excessively multi-line macros. Yeah, after several iterations this ended up back in it's original form other than whitespace changes. Personally I think the 80-column hard limit is silly in this age of 4k widescreen monitors, and can lead to some weird line breaks in certain cases, but that's still the rule. -- Brian Gerst