From patchwork Mon Jun 17 13:22:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anisse Astier X-Patchwork-Id: 10999253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C50F86C5 for ; Mon, 17 Jun 2019 13:23:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3FE128941 for ; Mon, 17 Jun 2019 13:23:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A84CE28932; Mon, 17 Jun 2019 13:23:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 49FB92866C for ; Mon, 17 Jun 2019 13:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=05S0luhusdOdwSithPylDRQLnesfTki3wNPwWx/dqyY=; b=AVnv3dJMeR4bj8 M+upRCh/BtZWfE8qi7XrrmoUuv1d/g9I8FrYvUJ401DeUDqtLUVuzeCyAICtnO6T2EUr+Urh6ETz1 /D0HDxrk88Id6jlBPsEZkI0VRcB7nxrWBWgEcOXu+AlV3fTYf8mfUNIMjxTnfpi9tlcUS/VfC47rR 8YJhevzPTXfdQH9LvGEl6jbuLy/f+2TlWqRvF1WHPBWSxey+avSHGw49qbJHgP/PJOx0lRb0xlY/r D6Qt35lDB1OeEEa0jLABrDK6Q85ypGeZlWECtc4K7/nZG6GmJ/G0HqUXHIHJ9nYfBJyXgnED1s2kl L/sGQrwbfGSsBj//WwNA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hcrb8-00053p-VE; Mon, 17 Jun 2019 13:22:58 +0000 Received: from smtp3-g21.free.fr ([2a01:e0c:1:1599::12]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hcrb5-00052o-GO for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2019 13:22:57 +0000 Received: from anisse-station.iliad.local (unknown [213.36.7.13]) by smtp3-g21.free.fr (Postfix) with ESMTPS id 6347313F8DA; Mon, 17 Jun 2019 15:22:22 +0200 (CEST) From: Anisse Astier To: Will Deacon , Dave Martin , linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/2] arm64: ssbd: explicitly depend on Date: Mon, 17 Jun 2019 15:22:21 +0200 Message-Id: <20190617132222.32182-1-aastier@freebox.fr> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190617084545.GA38959@anisse-station> References: <20190617084545.GA38959@anisse-station> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190617_062255_695453_975C0925 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sasha Levin , Anisse Astier , Catalin Marinas , Rich Felker , linux-kernel@vger.kernel.org, Kristina Martsenko , "Dmitry V . Levin" , Ricardo Salveti , Richard Henderson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Fix ssbd.c which depends implicitly on asm/ptrace.h including linux/prctl.h (through for example linux/compat.h, then linux/time.h, linux/seqlock.h, linux/spinlock.h and linux/irqflags.h), and uses PR_SPEC* defines. This is an issue since we'll remove the include in the next commit. Fixes: 9cdc0108baa8 ("arm64: ssbd: Add prctl interface for per-thread mitigation") Cc: stable@vger.kernel.org Signed-off-by: Anisse Astier --- Contrary to what I said in the previous email, I can reproduce the build error on Linus' master when ARM64_SSBD is enabled. Changes since v2: - fix build when ARM64_SSBD is enabled with additionnal patch Changes since v1: - made a bit more explicit that we copied defined symbols, in commit and code. - Use Fixes: tag in commit message Thanks to Dave Martin and Will Deacon for the review, and Sasha Levin for the auto-build bot. --- arch/arm64/kernel/ssbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/ssbd.c b/arch/arm64/kernel/ssbd.c index 885f13e58708..52cfc6148355 100644 --- a/arch/arm64/kernel/ssbd.c +++ b/arch/arm64/kernel/ssbd.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include From patchwork Mon Jun 17 13:22:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anisse Astier X-Patchwork-Id: 10999255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B4DC6C5 for ; Mon, 17 Jun 2019 13:23:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B50928922 for ; Mon, 17 Jun 2019 13:23:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DF942892C; Mon, 17 Jun 2019 13:23:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 603E02893E for ; Mon, 17 Jun 2019 13:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XiJFN0HFgJoIkbrnWYMTJvJz5RSg1fo9qYwF6tn3j2I=; b=HyMgCVOENgj2gO wglG1fdLxx0/D6xqae+OVAOQcHpu9qp/dk0bAOPoGSxfv97EfDw6bijfqjtZ7cwakNbtYhEIW+4Zv IE79vXVfcRXdztQVYc4+zPCD9kt7cT3KImrKaefPj0pHE+5uywax0h1gOPQRSCCYRBm7ufaJExMQZ 2k/7JILINeVHkl9Bm0jxzqwfSAX4TNGWEZMseBDMs8ABy0CX2IEPOnd6TB1YLuVwkGY+CCHVCScJl 8UgYWKtUde7p1EH8RpqtE8pfvPqd5zAISIHfGHQTIcNNIwExUbyj2mNyhqWYuwmdE1nGp7oBw9IXu 6yJAryy8j9ZDvmpEz31Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hcrbX-0005PL-H8; Mon, 17 Jun 2019 13:23:23 +0000 Received: from smtp3-g21.free.fr ([212.27.42.3]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hcrbU-0005IN-46 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2019 13:23:21 +0000 Received: from anisse-station.iliad.local (unknown [213.36.7.13]) by smtp3-g21.free.fr (Postfix) with ESMTPS id CDE8713F85F; Mon, 17 Jun 2019 15:22:49 +0200 (CEST) From: Anisse Astier To: Will Deacon , Dave Martin , linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/2] arm64/sve: should not depend on Date: Mon, 17 Jun 2019 15:22:22 +0200 Message-Id: <20190617132222.32182-2-aastier@freebox.fr> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190617132222.32182-1-aastier@freebox.fr> References: <20190617084545.GA38959@anisse-station> <20190617132222.32182-1-aastier@freebox.fr> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190617_062320_307773_266BE270 X-CRM114-Status: GOOD ( 10.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Sasha Levin , Anisse Astier , Catalin Marinas , Rich Felker , linux-kernel@vger.kernel.org, Kristina Martsenko , "Dmitry V . Levin" , Ricardo Salveti , Richard Henderson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Otherwise this will create userspace build issues for any program (strace, qemu) that includes both (with musl libc) and (which then includes ), like this: error: redefinition of 'struct prctl_mm_map' struct prctl_mm_map { See https://github.com/foundriesio/meta-lmp/commit/6d4a106e191b5d79c41b9ac78fd321316d3013c0 for a public example of people working around this issue. Copying the defines is a bit imperfect here, but better than creating a whole other header for just two defines that would never change, as part of the kernel ABI. This patch depends on patch "arm64: ssbd: explicitly depend on " for kernel >= 4.18 Fixes: 43d4da2c45b2 ("arm64/sve: ptrace and ELF coredump support") Cc: stable@vger.kernel.org Signed-off-by: Anisse Astier --- arch/arm64/include/uapi/asm/ptrace.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/uapi/asm/ptrace.h b/arch/arm64/include/uapi/asm/ptrace.h index 97c53203150b..e932284993d4 100644 --- a/arch/arm64/include/uapi/asm/ptrace.h +++ b/arch/arm64/include/uapi/asm/ptrace.h @@ -65,8 +65,6 @@ #ifndef __ASSEMBLY__ -#include - /* * User structures for general purpose, floating point and debug registers. */ @@ -113,10 +111,10 @@ struct user_sve_header { /* * Common SVE_PT_* flags: - * These must be kept in sync with prctl interface in + * These must be kept in sync with prctl interface in */ -#define SVE_PT_VL_INHERIT (PR_SVE_VL_INHERIT >> 16) -#define SVE_PT_VL_ONEXEC (PR_SVE_SET_VL_ONEXEC >> 16) +#define SVE_PT_VL_INHERIT ((1 << 17) /* PR_SVE_VL_INHERIT */ >> 16) +#define SVE_PT_VL_ONEXEC ((1 << 18) /* PR_SVE_SET_VL_ONEXEC */ >> 16) /*