Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5008800pxb; Tue, 28 Sep 2021 08:44:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi1Cfcr8R/Q1JDUm1TzbdJZVXjQbatGC2auHkBsq/DYaTADrHyYEi8LSticN3vSxVAct4w X-Received: by 2002:a63:cc49:: with SMTP id q9mr1480106pgi.463.1632843864028; Tue, 28 Sep 2021 08:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632843864; cv=none; d=google.com; s=arc-20160816; b=A9tT3sRu44QvLWQx4OrrO4uQNqsYUD7ryw3Ht0H7HQvmS2Sz7qs8DF+Smw5oPx3eyK hnmq+1l6PMtqM8nZFhpArAwRiij46XmZx8WyfIVcM7z5PL6yHT9mo/AjeAij9+Lhoilx PTFw5y9nnNe2cnb49LXM3cp0BJX2xoHd/8AADAxyYsb8f+yo7pTm5Sv9sqzqc12YRETG BUObfP4eJf0HGNGtfM6HWDa9LNIG7hRQxGHM5uBFs4/I/oe3PqYNCxulYromYIX5e0hd 0jo7eBwPLvYGfPoA5M9RrqnN5rvgeAyuxOx+AX40vIu1L8o86JPT57ZKDWLTYBvFDlzr /P+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f+aUxHrFvgXywvLFdkv5EDzc2E4Kd2F4qwE/ro7qmt4=; b=RH6d8lG2zlbxrMgmUoND4ogD/JRp6mHQykEczkldWBBs0CBu4L6L2YddYd8H+jnWM3 2ref0wnJqLSPDwUtrj2wITMJ5ctlpI0z73GqFU7nJAASHCoXFIqKWBy0prjW5LX4+HoQ QHoy8XGkrT/tfawluz8DzWXyvMZjGgzypjytnQfu2ljYYo7IDyqUIGOxxUCMnrUY4Kg1 0nWUEdw02oViRbM+NjpLz8Z8sZhtiv2LpNRkquC+SfRPn2cYzJ4lAySDCgwtOFhiAmT3 zl4RcjDMQuCXYiaIQPifv3nKcn5AK0H398qPXRMDGxCMOy+SA+q6czAYE+b1uwJpjp4S 3cmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nnijjKG4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f189si24520965pfa.141.2021.09.28.08.44.10; Tue, 28 Sep 2021 08:44:24 -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=k20201202 header.b=nnijjKG4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241849AbhI1PoO (ORCPT + 99 others); Tue, 28 Sep 2021 11:44:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:60806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241761AbhI1PoB (ORCPT ); Tue, 28 Sep 2021 11:44:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 832A361213; Tue, 28 Sep 2021 15:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632843742; bh=CO94xDsc1VtfSRAfyKqtO5ONWPyRd2vlujyNsapS8kQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nnijjKG41jlJwa3o/h94QbMzuYt/xrzfbVW7/HD2VIesnu/lRCqsG/OgYMX80y9IQ hH4/BVEka83RqpyFz6r9slWxrqp0I3VvuGyIfOzKH+fuK+ZZLaGcLE0IV3JpAeha0I ASE1LfkaUDQIdm7PjdJ2tgJ1FN2nzkzQqWPFLmgdf3vqv/sDRyxMT+eEamyKzMpgZl knvAexWpCIo2DM5H84nxqeLWz98tsxUbukm0J9R/56hS96DmM8o6p1axJ1iQR2d3pv 4ZhohkxknS4pwtQEQv2Z/b7ozo2B1IY2gzN3qDsatFd9OH+5HmlrBdMR50JYNVmN7i Kr8V4dFSt98kw== From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Ard Biesheuvel , Linus Walleij , Nathan Chancellor , Nick Desaulniers , llvm@lists.linux.dev Subject: [PATCH 11/14] ARM: kasan: work around LPAE build warning Date: Tue, 28 Sep 2021 17:41:40 +0200 Message-Id: <20210928154143.2106903-12-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210928154143.2106903-1-arnd@kernel.org> References: <20210928154143.2106903-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann pgd_page_vaddr() returns an 'unsigned long' address, causing a warning with the memcpy() call in kasan_init(): arch/arm/mm/kasan_init.c: In function 'kasan_init': include/asm-generic/pgtable-nop4d.h:44:50: error: passing argument 2 of '__memcpy' makes pointer from integer without a cast [-Werror=int-conversion] 44 | #define pgd_page_vaddr(pgd) ((unsigned long)(p4d_pgtable((p4d_t){ pgd }))) | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | long unsigned int arch/arm/include/asm/string.h:58:45: note: in definition of macro 'memcpy' 58 | #define memcpy(dst, src, len) __memcpy(dst, src, len) | ^~~ arch/arm/mm/kasan_init.c:229:16: note: in expansion of macro 'pgd_page_vaddr' 229 | pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)), | ^~~~~~~~~~~~~~ arch/arm/include/asm/string.h:21:47: note: expected 'const void *' but argument is of type 'long unsigned int' 21 | extern void *__memcpy(void *dest, const void *src, __kernel_size_t n); | ~~~~~~~~~~~~^~~ Avoid this by adding an explicit typecast. Fixes: 5615f69bc209 ("ARM: 9016/2: Initialize the mapping of KASan shadow memory") Reviewed-by: Linus Walleij Link: https://lore.kernel.org/all/CACRpkdb3DMvof3-xdtss0Pc6KM36pJA-iy=WhvtNVnsDpeJ24Q@mail.gmail.com/ Signed-off-by: Arnd Bergmann --- arch/arm/mm/kasan_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/kasan_init.c b/arch/arm/mm/kasan_init.c index 9c348042a724..4b1619584b23 100644 --- a/arch/arm/mm/kasan_init.c +++ b/arch/arm/mm/kasan_init.c @@ -226,7 +226,7 @@ void __init kasan_init(void) BUILD_BUG_ON(pgd_index(KASAN_SHADOW_START) != pgd_index(KASAN_SHADOW_END)); memcpy(tmp_pmd_table, - pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)), + (void*)pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)), sizeof(tmp_pmd_table)); set_pgd(&tmp_pgd_table[pgd_index(KASAN_SHADOW_START)], __pgd(__pa(tmp_pmd_table) | PMD_TYPE_TABLE | L_PGD_SWAPPER)); -- 2.29.2