Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1692056lqt; Wed, 20 Mar 2024 11:04:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvxg6/Eh2NxGGFaF/Kz+LCtWnQnldbxcA+RtSzzUfPogZCjY8nDtukUzhOI49Kyz9ghA2KuyNgzZlT/s7qNDSrFzZJLCKTGGKZEtUDgA== X-Google-Smtp-Source: AGHT+IHrMc71qDopSG8e3Pr5akWTBPG87SUjY1/zh7h/0YQEJfmOFKI4ghI9u1PHQaRb5yTuip1r X-Received: by 2002:a17:902:ea10:b0:1e0:1496:91ec with SMTP id s16-20020a170902ea1000b001e0149691ecmr8077875plg.20.1710957850732; Wed, 20 Mar 2024 11:04:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710957850; cv=pass; d=google.com; s=arc-20160816; b=oTDPfO71QSL6AxQbw82hsE5TIc4sU6nqjRGcVfepv5isVdUDlW4kvhwogdZKvYLojy RqCPTgdee1PQqHYHOfE0w5vsGWtwLjbHwvsrMiPmxHOFgURTgY5MlFz5/M5JbqStSjJ1 nEsI67Vqq3/AM36tCIbkDH5LYC46YyZiHo9cWn6kdcPCpSwe3BqHBAAPF28OM4OFkdSH W1QG6fA+4oH/ZNio9UEOTpwx19wG2Pw8/F5FKlycFbElY2BbXTGjvlEVXeVdOuGPLaJL o8G8Oz6QnzWUHB9o+7jtz6ztilnIgWcUJ7+ziEsvlqX/ZR0YQh8h1v04MqZ73sYLxI+O MdFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=fuwM+2WorPzN3VVkng9ezD3IVmwolLkEUeOzS+pRzSU=; fh=fS5upSa6OgxAzBCzIXCn7atoae1q5ONlk9PvXZQKOvQ=; b=dyhqfOpWtoR6/rYM+CHwrccQVNL7cc2ajdoHkuHXSX8iA/GuBJjTJurCCKTwixOwnK fNyd5ZJqstseo2mojcwJ0w582ZI8m2g8ue+6/9dokdbBjSc2ijqCNOAQT2+rWehRzuvI 8QPLuUmF/ztDwAjnvjkBYAw0QcrIxZG8OGSeAbXguEoscBQD71u24OFaVhedwXerEJ2G ql3YWfLDlXOG7rY7KlE3E37LBfgGvJ49CKQFfEoVvOlMdVFZrlmZ17c2Mgl77CKTWJBI lW2URUrNKWstc2Y1UbHZTzFg2e9PV+f7ekfOM6HfwAeYl1I0cbSTJdNABwtkKLOwJ3Jd hzhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eMNZ2qoD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109268-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k5-20020a170902d58500b001e001920c4dsi7249869plh.547.2024.03.20.11.04.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 11:04:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eMNZ2qoD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109268-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 169FFB243C2 for ; Wed, 20 Mar 2024 18:02:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 470AD6A8BE; Wed, 20 Mar 2024 18:02:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eMNZ2qoD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 667A96A00B for ; Wed, 20 Mar 2024 18:02:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710957754; cv=none; b=Yqi0dL3TnZAd3yhZK4r9FjH7kJmTKgBkzsvV6XYl/Lq6Oao0BKErwqK3TFiyx9CiIyYkt6MnmKVTlKJiO9EFAOfRWpBWG3X1x4Cp59TMqcuetpV5DlqHYZEsqMVNQTbBdGea5loSWRLK/etJGCKd4soRonyNtQynBEloM9yt5Ck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710957754; c=relaxed/simple; bh=umPOZa/jmcrCOuLgb4lIp085lQH3xXqnpU9motcuApg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=e03dEDvwT8B3tFNTdzN1TXpCOGGMA0Ul3XMaiTUJXhoel3SBR/uFvmmJf6c0Q6PWIrjF6FzCqCyBLL3o2gnQ7ZAp1UaEEIUimsdCNABGo0bjFX3uiKR6PKIsKWXwRuBzjLxOVJM3/Q4jjFkIXxrDwxVZ1RyiHDMj6dnKT3l1HYU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eMNZ2qoD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3104AC433C7; Wed, 20 Mar 2024 18:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710957754; bh=umPOZa/jmcrCOuLgb4lIp085lQH3xXqnpU9motcuApg=; h=From:To:Cc:Subject:Date:From; b=eMNZ2qoDP61ykdvnIIcV4ZHzzHnTNZ4qdh23XzSN0Ei9JCExg30FCnJUHwsQURvVM uuaIpZefH0Zukdoqi+z/aYwI89XYzaF23LHY+rgV8+L9wmiIzkEUZ+ljGPa6LLCKXr Ari8Xx7qP+x2sfDiltFHw0GuUFlYF3ZqGtgaEBU9B71rJefgAzZk5VD7zx0kIu0r7U Bvfia0i+YGPl7SMCuCS7qiY9CWuibLcmzFpjYi+MG/9hFP++p7v7+i7W+khKzmg0Xa 1T/LLC2MaqCUTSVuG1de4+Iy94uwqhYU78VYOF9vJXNdIlQMDxMDRwQ1jJEsDMST9r SfSuVDFOcJz4g== From: Arnd Bergmann To: Michael Ellerman , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino Cc: Arnd Bergmann , linuxppc-dev@lists.ozlabs.org, Anna-Maria Behnsen , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Kees Cook , linux-kernel@vger.kernel.org Subject: [PATCH] vdso: use CONFIG_PAGE_SHIFT in vdso/datapage.h Date: Wed, 20 Mar 2024 19:02:15 +0100 Message-Id: <20240320180228.136371-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann Both the vdso rework and the CONFIG_PAGE_SHIFT changes were merged during the v6.9 merge window, so it is now possible to use CONFIG_PAGE_SHIFT instead of including asm/page.h in the vdso. This avoids the workaround for arm64 and addresses a build warning for powerpc64: In file included from :4: In file included from /home/arnd/arm-soc/arm-soc/lib/vdso/gettimeofday.c:5: In file included from ../include/vdso/datapage.h:25: arch/powerpc/include/asm/page.h:230:9: error: result of comparison of constant 13835058055282163712 with expression of type 'unsigned long' is always true [-Werror,-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 'VIRTUAL_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 'WARN_ON' 88 | int __ret_warn_on = !!(x); \ | ^ Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Vincenzo Frascino Cc: Anna-Maria Behnsen See-also: 8b3843ae3634 ("vdso/datapage: Quick fix - use asm/page-def.h for ARM64") Signed-off-by: Arnd Bergmann --- arch/powerpc/include/asm/vdso/gettimeofday.h | 3 +-- include/vdso/datapage.h | 8 +------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h b/arch/powerpc/include/asm/vdso/gettimeofday.h index f0a4cf01e85c..78302f6c2580 100644 --- a/arch/powerpc/include/asm/vdso/gettimeofday.h +++ b/arch/powerpc/include/asm/vdso/gettimeofday.h @@ -4,7 +4,6 @@ #ifndef __ASSEMBLY__ -#include #include #include #include @@ -95,7 +94,7 @@ const struct vdso_data *__arch_get_vdso_data(void); static __always_inline const struct vdso_data *__arch_get_timens_vdso_data(const struct vdso_data *vd) { - return (void *)vd + PAGE_SIZE; + return (void *)vd + (1U << CONFIG_PAGE_SHIFT); } #endif diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h index 5d5c0b8efff2..c71ddb6d4691 100644 --- a/include/vdso/datapage.h +++ b/include/vdso/datapage.h @@ -19,12 +19,6 @@ #include #include -#ifdef CONFIG_ARM64 -#include -#else -#include -#endif - #ifdef CONFIG_ARCH_HAS_VDSO_DATA #include #else @@ -132,7 +126,7 @@ extern struct vdso_data _timens_data[CS_BASES] __attribute__((visibility("hidden */ union vdso_data_store { struct vdso_data data[CS_BASES]; - u8 page[PAGE_SIZE]; + u8 page[1U << CONFIG_PAGE_SHIFT]; }; /* -- 2.39.2