Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3458381ybb; Mon, 23 Mar 2020 01:12:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs3kfPrzl6G8JsoR4k7NW4z/uF/tRuNhoziWl6OYMNhcy5pqSH1I5bPe8xbP+gbqdmxeECV X-Received: by 2002:aca:5057:: with SMTP id e84mr16616163oib.120.1584951137849; Mon, 23 Mar 2020 01:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584951137; cv=none; d=google.com; s=arc-20160816; b=vJVBesi7P1Kby1C9al8fG/boVP4qBp07D9hNfj8Sg4X2FJlXJ8NlNzZoGpQSfGqx6S 1klGDbuOQU2OxKQuIe6DpQN/15pcfygwjXS0BDjQKYZTqGxmX+Kj8d4Iqc0ZJ/uDIXR6 vJmD6OCIODvbHDl8sTXVsaLwqS4uFgu4/lzwL4CsVKSu9UMICSk8KtOJyF7G88yTBZiT PW/zrHdEcseMT6NGm6cddzHNtJhk7/6vYxrB9AbEjP9Hmrxxjp+nO1a1fXJVqDwomvsL XqI4q9FyVmh/7RQyKt4EcsrxTY6gffNHgnN5hnPbK0MSRphgQUiCqxh+hg8Hvdqg+QpB m+SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AHIW+QVtzE1xcLJp+3O/as7HmyD4LesHaV7anw/Educ=; b=HDjMvvWXRcz1w2xGPx00y/jpOBquwT45ojO186D6sVVPBagZX8OSMF7VFUWXObhNB2 /XaWbkwRcgBr1PiiYBlxi8MNx5QQYflhGt7Dc3w1bEpFE25Lc2X62ZhFGyzspP3xkfGn qQTfOlvhh2uXpgApbWoEW+59LXmen/GycXt041nvpbnvMCjdDw8eT6C4V80YvaKj8feM 5LIdGVUUuQcv4oaaSuQBPt2GdUk5J6Kji8SXp9Wk3P1hG+KlyLfwZcJvZz7yIZV6d3FQ UlKSLWk9RmKXcmrDgL4+AN1U/CPUYiVwvAIbQlSsG/lOqTs85dgbJFiJCUPRrrxGKtjA UUYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=m3oUZGC9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l25si7625982otk.119.2020.03.23.01.12.05; Mon, 23 Mar 2020 01:12:17 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=m3oUZGC9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727547AbgCWILW (ORCPT + 99 others); Mon, 23 Mar 2020 04:11:22 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36297 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727486AbgCWILU (ORCPT ); Mon, 23 Mar 2020 04:11:20 -0400 Received: by mail-wr1-f67.google.com with SMTP id 31so9687523wrs.3 for ; Mon, 23 Mar 2020 01:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AHIW+QVtzE1xcLJp+3O/as7HmyD4LesHaV7anw/Educ=; b=m3oUZGC9q7A+ysv0gd2/sfYMwLniBPqKUtSy7BD+cR4lGMmdt6P6G3K9m/ZpH1Nndn Mn1VcOYgWZ2mhxevDXBJtDx+ooigKyUDnbV+Wwv9OOmo9mV6Tmi/4Pqr3F2bZ7uWvgYo lrC3+7kbRPgq5sF8RdE6VRBRYnyHsoHon15lvaHHeASxdx5ZimuAZZ/scPaDpuqnhP0C 0m01wnnN+NSY5n652EXucbm8lxviLV04gJXHkhUgEtTCjvjyCQuP9tHOAhce6LW1Fn06 aD8F8cX3tuWQJ21kV3/4MB1edFrqE7vuLjkmspBMQU9MfSLwHftuBugtzBVeWjo+w1If EyIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=AHIW+QVtzE1xcLJp+3O/as7HmyD4LesHaV7anw/Educ=; b=om/CPY8/3jFnSIdJKtQ0WzxI+b4nYM6+YJSiwub0VuqA9vT7DCwC0eUP3giZV9eNPM o7tmzAJ3DYun4sbF5qUxP7R9fsD5M41rLAWVxJ2cLkKXKU0yVOLNkm5w/mVoAK/PxCEU yNOs8esuz9Hfo8NUSqtTkwdAOyzGmqW+st/YMBpQWy9wcWwXbgZCtTIjpEd3oyCgGZRs QclquRe04VMS4JZ0Args6JfLC2xypP4fRmPvJasEv2EtNXY2uCpju940isVD3OsVOlsy pI9lwGXK4+FcLYoUz/+67gC3N8wCSzV6NMQaYhVQIZGs0fzPnG6FuI/IZ9pERRPdiJ5X ue4Q== X-Gm-Message-State: ANhLgQ1N7bIvmwYkBMc2EjxmnGSCzS/pvju7SbpTipWGH6EffK5Fczi0 uWSFikJcCwzJKzdTl+04VKs= X-Received: by 2002:adf:efc9:: with SMTP id i9mr8017841wrp.23.1584951078153; Mon, 23 Mar 2020 01:11:18 -0700 (PDT) Received: from gmail.com (54033286.catv.pool.telekom.hu. [84.3.50.134]) by smtp.gmail.com with ESMTPSA id i19sm11493967wmb.44.2020.03.23.01.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 01:11:17 -0700 (PDT) Date: Mon, 23 Mar 2020 09:11:14 +0100 From: Ingo Molnar To: Brian Gerst Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Dominik Brodowski Subject: [PATCH] x86/entry: Fix SYS_NI() build failure Message-ID: <20200323081114.GA10796@gmail.com> References: <20200313195144.164260-1-brgerst@gmail.com> <20200313195144.164260-5-brgerst@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200313195144.164260-5-brgerst@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Brian Gerst wrote: > Pull the common code out from the SYS_NI macros into a new __SYS_NI macro. > Also conditionalize the X64 version in preparation for enabling syscall > wrappers on 32-bit native kernels. > > Signed-off-by: Brian Gerst > Reviewed-by: Dominik Brodowski > Reviewed-by: Andy Lutomirski > #define COMPAT_SYS_NI(name) \ > - SYSCALL_ALIAS(__ia32_compat_sys_##name, sys_ni_posix_timers); \ > - SYSCALL_ALIAS(__x32_compat_sys_##name, sys_ni_posix_timers) > + __IA32_COMPAT_SYS_NI(name) \ > + __X32_COMPAT_SYS_NI(name) > > #endif /* CONFIG_COMPAT */ > > @@ -231,9 +245,9 @@ struct pt_regs; > __X64_COND_SYSCALL(name) \ > __IA32_COND_SYSCALL(name) > > -#ifndef SYS_NI > -#define SYS_NI(name) SYSCALL_ALIAS(__x64_sys_##name, sys_ni_posix_timers); > -#endif > +#define SYS_NI(name) \ > + __X64_SYS_NI(name) \ > + __IA32_SYS_NI(name) This breaks the x86-64 build on !CONFIG_POSIX_TIMERS (and probably also with some x32 build variants), because of a missing ';' between __X64_SYS_NI() and __IA32_SYS_NI(). I suspect testing didn't catch this because SYS_NI() is rarely used in our x86-64 Kconfig space. Very lightly tested fix attached. I didn't see the COND_SYSCALL_COMPAT() build failure, but seems to have a similar bug. Thanks, Ingo Signed-off-by: Ingo Molnar --- arch/x86/include/asm/syscall_wrapper.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h index e10efa1454bc..8929419b9783 100644 --- a/arch/x86/include/asm/syscall_wrapper.h +++ b/arch/x86/include/asm/syscall_wrapper.h @@ -214,12 +214,12 @@ extern long __ia32_sys_ni_syscall(const struct pt_regs *regs); * COND_SYSCALL_COMPAT in kernel/sys_ni.c and COMPAT_SYS_NI in * kernel/time/posix-stubs.c to cover this case as well. */ -#define COND_SYSCALL_COMPAT(name) \ - __IA32_COMPAT_COND_SYSCALL(name) \ +#define COND_SYSCALL_COMPAT(name) \ + __IA32_COMPAT_COND_SYSCALL(name); \ __X32_COMPAT_COND_SYSCALL(name) #define COMPAT_SYS_NI(name) \ - __IA32_COMPAT_SYS_NI(name) \ + __IA32_COMPAT_SYS_NI(name); \ __X32_COMPAT_SYS_NI(name) #endif /* CONFIG_COMPAT */ @@ -257,7 +257,7 @@ extern long __ia32_sys_ni_syscall(const struct pt_regs *regs); __IA32_COND_SYSCALL(name) #define SYS_NI(name) \ - __X64_SYS_NI(name) \ + __X64_SYS_NI(name); \ __IA32_SYS_NI(name)