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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 E44D9C4363A for ; Thu, 29 Oct 2020 00:35:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 949F1207E8 for ; Thu, 29 Oct 2020 00:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603931714; bh=dkbTH9Le4h56RNP77vJJswVlJA/MlUGBPK0NF5o7eyo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=YtC1AO1mRdDwIpIcCVpCSm7MQKkIUmfgvF7QmMW7X1S93MAKLtONGgTG3nc08GD1G xCx/m9jUycx9GKKo1BEP7nm4//JQBYf9M4Ia28K4tDNX0ROn5k1N8GxMpaAKgTzz+H ZYXulDEqPBhyBJnqvL2rp0GRO8PGrXIohWQlY/OU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731942AbgJ1WT2 (ORCPT ); Wed, 28 Oct 2020 18:19:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:60546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731687AbgJ1WRl (ORCPT ); Wed, 28 Oct 2020 18:17:41 -0400 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B58EA24740 for ; Wed, 28 Oct 2020 13:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603890293; bh=dkbTH9Le4h56RNP77vJJswVlJA/MlUGBPK0NF5o7eyo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tabdqm2aJplXzKMgJ4nEeAG7z+7hbXIKb28PV3gCParplhx60j6wyViEcvSEuo27Y O4PIv86W0HscH+Q6f7Vx4j4bFY6j0C9Xa7OkWOSaa9ZjdPcDbS5g0xKbz1gNI9jXCk MTzTVu9CMX5VX+Oh6Miz2yAkEq1IsphCCpJu+M3Y= Received: by mail-oi1-f173.google.com with SMTP id k65so4858475oih.8 for ; Wed, 28 Oct 2020 06:04:53 -0700 (PDT) X-Gm-Message-State: AOAM533a4XMUUxPd8BJbkBM5DE2lwP+WqdTNa4X8TPboX0R3orUXf4gJ QOG14tuiPRXrqsNSae3Fz+wSKvJWM0ahBBIrliM= X-Google-Smtp-Source: ABdhPJwDMaP1MChXtj96eDV5/lC/V7LA3nnYGs5OIihSuUHr4A+qiej0MBLIqCZ7zW4kHe/CabJxRTyy7vDTmA3xz1U= X-Received: by 2002:aca:2310:: with SMTP id e16mr4878752oie.47.1603890292927; Wed, 28 Oct 2020 06:04:52 -0700 (PDT) MIME-Version: 1.0 References: <20201007083944.27910-1-ardb@kernel.org> <20201007083944.27910-3-ardb@kernel.org> <920965b8-6f87-3f82-9fce-d3051fc543ca@samsung.com> <20201028130050.GL1551@shell.armlinux.org.uk> In-Reply-To: <20201028130050.GL1551@shell.armlinux.org.uk> From: Ard Biesheuvel Date: Wed, 28 Oct 2020 14:04:41 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] ARM: move device tree mapping out of linear region To: Russell King - ARM Linux admin Cc: Joel Stanley , Marek Szyprowski , Linux ARM , Linux Samsung SOC , Krzysztof Kozlowski , Linus Walleij , Florian Fainelli , Rob Herring , Nicolas Pitre , =?UTF-8?Q?C=C3=A9dric_Le_Goater?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org On Wed, 28 Oct 2020 at 14:01, Russell King - ARM Linux admin wrote: > > On Wed, Oct 28, 2020 at 01:52:48PM +0100, Ard Biesheuvel wrote: > > Does this help? > > > > diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h > > index bb79e52aeb90..4f355bda872a 100644 > > --- a/arch/arm/include/asm/memory.h > > +++ b/arch/arm/include/asm/memory.h > > @@ -68,8 +68,8 @@ > > #define XIP_VIRT_ADDR(physaddr) (MODULES_VADDR + ((physaddr) & 0x000fffff)) > > > > #define FDT_FIXED_BASE UL(0xff800000) > > -#define FDT_FIXED_SIZE (2 * PMD_SIZE) > > -#define FDT_VIRT_ADDR(physaddr) ((void *)(FDT_FIXED_BASE | > > (physaddr) % PMD_SIZE)) > > +#define FDT_FIXED_SIZE (2 * SECTION_SIZE) > > +#define FDT_VIRT_ADDR(physaddr) ((void *)(FDT_FIXED_BASE | > > (physaddr) % SECTION_SIZE)) > > Is this correct? If the FDT fixed size is 2x, why does FDT_VIRT_ADDR() > only work for half of it? > Perhaps the naming is confusing. This is only used to obtain the start of the virtually mapped DT, which amounts to the virtual address of the section plus the physical address modulo the section size. I will rename physaddr to physbase when I respin this as a patch. Shall I rename FDT_VIRT_ADDR to FDT_VIRT_BASE as well? 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=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 D20B3C388F7 for ; Wed, 28 Oct 2020 13:05:35 +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 4E1D02473F for ; Wed, 28 Oct 2020 13:05:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FR/l+mTk"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="tabdqm2a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E1D02473F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gxjOkJ7X59Xrr0mHG1UN+aHP8eoRi9VTrv8iwqOwkf0=; b=FR/l+mTkoGP9rZIJaPqHxgLEY zWwAIz8XIhUGbvVfceOF4HQ3n10Di8jzofCgRe3vL0TaVTrHh7HTxS7T/RI+t+Ud4HuNh9koFkSD8 HG69cOHagU5A4VGe/uMwpAFA1YRYLsIJis6ScRLBZDNJxNUSj0DciU+i0ySbVttIsyuPD86xy+ix1 DXHdhHfND3edOIuiHQNSpmDZvFLHdnuV5b6Wq6zadLUhzdXlQ1/XrMQ82B953uzhhfhjTEG0whcji En0s99/oj7xfMieAWxxQmNHlIUA3/3u5hsAndHec3EOYE92x2ZtZdt82IbKwoc8JRkWAjF7xKrhfc fcNZUjzrg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXl8L-0007Xy-Rl; Wed, 28 Oct 2020 13:04:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXl8J-0007XC-55 for linux-arm-kernel@lists.infradead.org; Wed, 28 Oct 2020 13:04:56 +0000 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C862024749 for ; Wed, 28 Oct 2020 13:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603890293; bh=dkbTH9Le4h56RNP77vJJswVlJA/MlUGBPK0NF5o7eyo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tabdqm2aJplXzKMgJ4nEeAG7z+7hbXIKb28PV3gCParplhx60j6wyViEcvSEuo27Y O4PIv86W0HscH+Q6f7Vx4j4bFY6j0C9Xa7OkWOSaa9ZjdPcDbS5g0xKbz1gNI9jXCk MTzTVu9CMX5VX+Oh6Miz2yAkEq1IsphCCpJu+M3Y= Received: by mail-oi1-f181.google.com with SMTP id x203so4843870oia.10 for ; Wed, 28 Oct 2020 06:04:53 -0700 (PDT) X-Gm-Message-State: AOAM5323iQKp5sb3VDj6rTEL/3bwRXk5FMMbu6OY81SpF+qSxUU9Yq8z 11bJ7ndjfYWYjgaBCke05LVW0zb1BnJimFSOKH0= X-Google-Smtp-Source: ABdhPJwDMaP1MChXtj96eDV5/lC/V7LA3nnYGs5OIihSuUHr4A+qiej0MBLIqCZ7zW4kHe/CabJxRTyy7vDTmA3xz1U= X-Received: by 2002:aca:2310:: with SMTP id e16mr4878752oie.47.1603890292927; Wed, 28 Oct 2020 06:04:52 -0700 (PDT) MIME-Version: 1.0 References: <20201007083944.27910-1-ardb@kernel.org> <20201007083944.27910-3-ardb@kernel.org> <920965b8-6f87-3f82-9fce-d3051fc543ca@samsung.com> <20201028130050.GL1551@shell.armlinux.org.uk> In-Reply-To: <20201028130050.GL1551@shell.armlinux.org.uk> From: Ard Biesheuvel Date: Wed, 28 Oct 2020 14:04:41 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] ARM: move device tree mapping out of linear region To: Russell King - ARM Linux admin X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201028_090455_284371_D042A094 X-CRM114-Status: GOOD ( 21.31 ) 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: Linux Samsung SOC , Nicolas Pitre , Linus Walleij , Krzysztof Kozlowski , Rob Herring , =?UTF-8?Q?C=C3=A9dric_Le_Goater?= , Florian Fainelli , Joel Stanley , Linux ARM , Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 28 Oct 2020 at 14:01, Russell King - ARM Linux admin wrote: > > On Wed, Oct 28, 2020 at 01:52:48PM +0100, Ard Biesheuvel wrote: > > Does this help? > > > > diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h > > index bb79e52aeb90..4f355bda872a 100644 > > --- a/arch/arm/include/asm/memory.h > > +++ b/arch/arm/include/asm/memory.h > > @@ -68,8 +68,8 @@ > > #define XIP_VIRT_ADDR(physaddr) (MODULES_VADDR + ((physaddr) & 0x000fffff)) > > > > #define FDT_FIXED_BASE UL(0xff800000) > > -#define FDT_FIXED_SIZE (2 * PMD_SIZE) > > -#define FDT_VIRT_ADDR(physaddr) ((void *)(FDT_FIXED_BASE | > > (physaddr) % PMD_SIZE)) > > +#define FDT_FIXED_SIZE (2 * SECTION_SIZE) > > +#define FDT_VIRT_ADDR(physaddr) ((void *)(FDT_FIXED_BASE | > > (physaddr) % SECTION_SIZE)) > > Is this correct? If the FDT fixed size is 2x, why does FDT_VIRT_ADDR() > only work for half of it? > Perhaps the naming is confusing. This is only used to obtain the start of the virtually mapped DT, which amounts to the virtual address of the section plus the physical address modulo the section size. I will rename physaddr to physbase when I respin this as a patch. Shall I rename FDT_VIRT_ADDR to FDT_VIRT_BASE as well? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel