From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF76EC433EF for ; Wed, 8 Jun 2022 08:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8s3X7GHjjzuhT9qU/CUP3owNV4mzb3Rz6jal+GUI0iU=; b=VxvWTfl317ydoh fQpvIYKUDslx4VIY3S5N+M1eudbtLBf1Gezhs7V5gEJ2ipSFHKz+QxyqNG0JMNPEQG9uItbbElFnv A/tViaSTaCj5u8FkHmNrTQnPKNDk0GhDwSSU27W6mjJbVT1B96mY4FT72HHNOZByjMpQJ6bP1wkvO V+ScVnWT/7JXxvj70iQSImF0HBazDCknLy/fhdxv63I7cJNiI/oR7YVPFyBdV+28LO5ob4xCFvCNl O8rI74ciYxLX5yEoct4NbvSM0VpPyYJeLDkQZxcMb8KWCbbFAYrYvSye2cJBOa6WLNUiQ9o3+2sGJ +mjxp6ZlfbqgOM3Nf7Pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyrPf-00C6fw-Te; Wed, 08 Jun 2022 08:51:40 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyrEP-00C1sM-L6 for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 08:40:03 +0000 Received: by mail-pj1-x1032.google.com with SMTP id e24so18014929pjt.0 for ; Wed, 08 Jun 2022 01:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=JASAiT3vXh0ZJKWH+RJe3v1twmK34V/YWwlarnk5/x0=; b=mzh5bNGbHr3vGSP7PJBL66nAkjOZ/q2p2L8puGTWPsHBE8qiaedY6T1LYAjy/dViU2 MIOWg+tV9Id8u1JadoTwdlMJTkOXPbATkDPz22j48vXFBm+UERMywzJuHCK+wvwxkrEo 2lple/TzyYJ9gkFxugOXyrvoHHWnrzaY4PLDqr8YiH1qP5pq1LAo+nfdaLNgQxyEE5/U 5M1a9q9Io3KBHQgg/e8YQk3u60XyR6LJGnxNTnU36cvpLQyS07qWRNhBW6bIFTMr6T1C XktI+luDD4TbwmretCKI+ZJESgm2qvlqjpu77Ore4mLokpYo3RBvjPVr/julwkwlBz/D rS8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=JASAiT3vXh0ZJKWH+RJe3v1twmK34V/YWwlarnk5/x0=; b=MVzocp1vDfXtssc6IGXcqiwtavCNvcACJ5K8+n2ZgRSLNBdQrUjUED2C8/U6S1xNA9 KEI8JBYoFzKlZP8AJeNZtGYjXKKMi90fmAAwergmyb8j82+StemtSxlsE5LJfsbp955e tS+4U7VA2ehTgCQ+pGGfGzue8CMD5UU+3/RIYfqg+nPNz5aSrqrfg2v9TPHkJxF7CFVy kBUSVQOKmLRLowX9a85+mrW5Ru4QcHyU+fQJeCV5ulWEFvKKPHuchREnKu/ZlOAyuyoK v4xQmNWHixMVmdUBfwFvf3m5EFc0MOILR86/iG2v2LLGwC0AQKYYPWIvAW2+33bOkZG4 QbtQ== X-Gm-Message-State: AOAM533EAFKNOLH5Cy3IEHay0rkoWHY29/W6VhhuW/5nVxkan/mlPs/M Fvi3dgqEJwAw8oAyxLxzbIHSI4YyI/g= X-Google-Smtp-Source: ABdhPJz6h8AXUH2LJZjDhTb51xavtnq5fJGuXMz/UJjlqctNAsIAqj4tOG3352gD8ob9z1b304PQ+Q== X-Received: by 2002:a17:90a:9741:b0:1e8:a001:5caa with SMTP id i1-20020a17090a974100b001e8a0015caamr8765872pjw.231.1654677597383; Wed, 08 Jun 2022 01:39:57 -0700 (PDT) Received: from localhost (subs02-180-214-232-66.three.co.id. [180.214.232.66]) by smtp.gmail.com with ESMTPSA id u5-20020a170903108500b00161f9e72233sm13800249pld.261.2022.06.08.01.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:39:56 -0700 (PDT) Date: Wed, 8 Jun 2022 15:39:54 +0700 From: Bagas Sanjaya To: Linux ARM Cc: =?utf-8?Q?Beno=C3=AEt?= Cousson , Tony Lindgren , Rob Herring , Krzysztof Kozlowski , linux-omap@vger.kernel.org, devicetree@vger.kernel.org, Russell King , Linus Walleij , "Russell King (Oracle)" , linux-kernel@vger.kernel.org Subject: virt_to_phys outside array bounds warning (GCC 12.1.0) Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_014001_785580_6D4BF7A3 X-CRM114-Status: UNSURE ( 8.13 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi everyone, When cross-compiling arm 5.19-rc1 kernel using GCC 12.1.0 (armv7 with neon fpu, multi_v7_defconfig), I got outside array bounds warning pointing to virt_to_phys() macro: DTC arch/arm/boot/dts/am335x-evm.dtb In file included from ./arch/arm/include/asm/page.h:163, from ./arch/arm/include/asm/thread_info.h:14, from ./include/linux/thread_info.h:60, from ./include/asm-generic/preempt.h:5, from ./arch/arm/include/generated/asm/preempt.h:1, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:55, from ./include/linux/wait.h:9, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from ./include/linux/proc_fs.h:10, from ./include/linux/efi.h:19, from arch/arm/kernel/setup.c:7: In function 'request_standard_resources', inlined from 'setup_arch' at arch/arm/kernel/setup.c:1158:2: ./arch/arm/include/asm/memory.h:311:22: warning: array subscript -1 is outside array bounds of 'char[2147483647]' [-Warray-bounds] 311 | #define virt_to_phys virt_to_phys arch/arm/kernel/setup.c:855:31: note: in expansion of macro 'virt_to_phys' 855 | kernel_code.end = virt_to_phys(__init_begin - 1); | ^~~~~~~~~~~~ In file included from ./include/linux/pid_namespace.h:7, from ./include/linux/ptrace.h:10, from ./include/linux/elfcore.h:11, from ./include/linux/crash_core.h:6, from ./include/linux/kexec.h:18, from arch/arm/kernel/setup.c:20: ./include/linux/mm.h: In function 'setup_arch': ./include/linux/mm.h:2500:21: note: at offset -1 into object '__init_begin' of size [0, 2147483647] 2500 | extern char __init_begin[], __init_end[]; | ^~~~~~~~~~~~ In function 'request_standard_resources', inlined from 'setup_arch' at arch/arm/kernel/setup.c:1158:2: ./arch/arm/include/asm/memory.h:311:22: warning: array subscript -1 is outside array bounds of 'char[2147483647]' [-Warray-bounds] 311 | #define virt_to_phys virt_to_phys arch/arm/kernel/setup.c:857:31: note: in expansion of macro 'virt_to_phys' 857 | kernel_data.end = virt_to_phys(_end - 1); | ^~~~~~~~~~~~ In file included from ./arch/arm/include/asm/sections.h:5, from ./include/linux/interrupt.h:21, from ./include/linux/rtc.h:17, from ./include/linux/efi.h:20: ./include/asm-generic/sections.h: In function 'setup_arch': ./include/asm-generic/sections.h:41:13: note: at offset -1 into object '_end' of size [0, 2147483647] 41 | extern char _end[]; | ^~~~ Thanks. Reported-by: Bagas Sanjaya -- An old man doll... just what I always wanted! - Clara _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4980DC43334 for ; Wed, 8 Jun 2022 09:19:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234487AbiFHJTu (ORCPT ); Wed, 8 Jun 2022 05:19:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235607AbiFHJPH (ORCPT ); Wed, 8 Jun 2022 05:15:07 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1A411E44C4; Wed, 8 Jun 2022 01:39:57 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id cx11so17988377pjb.1; Wed, 08 Jun 2022 01:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=JASAiT3vXh0ZJKWH+RJe3v1twmK34V/YWwlarnk5/x0=; b=mzh5bNGbHr3vGSP7PJBL66nAkjOZ/q2p2L8puGTWPsHBE8qiaedY6T1LYAjy/dViU2 MIOWg+tV9Id8u1JadoTwdlMJTkOXPbATkDPz22j48vXFBm+UERMywzJuHCK+wvwxkrEo 2lple/TzyYJ9gkFxugOXyrvoHHWnrzaY4PLDqr8YiH1qP5pq1LAo+nfdaLNgQxyEE5/U 5M1a9q9Io3KBHQgg/e8YQk3u60XyR6LJGnxNTnU36cvpLQyS07qWRNhBW6bIFTMr6T1C XktI+luDD4TbwmretCKI+ZJESgm2qvlqjpu77Ore4mLokpYo3RBvjPVr/julwkwlBz/D rS8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=JASAiT3vXh0ZJKWH+RJe3v1twmK34V/YWwlarnk5/x0=; b=WXZznnKjnHdqn8aOMrPBuMwzv3wN01OriIMAV2kbyrGTDltIzp1EnofpXbboLKJcfq CZ9gC3rSdet9WGkncQE5jUlw5c1bEHzNYlaUaIlheOqSiOUKBvlgUHK/JtcinGKM1XLF ao0TsjgEyDgzrA6YW4tjee7A3W8U+GU6XrNUu237KT70tymnk0PWCYZyH04PHJQ2Bkyk Su/IUsYw1K21A843cPBcjvdcQauUdsmAnf6hAUuFE3TIxelwB4HHS3pe5HEGrWPL2F+g vSX12ERJl1JxZEso5GE1M2nLeMXzXzwZ50hVsn1kVoqC/PWW1boss2KNiKxu6o9mtEGI ipdg== X-Gm-Message-State: AOAM531/sRgiXNJGRRrfLPRKu8Wvyn/o34lgWJobXRHimV7/MPaCLJ9s w2F+SacQ5xYd1ONVjI0ini8= X-Google-Smtp-Source: ABdhPJz6h8AXUH2LJZjDhTb51xavtnq5fJGuXMz/UJjlqctNAsIAqj4tOG3352gD8ob9z1b304PQ+Q== X-Received: by 2002:a17:90a:9741:b0:1e8:a001:5caa with SMTP id i1-20020a17090a974100b001e8a0015caamr8765872pjw.231.1654677597383; Wed, 08 Jun 2022 01:39:57 -0700 (PDT) Received: from localhost (subs02-180-214-232-66.three.co.id. [180.214.232.66]) by smtp.gmail.com with ESMTPSA id u5-20020a170903108500b00161f9e72233sm13800249pld.261.2022.06.08.01.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:39:56 -0700 (PDT) Date: Wed, 8 Jun 2022 15:39:54 +0700 From: Bagas Sanjaya To: Linux ARM Cc: =?utf-8?Q?Beno=C3=AEt?= Cousson , Tony Lindgren , Rob Herring , Krzysztof Kozlowski , linux-omap@vger.kernel.org, devicetree@vger.kernel.org, Russell King , Linus Walleij , "Russell King (Oracle)" , linux-kernel@vger.kernel.org Subject: virt_to_phys outside array bounds warning (GCC 12.1.0) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi everyone, When cross-compiling arm 5.19-rc1 kernel using GCC 12.1.0 (armv7 with neon fpu, multi_v7_defconfig), I got outside array bounds warning pointing to virt_to_phys() macro: DTC arch/arm/boot/dts/am335x-evm.dtb In file included from ./arch/arm/include/asm/page.h:163, from ./arch/arm/include/asm/thread_info.h:14, from ./include/linux/thread_info.h:60, from ./include/asm-generic/preempt.h:5, from ./arch/arm/include/generated/asm/preempt.h:1, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:55, from ./include/linux/wait.h:9, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from ./include/linux/proc_fs.h:10, from ./include/linux/efi.h:19, from arch/arm/kernel/setup.c:7: In function 'request_standard_resources', inlined from 'setup_arch' at arch/arm/kernel/setup.c:1158:2: ./arch/arm/include/asm/memory.h:311:22: warning: array subscript -1 is outside array bounds of 'char[2147483647]' [-Warray-bounds] 311 | #define virt_to_phys virt_to_phys arch/arm/kernel/setup.c:855:31: note: in expansion of macro 'virt_to_phys' 855 | kernel_code.end = virt_to_phys(__init_begin - 1); | ^~~~~~~~~~~~ In file included from ./include/linux/pid_namespace.h:7, from ./include/linux/ptrace.h:10, from ./include/linux/elfcore.h:11, from ./include/linux/crash_core.h:6, from ./include/linux/kexec.h:18, from arch/arm/kernel/setup.c:20: ./include/linux/mm.h: In function 'setup_arch': ./include/linux/mm.h:2500:21: note: at offset -1 into object '__init_begin' of size [0, 2147483647] 2500 | extern char __init_begin[], __init_end[]; | ^~~~~~~~~~~~ In function 'request_standard_resources', inlined from 'setup_arch' at arch/arm/kernel/setup.c:1158:2: ./arch/arm/include/asm/memory.h:311:22: warning: array subscript -1 is outside array bounds of 'char[2147483647]' [-Warray-bounds] 311 | #define virt_to_phys virt_to_phys arch/arm/kernel/setup.c:857:31: note: in expansion of macro 'virt_to_phys' 857 | kernel_data.end = virt_to_phys(_end - 1); | ^~~~~~~~~~~~ In file included from ./arch/arm/include/asm/sections.h:5, from ./include/linux/interrupt.h:21, from ./include/linux/rtc.h:17, from ./include/linux/efi.h:20: ./include/asm-generic/sections.h: In function 'setup_arch': ./include/asm-generic/sections.h:41:13: note: at offset -1 into object '_end' of size [0, 2147483647] 41 | extern char _end[]; | ^~~~ Thanks. Reported-by: Bagas Sanjaya -- An old man doll... just what I always wanted! - Clara