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 X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 20323C2D0E3 for ; Thu, 10 Sep 2020 08:33:09 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 B4E7020770 for ; Thu, 10 Sep 2020 08:33:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ODos7A6A"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MN+S4xeq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4E7020770 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:Reply-To:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QRCjCM9xEWRAdB4Nf9YBdagpZHKFeo7I6lZ4RV/BtD8=; b=ODos7A6AeIiU+r jwuKZtoXSvpmGKXWPHYgTTEzJ8DAn1MtOp8OSaePuF/XN4aP7Jz7eIEdM9kKLXYYO5itce3A2uK01 /kXzTc0AHALq7t6U2gIEe8y0xc52cJsUjkb36NTtMaqC+3r/FPr7CPeBjEFca/vWugdoUa4H0b8DS D2/p/LrcHKSkRpaSzzGjmMpG7JEda4cJKgCArVZo86g8JHYWpYGad8MBHS/B2aUVjbUqHeCdBispH 2gW8jSH/0yCK6PqttZ24DehPAe9GbKbTnLImTHmv8rXkTJfnWEmzo6kwCxBgoKlSkSZuv5m0PzNa6 JRE2GmXyXMgt6TObfG6A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGHzm-0004nU-2T; Thu, 10 Sep 2020 08:31:54 +0000 Received: from us-smtp-2.mimecast.com ([207.211.31.81] helo=us-smtp-delivery-1.mimecast.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGHze-0004ll-V5 for linux-arm-kernel@lists.infradead.org; Thu, 10 Sep 2020 08:31:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599726705; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7fZGuKxC07VUp0Irvl6Nj323Z7bzMsW/GZh3NECR3ds=; b=MN+S4xeqDGIOZZUkze5yWlWby3n6p1SELyAaIji6aufskQf0vNImO+TLLE68DLlsxFp/DK DhDBgehhyR+eOQM0ek3PZOq8T1+UMCVZHx/LKLztB9RQXsVyPdsm8bK0OQEBJ8exAUvsYR MGD312bQvrYzRdmYm+raVd4a16cg848= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-k5TyNAz2OYi7rm-KVdWm5A-1; Thu, 10 Sep 2020 04:31:44 -0400 X-MC-Unique: k5TyNAz2OYi7rm-KVdWm5A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B3DB21005E5A; Thu, 10 Sep 2020 08:31:42 +0000 (UTC) Received: from [10.64.54.123] (vpn2-54-123.bne.redhat.com [10.64.54.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FFFE10001B3; Thu, 10 Sep 2020 08:31:40 +0000 (UTC) Subject: Re: [PATCH 2/2] arm64/mm: Use CONT_SHIFT to define CONT_PTE_SHIFT To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org References: <20200908071931.47767-1-gshan@redhat.com> <20200908071931.47767-2-gshan@redhat.com> <459d0f64-fea9-a060-91a5-17a37834fb1b@arm.com> From: Gavin Shan Message-ID: <283283a2-f516-6890-ae25-101d2b1b46a2@redhat.com> Date: Thu, 10 Sep 2020 18:31:38 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <459d0f64-fea9-a060-91a5-17a37834fb1b@arm.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200910_043147_074458_D425F2FD X-CRM114-Status: GOOD ( 19.44 ) 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: , Reply-To: Gavin Shan Cc: catalin.marinas@arm.com, will@kernel.org, linux-kernel@vger.kernel.org, shan.gavin@gmail.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Anshuman, On 9/10/20 4:17 PM, Anshuman Khandual wrote: > On 09/08/2020 12:49 PM, Gavin Shan wrote: >> The macro CONT_PTE_SHIFT actually depends on CONT_SHIFT, which has >> been defined in page-def.h, based on CONFIG_ARM64_CONT_SHIFT. Lets >> reflect the dependency. >> >> Signed-off-by: Gavin Shan >> --- >> arch/arm64/include/asm/pgtable-hwdef.h | 4 +--- >> 1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h >> index 8a399e666837..0bd9469f4323 100644 >> --- a/arch/arm64/include/asm/pgtable-hwdef.h >> +++ b/arch/arm64/include/asm/pgtable-hwdef.h >> @@ -81,14 +81,12 @@ >> /* >> * Contiguous page definitions. >> */ >> +#define CONT_PTE_SHIFT (CONT_SHIFT + PAGE_SHIFT) >> #ifdef CONFIG_ARM64_64K_PAGES >> -#define CONT_PTE_SHIFT (5 + PAGE_SHIFT) >> #define CONT_PMD_SHIFT (5 + PMD_SHIFT) >> #elif defined(CONFIG_ARM64_16K_PAGES) >> -#define CONT_PTE_SHIFT (7 + PAGE_SHIFT) >> #define CONT_PMD_SHIFT (5 + PMD_SHIFT) >> #else >> -#define CONT_PTE_SHIFT (4 + PAGE_SHIFT) >> #define CONT_PMD_SHIFT (4 + PMD_SHIFT) >> #endif > Could not a similar CONT_PMD be created from a new CONFIG_ARM64_CONT_PMD > config option, which would help unify CONT_PMD_SHIFT here as well ? > I was thinking of it, to have CONFIG_ARM64_CONT_PMD and defined the following macros in arch/arm64/include/asm/page-def.h: #define CONT_PMD_SHIFT CONFIG_ARM64_CONT_PMD_SHIFT #define CONT_PMD_SIZE (_AC(1, UL) << (CONT_PMD_SHIFT + PMD_SHIFT) #define CONT_PMD_MASK (~(CONT_PMD_SIZE - 1)) PMD_SHIFT is variable because PMD could be folded into PUD or PGD, depending on the kernel configuration. PMD_SHIFT is declared in arch/arm64/include/asm/pgtable-types.h, which isn't supposed to be included in "page-def.h". So the peroper way to handle this might be drop the continuous page macros in page-def.h and introduce the following ones into pgtable-hwdef.h. I will post v2 to do this if it sounds good to you. #define CONT_PTE_SHIFT (CONFIG_ARM64_CONT_PTE_SHIFT + PAGE_SHIFT) #define CONT_PMD_SHIFT (CONFIG_ARM64_CONT_PMD_SHIFT + PMD_SHIFT) Thanks, Gavin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel