Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4801811ybv; Wed, 26 Feb 2020 03:21:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxZY9scmYqN9zpG7og+fO4FATeox5XvLFDkKjTXT4EaMZ4C6F57TZi5XReI7dLVdrDn93oP X-Received: by 2002:aca:f242:: with SMTP id q63mr2714937oih.72.1582716109296; Wed, 26 Feb 2020 03:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582716109; cv=none; d=google.com; s=arc-20160816; b=tQF5teTXVrfL3+9cqepbyRsa0t0WKzCqicbsD6zmZQ8hep1O6oqS2KuNKFZomyNg0Z CmdR1fptdzJSRzkgEo8zlCuFZhx0lrF8pwWArYGg4URVe4xzDfPwOTx2AyGung3j3Gu6 LvWlchr/EiC95ml42xjvFWjj9stOliFDSKMsRghyZq37hdEbhThqPHimFiY91pvGo7gw 69IxNJZ5zDdPNP4cQVZVY1DKnDVqhhZzGS8tyELa36zX5uxG5rR7gAqX/y4t9XuhI3QL APNfD2gu/iDSHiah/Piiu29EpJxz1chH/1FRx1HcUsCq7miZhium7yQmXAQQJBwmcZFz RoPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=u+44lvk1l0rvN0rVt0XeRLZF9pAnZ+SeTYsCRW90jUs=; b=Y59kTyl+VMeuHLWzegRjyszYgnYouEMckoImoDD7WqNNDkbY3MWEINDq79OlWBGKSL fWzH9An8aSGHlabt6C0/5CR5VFwiik0QjJwQqIf+qF3EC6Q9kJSBt94BJY1SXMLztc+L XKbzlN98g3YUf0zuXaXYA9Tr81xTtb9+roWnyfUod8k9czCgLeG7QDrqYOnwsBMMGJMu bw88bqpxh7BprrEVyNkx2op5/FgsRvsGPOftFr+rrF51gzgRGoICaQEhR6moiJeTeEah bvAG+q1sgXHdZnGMt5dvLQv2G4rScwjxlYPJ7sCvKJw6oBGj9wsG5HuR2xn5l065Suef NEGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=dcbZx4t5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si1022685oie.81.2020.02.26.03.21.37; Wed, 26 Feb 2020 03:21:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=dcbZx4t5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728237AbgBZLVH (ORCPT + 99 others); Wed, 26 Feb 2020 06:21:07 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:65462 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727974AbgBZLVG (ORCPT ); Wed, 26 Feb 2020 06:21:06 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48SCzM1tTVz9tyML; Wed, 26 Feb 2020 12:21:03 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=dcbZx4t5; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id J7zfGGKBixz2; Wed, 26 Feb 2020 12:21:03 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48SCzL6n6pz9tyLT; Wed, 26 Feb 2020 12:21:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582716063; bh=u+44lvk1l0rvN0rVt0XeRLZF9pAnZ+SeTYsCRW90jUs=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=dcbZx4t5T2TqZBsmJqeETgOslZL/sjGjY3jtgZjyAkWRnWp+cZWdaA9+1CVcQnyrg EAK/r3fzS6yjM9r4KrQXdxQ3U95U+v+IizkroXw9QSoxVs+Y7bA5gjhV+iBVeI3LhD 1eV+B927JsHKM6Lu+qpoDnmZLHfscXCGj3HKorDY= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 166CF8B844; Wed, 26 Feb 2020 12:21:04 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id HTbfYZhVV_tY; Wed, 26 Feb 2020 12:21:03 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B0DBC8B776; Wed, 26 Feb 2020 12:21:01 +0100 (CET) Subject: Re: [PATCH v2 07/13] powerpc: add support for folded p4d page tables To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Andrew Morton , Arnd Bergmann , Benjamin Herrenschmidt , Brian Cain , Catalin Marinas , Fenghua Yu , Geert Uytterhoeven , Guan Xuetao , James Morse , Jonas Bonn , Julien Thierry , Ley Foon Tan , Marc Zyngier , Michael Ellerman , Paul Mackerras , Rich Felker , Russell King , Stafford Horne , Stefan Kristiansson , Suzuki K Poulose , Tony Luck , Will Deacon , Yoshinori Sato , kvmarm@lists.cs.columbia.edu, kvm-ppc@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, uclinux-h8-devel@lists.sourceforge.jp, Mike Rapoport References: <20200216081843.28670-1-rppt@kernel.org> <20200216081843.28670-8-rppt@kernel.org> <20200218105440.GA1698@hump> <20200226091315.GA11803@hump> <20200226105615.GB11803@hump> From: Christophe Leroy Message-ID: <7a008227-433c-73d7-b01a-1c6c7c66f04e@c-s.fr> Date: Wed, 26 Feb 2020 12:20:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200226105615.GB11803@hump> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 26/02/2020 à 11:56, Mike Rapoport a écrit : > On Wed, Feb 26, 2020 at 10:46:13AM +0100, Christophe Leroy wrote: >> >> >> Le 26/02/2020 à 10:13, Mike Rapoport a écrit : >>> On Tue, Feb 18, 2020 at 12:54:40PM +0200, Mike Rapoport wrote: >>>> On Sun, Feb 16, 2020 at 11:41:07AM +0100, Christophe Leroy wrote: >>>>> >>>>> >>>>> Le 16/02/2020 à 09:18, Mike Rapoport a écrit : >>>>>> From: Mike Rapoport >>>>>> >>>>>> Implement primitives necessary for the 4th level folding, add walks of p4d >>>>>> level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h. >>>>> >>>>> I don't think it is worth adding all this additionnals walks of p4d, this >>>>> patch could be limited to changes like: >>>>> >>>>> - pud = pud_offset(pgd, gpa); >>>>> + pud = pud_offset(p4d_offset(pgd, gpa), gpa); >>>>> >>>>> The additionnal walks should be added through another patch the day powerpc >>>>> need them. >>>> >>>> Ok, I'll update the patch to reduce walking the p4d. >>> >>> Here's what I have with more direct acceses from pgd to pud. >> >> I went quickly through. This looks promising. >> >> Do we need the walk_p4d() in arch/powerpc/mm/ptdump/hashpagetable.c ? >> Can't we just do >> >> @@ -445,7 +459,7 @@ static void walk_pagetables(struct pg_state *st) >> addr = KERN_VIRT_START + i * PGDIR_SIZE; >> if (!pgd_none(*pgd)) >> /* pgd exists */ >> - walk_pud(st, pgd, addr); >> + walk_pud(st, p4d_offset(pgd, addr), addr); > > We can do > > addr = KERN_VIRT_START + i * PGDIR_SIZE; > p4d = p4d_offset(pgd, addr); > if (!p4d_none(*pgd)) > walk_pud() > > But I don't think this is really essential. Again, we are trading off code > consistency vs line count. I don't think line count is that important. Ok. Christophe