Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp774834pxa; Wed, 5 Aug 2020 12:26:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXDY9pz5fCdFdbTxLOpnWcdq9FMMyA51caieajzJ+wXu9DhoiEMjb8oiQV8uo6sAFM2dkL X-Received: by 2002:aa7:d1cb:: with SMTP id g11mr818163edp.26.1596655571378; Wed, 05 Aug 2020 12:26:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596655571; cv=none; d=google.com; s=arc-20160816; b=ltDdN7dqN+ntCujH8P2RY+/A8qv/nUlQbFcJ7xwp5jfW2Au9azLnvzL8YhFFpbMSuD qr1WGnIx5LkXJ74Mj1lfPxBAd38VM+U7gKgYfXpyu7NyHw59G6dSsIbfkWECsJz0SCW7 3POB6H1sq32yPs3bBZJVgNjpE7zaqgyzggUQvg7eUqpOOF3UGfOXUev2sX7x7dm19bLQ NrXSz3JK6tZD7p7CmKffdbBVIPUYXgf3594wZcL8+UU2NqWAI45SIfA+AFYE60L22UUm PlSYnurwNvXg3mPAnVEmznZmUtYHZerevsSbxIC1Rr0vwzCiERBhCJSFeKZCQQiVidyg LIdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vZFZWl1pEUky2gayu/YECRlywTB1wSzjFY0H0J86KAk=; b=Bk4RZYwcXtVECMkkTC1AmMSrhg67ujvjuwtY5VO3AreZKmiB4k76GVYPTt80xwp3Yl w31LkLdpU202vtuKTDFGO5Gz3and6nJrR1A5VFEpAbrE0t30iuXe8cmXhY/AEgvQcRhJ x3iGFfNWGsOP49XwzKr2QBlKTKl+Klqkc0P1osSLjcZF99aZDY24MbCBTJsnkeIC9PRU ndMZ+oJhQFng4YDQ8KgeDAySMZ67anl/sOLU8z4X9zo+mrdtPqhBBl9ygabmCDC/iVrh T3/4t3QTjffM4VKrELrkfbakYoWe48Tl24dzxqiM9WfjYURvIlbmf5LxPFx6oISmbzvI LrKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ErfTKyug; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p7si1743760ejo.392.2020.08.05.12.25.48; Wed, 05 Aug 2020 12:26:11 -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=@kernel.org header.s=default header.b=ErfTKyug; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728370AbgHETZk (ORCPT + 99 others); Wed, 5 Aug 2020 15:25:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:35568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728344AbgHERPS (ORCPT ); Wed, 5 Aug 2020 13:15:18 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E1BA2337F; Wed, 5 Aug 2020 15:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596642773; bh=1w22+LBQnaR1M+1m8sFWAvv4+c7MzGzRZ17tDJnZxak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ErfTKyug8PRwLfcIOWDvraLY1ZaaPGDNG2OYgk7oF25asCAoUq28wT76AzvvLeyvx SA4tuz6TrPHCYcZt2mOYpy+O5RPUtA/e1drmiDsenuRXpMfiTb9T17fwLaMyHDURai O5Rvt1djQ5ynXUfqsPJyIwpDTfv6WEmcJVDzjx8k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier Subject: [PATCH 5.4 6/9] [PATCH] arm64: Workaround circular dependency in pointer_auth.h Date: Wed, 5 Aug 2020 17:52:43 +0200 Message-Id: <20200805153507.352774488@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200805153507.053638231@linuxfoundation.org> References: <20200805153507.053638231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier With the backport of f227e3ec3b5c ("random32: update the net random state on interrupt and activity") and its associated fixes, the arm64 build explodes early: In file included from ../include/linux/smp.h:67, from ../include/linux/percpu.h:7, from ../include/linux/prandom.h:12, from ../include/linux/random.h:118, from ../arch/arm64/include/asm/pointer_auth.h:6, from ../arch/arm64/include/asm/processor.h:39, from ../include/linux/mutex.h:19, from ../include/linux/kernfs.h:12, from ../include/linux/sysfs.h:16, from ../include/linux/kobject.h:20, from ../include/linux/of.h:17, from ../include/linux/irqdomain.h:35, from ../include/linux/acpi.h:13, from ../include/acpi/apei.h:9, from ../include/acpi/ghes.h:5, from ../include/linux/arm_sdei.h:8, from ../arch/arm64/kernel/asm-offsets.c:10: ../arch/arm64/include/asm/smp.h:100:29: error: field ‘ptrauth_key’ has incomplete type This is due to struct ptrauth_keys_kernel not being defined before we transitively include asm/smp.h from linux/random.h. Paper over it by moving the inclusion of linux/random.h *after* the type has been defined. Signed-off-by: Marc Zyngier Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/pointer_auth.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/arch/arm64/include/asm/pointer_auth.h +++ b/arch/arm64/include/asm/pointer_auth.h @@ -3,7 +3,6 @@ #define __ASM_POINTER_AUTH_H #include -#include #include #include @@ -30,6 +29,13 @@ struct ptrauth_keys { struct ptrauth_key apga; }; +/* + * Only include random.h once ptrauth_keys_* structures are defined + * to avoid yet another circular include hell (random.h * ends up + * including asm/smp.h, which requires ptrauth_keys_kernel). + */ +#include + static inline void ptrauth_keys_init(struct ptrauth_keys *keys) { if (system_supports_address_auth()) {