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 0DCB7C4332F for ; Fri, 10 Nov 2023 18:11:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344785AbjKJSLx (ORCPT ); Fri, 10 Nov 2023 13:11:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345501AbjKJSLK (ORCPT ); Fri, 10 Nov 2023 13:11:10 -0500 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF7D5BB0 for ; Thu, 9 Nov 2023 22:16:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1699597013; bh=k0KT7Oc2LV3aJGmLjsBXdbW4OHO2DCMqzsHH5BrfELg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JSm2Pp03lkuqDWdRwEMo9S5q57PZwl9vN6GV6MhXcLtNfKtXhuJMDIdsmnCHWCF78 RFlV6VS2qsWX/9UX747o1ZHNpIUIbS86oBi78Oe9z+OdCrQ2bBQTm0Uso8BnbozgQZ pBBOKo5MR3VQqVdia5hsizzklFqwulN0vGFOiKUW+U6kcI6vyEdDw38PEwIkXnZvxn toxVAS0dOfanZFErxdXqAcAnWbRBhEk4y4+a+HVUi4kUjTdhOJkyaTOvz24CDHWwYp PEzVLqlQHZt8/3hfp+1dI7qe4Vzi0LJclv+JXZGTGPKNlxY/pauVX/y10bUy8J1o8W bWNO6Bdw8kYzA== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4SRT9w6gPLz4x1v; Fri, 10 Nov 2023 17:16:52 +1100 (AEDT) From: Michael Ellerman To: Linus Walleij Cc: Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH] powerpc: Fix signature of pfn_to_kaddr() In-Reply-To: References: <20231106-virt-to-pfn-fix-ppc-v1-1-93197a7ccab4@linaro.org> <87ttpyw1ez.fsf@mail.lhotse> Date: Fri, 10 Nov 2023 17:16:52 +1100 Message-ID: <87bkc28757.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Walleij writes: > On Tue, Nov 7, 2023 at 6:57=E2=80=AFAM Michael Ellerman wrote: > >> I'm struggling to connect the removal of const with those bug reports. >> It looks like all those warnings are about 0xc000000000000000 being >> outside the range of unsigned long when building 32-bit. > > Aha right. I wonder what actually causes that. It is the 32-bit VDSO being built: VDSO32C arch/powerpc/kernel/vdso/vgettimeofday-32.o In file included from :4: In file included from /home/michael/linux/lib/vdso/gettimeofday.c:5: In file included from ../include/vdso/datapage.h:137: In file included from ../arch/powerpc/include/asm/vdso/gettimeofday.h:7: ../arch/powerpc/include/asm/page.h:230:9: warning: result of comparison= of constant 13835058055282163712 with expression of type 'unsigned long' i= s always true [-Wtautological-constant-out-of-range-compare] 230 | return __pa(kaddr) >> PAGE_SHIFT; | ^~~~~~~~~~~ ../arch/powerpc/include/asm/page.h:217:37: note: expanded from macro '_= _pa' 217 | VIRTUAL_WARN_ON((unsigned long)(x) < PAGE_OFFSET); = \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../arch/powerpc/include/asm/page.h:202:73: note: expanded from macro 'V= IRTUAL_WARN_ON' 202 | #define VIRTUAL_WARN_ON(x) WARN_ON(IS_ENABLED(CONFIG_DEBUG= _VIRTUAL) && (x)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~^~~ ../arch/powerpc/include/asm/bug.h:88:25: note: expanded from macro 'WAR= N_ON' 88 | int __ret_warn_on =3D !!(x); = \ | ^ Which is a bit of a frankenstein, because we're building 32-bit VDSO code for a 64-bit kernel, and using some of the kernel headers for that. So the warning is correct, we are doing a tautological comparison. Except that we're not actually using that code in the VDSO, it's just included in the VDSO because it needs PAGE_SHIFT. Anyway none of that is your fault, you just had the misfortune of touching page.h :) I think I see a way to clean it up. Will send a patch. cheers