Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 577DFC2BB85 for ; Thu, 16 Apr 2020 10:45:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1442721973 for ; Thu, 16 Apr 2020 10:45:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="p8BSKiaR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1442721973 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=X60wOIU3JCFsG7XCMdPOrVy/+iLDytvQpuBhYDaA/FE=; b=p8BSKiaRhEM8ab uYD0LntTwWEAr+vf0BXhDTZdA0dhW2kl6nU3NAOaEYu/KHNqQOEy9CQAB22A3m7M3oLv540z6p7fA JAHJaWmDzojc1O7j4M/8s7kTc0kqXxXEVgx0YPUW7U2iaJPaUDAa+pWhwYsyj3EjI9k5Rc6UmB14O MW1wo1f+F66Z0c2X6bOonb4kRNjdJIL6vOEM0yzAnQ2PstFKlztiabCjn84Iiau2QRnNT71Upf+D3 rEdPDGHPI3T9aQsbKwt+zlSimp0IjI1EsOF0Qu4n33EvMKL+GfbQlm2JHfHJ/uoPoVOmpbfRJv90T nC4YRHu3kJOZxDcwmk6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jP21Y-000829-MZ; Thu, 16 Apr 2020 10:45:36 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jP21V-00081X-R2 for linux-arm-kernel@lists.infradead.org; Thu, 16 Apr 2020 10:45:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EB356C14; Thu, 16 Apr 2020 03:45:30 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D08083F73D; Thu, 16 Apr 2020 03:45:29 -0700 (PDT) Date: Thu, 16 Apr 2020 11:45:27 +0100 From: Mark Rutland To: Andrei Vagin Subject: Re: [PATCH 3/6] arm64/vdso: Add time napespace page Message-ID: <20200416104527.GD4987@lakrids.cambridge.arm.com> References: <20200416052618.804515-1-avagin@gmail.com> <20200416052618.804515-4-avagin@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200416052618.804515-4-avagin@gmail.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200416_034533_918447_4A448240 X-CRM114-Status: GOOD ( 15.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Safonov , Catalin Marinas , linux-kernel@vger.kernel.org, Thomas Gleixner , Vincenzo Frascino , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Andrei, On Wed, Apr 15, 2020 at 10:26:15PM -0700, Andrei Vagin wrote: > diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h > index 07468428fd29..351c145d3808 100644 > --- a/arch/arm64/include/asm/vdso.h > +++ b/arch/arm64/include/asm/vdso.h > @@ -12,6 +12,12 @@ > */ > #define VDSO_LBASE 0x0 > > +#ifdef CONFIG_TIME_NS > +#define __VVAR_PAGES 2 > +#else > +#define __VVAR_PAGES 1 > +#endif > + > #ifndef __ASSEMBLY__ > +#ifdef CONFIG_TIME_NS > +static __always_inline const struct vdso_data *__arch_get_timens_vdso_data(void) > +{ > + const struct vdso_data *ret; > + > + ret = _timens_data; > + OPTIMIZER_HIDE_VAR(ret); > + > + return ret; > +} > +#endif Sorry for the confusion here, but please either: * Add a preparatory patch making __arch_get_vdso_data() use OPTIMIZER_HIDE_VAR(), and use OPTIMIZER_HIDE_VAR() here. * Use the same assembly as __arch_get_vdso_data() currently does. ... and either way add a comment here: /* See __arch_get_vdso_data() */ ... so taht the rationale is obvious. [...] > +enum vvar_pages { > + VVAR_DATA_PAGE_OFFSET = 0, > +#ifdef CONFIG_TIME_NS > + VVAR_TIMENS_PAGE_OFFSET = 1, > +#endif /* CONFIG_TIME_NS */ > + VVAR_NR_PAGES = __VVAR_PAGES, > +}; Pet peeve, but we don't need the initializers here, as enums start from zero. The last element shouldn't have a trailing comma as we don't expect to add elements after it in future. Rather than assigning to VVAR_NR_PAGES, it'd be better to use a BUILD_BUG_ON() to verify that it is the number we expect: enum vvar_pages { VVAR_DATA_PAGE, #ifdef CONFIG_TIME_NS VVAR_TIMENS_PAGE, #endif VVAR_NR_PAGES }; BUILD_BUG_ON(VVAR_NR_PAGES != __VVAR_PAGES); Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel