Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp422858lqp; Thu, 21 Mar 2024 05:43:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV0AywTbJdYNnT5T4K9id7CFpOBfrW/T7NW2GOMTPMvI3b25RahpPtH5D5jPabZweLr2+GX3I8CkezSrGekxINSQM+aK7ohTyJclwT+tQ== X-Google-Smtp-Source: AGHT+IFos2UGzM6pYUNDlH+HJ+xxf0jVcdmW/XJ82Ps/qvx/iJBeYpAO2NNxAciovcjxuQPh86uh X-Received: by 2002:a05:6902:268a:b0:dc2:65da:d3af with SMTP id dx10-20020a056902268a00b00dc265dad3afmr1690146ybb.65.1711024982300; Thu, 21 Mar 2024 05:43:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711024982; cv=pass; d=google.com; s=arc-20160816; b=ZrWuoVHEn8/yJKT3JBq/LCJRNamrVsEGU6MUv3q3PV8c9t55d9NqAJfuPsVPPd4LWT X6H6DpGEUpHvD9U75Fl2W7vWJqWwTcH4Cefi24uF/v3H9lyLsxf2UIwBCyx9NN9lePlU ZBs8UB0OmPG7xK/4fdVYS78HQvQVdGN+GnAxluju0IzjP9tnqa+mql7dBe6e3zEj+XIe 19y6w0SuyfE8ByDzvSp3FFLAtzf+zRG06bMYHXrWqp5f+XAHypWUc0ywgOJbPNxAw3r3 5ZEaRGZdr4XJ8rHl6n6Q/KS0K7vdm+BZY/VPb+GGk5IudPBmqzuxjGpvwFiuwVD5BK0K gi0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=/zO2JRQSx2yIFlQ7GeaMJ96UTln9Ndn56Jfacwy/vnQ=; fh=a+BHXLzQ9bAUwahXcBpquMSiByfZ9shClzdA8atjgE4=; b=pu+03ponuq6SAn+EwsdmKzjXCoogUXIGNNspPFW2nfc7Iot+exAgsbIhR6S8991Pwk mVDTH56lW0CyLRA1oa3nJ6gp2ozIPUXrwn/Yue9wURvyP/+xO/W5Vn8Bfk3oQp3HA2P5 j7r94D/DQNzMbjvtDjPNIHmW8XYGiG6YEtWYzuNcJVq1ato1jGBS5PhY7sXxmwhLqim3 frY38HRcf8CGK9O/FsphA9ahJAtZXMpblnRVkArU5CBJd1uevPkVqOCao5Y9RkPEKI8/ MF2DlBrUXy45Ml8ROloEI+2Y/e2MPERYVMonlc5Qu1HwjbuCmfMW75wg3/G5LMmjlpVF t26w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=lBaQYgeM; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-110044-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110044-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e5-20020a05622a110500b0042ef86264efsi3979109qty.277.2024.03.21.05.43.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 05:43:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110044-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=lBaQYgeM; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-110044-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110044-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EEC2A1C21653 for ; Thu, 21 Mar 2024 12:43:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E8A783CBB; Thu, 21 Mar 2024 12:42:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="lBaQYgeM" Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (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 004C379B8E for ; Thu, 21 Mar 2024 12:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711024976; cv=none; b=UdROgWF754vnqszcg7zCPkzFsYsbFY2ZmXTQgjto2kahIUUBAreNxLPtbidXxb1zvESt3ECjPUrTds8+cWZn6pcys28wwp1PvfH1th9bQP/sxWdIe4o1GFrfZCEnQ9jJ9lClkMGeHj7UMpwDzQWwdOuNr/u/ZUPxNZSBtBL+Xg4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711024976; c=relaxed/simple; bh=NNxhDZjT+rNDq/hX0SWVPFMlR2IKBPmi54Pihb/EZ38=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=BpK7JvBsp1N7sEhoek/of3jVLUHo1WPp4KcscvOny+PBKhvoIcQ3KsARgNXcWJT+XA/XcIjmU5qED244aYYTvxk7M05q/0o5FGDluOifDXJDwIp8ARwhz8A2j+Mt2iqgHylIIY+NfTmJ8RGQpPctoQpis/9OrIrJP5Bo/Rg2oAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=lBaQYgeM; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1711024971; bh=/zO2JRQSx2yIFlQ7GeaMJ96UTln9Ndn56Jfacwy/vnQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=lBaQYgeMMrcVUleS2KE4HTsdvyldimLhhCWWn2WAZs2wy3Zka8ZPQsaUnnvlvC0Ss UTz3xCPF4Dvkp9/fccVpDduN8LM89uK2STyGhnCIihvBEIULmhqN6IieMTtku6V57i pP+2qv97wswBvqiLdss5oo1M5hLlLxbWkuVzaSZZx19UFSAlNmCTDf/2KichNubu7E VHfnBxtamfBzC9Vxa3lGs3dn5aQgIfi7uw9sfsgG9Dx358AgzKri6sVGfritGheAr5 PhffbH8Mqa85tDjjE2M+yvephpZ2lkBysWRs7RTaTOsZensk+oQ5hzqyQg+fMsb7ri i4uc2XtRftH5w== 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 4V0lVK2PzKz4wc1; Thu, 21 Mar 2024 23:42:49 +1100 (AEDT) From: Michael Ellerman To: Arnd Bergmann , 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: Re: [PATCH] vdso: use CONFIG_PAGE_SHIFT in vdso/datapage.h In-Reply-To: <20240320180228.136371-1-arnd@kernel.org> References: <20240320180228.136371-1-arnd@kernel.org> Date: Thu, 21 Mar 2024 23:42:46 +1100 Message-ID: <87h6gzzrg9.fsf@mail.lhotse> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Arnd Bergmann writes: > 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(-) Acked-by: Michael Ellerman (powerpc) cheers > 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