Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3812443yba; Tue, 7 May 2019 07:29:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5WK9n4dYL2p9WXJ2QGo3CdQpwgGRAA5kvhEU78i3KKn4k52MKA8v4Sm/MGksuepXuY1xX X-Received: by 2002:aa7:8e55:: with SMTP id d21mr41128724pfr.62.1557239375352; Tue, 07 May 2019 07:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557239375; cv=none; d=google.com; s=arc-20160816; b=vv2NTfbfmpCkBMedTty82SFoyvtZO38JxJ/o47c9xhAI9M7KiVTmYKx5SpwKAiHhQ3 W2rRu7bm6UARGQaNSaUS2lKxGecnLbjGfI4vaLP+anUxMGkNkQIjRLal3VZKcHFbapv7 ScvE8ttSlow/yhP0NW00j2V1d/TwWlXJqZgRZpxad6U5eWOuFPxI1ijXkoX/E2aAY1lL VSpZbMRkb/UI3lokM4S0kBCv2+oNSioprEWHgE81gicpzRNYMoCXlpRogayhjxghpeDd Wud0XoRpJB/6cbQg1DKWmP4Um6cDvwQH6De9lHXpqyzui78g+I8ZO1ugHnkOO8tmHXWj RDfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-disposition :mime-version:subject:cc:to:from:date; bh=NfwGPETIl66fQ28uAasaOm8baGk3UEjbXQSRvEsjpCQ=; b=Lg0iXC7588q7uLeJb2/D115uGqI7+tZHQ397wx4gI1iwpJehdj4+NSdFRVBCEXX3c4 aEqfpoJxUJ04WBAd2wKgrxrorMVyFO/eK4UsfHUVlh0T+QVLPxPe2vfsh1iyQuwg1HHK jKWQjvTQzY0+2EVJvfBaxvHizsmREgyUz5VV3+JRZrDxxZq1jWXn59C67B0tYYezPCg1 bXjnh1AdI0GnaxpXM2CDwx88ebGxKtiUCcmKbFH/JIPc1Qpm9aVcpvRxG1gNZZyrY8lP 23jmRnTu828KzN+8LvjocDZFH1sKIS/Qcfrop+07r0JIs2SLTE8kRh/zXtunVHkmwba2 Pz5Q== ARC-Authentication-Results: i=1; mx.google.com; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d131si1969219pfg.21.2019.05.07.07.29.16; Tue, 07 May 2019 07:29:35 -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; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbfEGO2Z (ORCPT + 99 others); Tue, 7 May 2019 10:28:25 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59240 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726353AbfEGO2Z (ORCPT ); Tue, 7 May 2019 10:28:25 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x47ENFhh177712 for ; Tue, 7 May 2019 10:28:24 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2sb9tcnx82-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 May 2019 10:28:23 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 May 2019 15:28:20 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 7 May 2019 15:28:18 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x47ESHQ937486628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 May 2019 14:28:17 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3755BA4A33; Tue, 7 May 2019 14:28:17 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EDFF3A4A2C; Tue, 7 May 2019 14:28:16 +0000 (GMT) Received: from localhost (unknown [9.152.212.229]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 7 May 2019 14:28:16 +0000 (GMT) Date: Tue, 7 May 2019 16:28:15 +0200 From: Vasily Gorbik To: Kees Cook , Andrew Morton Cc: Emese Revfy , Heiko Carstens , Martin Schwidefsky , linux-kernel@vger.kernel.org Subject: [PATCH] latent_entropy: avoid build error when plugin cflags are not set MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-TM-AS-GCONF: 00 x-cbid: 19050714-0012-0000-0000-00000319364F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19050714-0013-0000-0000-00002151B41F Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-07_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905070093 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some architectures set up CFLAGS for linux decompressor phase from scratch and do not include GCC_PLUGINS_CFLAGS. Since "latent_entropy" variable declaration is generated by the plugin code itself including linux/random.h in decompressor code then would cause a build error. E.g. on s390: In file included from ./include/linux/net.h:22, from ./include/linux/skbuff.h:29, from ./include/linux/if_ether.h:23, from ./arch/s390/include/asm/diag.h:12, from arch/s390/boot/startup.c:8: ./include/linux/random.h: In function 'add_latent_entropy': ./include/linux/random.h:26:39: error: 'latent_entropy' undeclared (first use in this function); did you mean 'add_latent_entropy'? 26 | add_device_randomness((const void *)&latent_entropy, | ^~~~~~~~~~~~~~ | add_latent_entropy ./include/linux/random.h:26:39: note: each undeclared identifier is reported only once for each function it appears in The build error is triggered by commit a80313ff91ab ("s390/kernel: introduce .dma sections") which made it into 5.2 merge window. To address that avoid using CONFIG_GCC_PLUGIN_LATENT_ENTROPY in favour of LATENT_ENTROPY_PLUGIN definition which is defined as a part of gcc plugins cflags and hence reflect more accurately when gcc plugin is active. Besides that it is also used for similar purpose in linux/compiler-gcc.h for latent_entropy attribute definition. Signed-off-by: Vasily Gorbik --- include/linux/random.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/random.h b/include/linux/random.h index 445a0ea4ff49..d4eb9b3789ad 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -20,7 +20,7 @@ struct random_ready_callback { extern void add_device_randomness(const void *, unsigned int); -#if defined(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) && !defined(__CHECKER__) +#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__) static inline void add_latent_entropy(void) { add_device_randomness((const void *)&latent_entropy, -- 2.18.0.13.gd42ae10