Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp706688pxk; Sun, 30 Aug 2020 20:50:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE/aUU7hc3vR46fKEziY1GIBlt4WPgOyoya78VHwLb6ldzXAzyEXTqFziHoLg35W4qXDZy X-Received: by 2002:a17:906:255b:: with SMTP id j27mr10166213ejb.46.1598845800465; Sun, 30 Aug 2020 20:50:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598845800; cv=none; d=google.com; s=arc-20160816; b=lyTocvFCxBQeEmseYU9wLfGlwW41AqikduQTdsGVTxCTNAOku2oxIrvNE0lNCOpYZz pwbMq0s9ZV4HVVd6n3Gh3e3FtMJAxCuLmbvPvCLAFh0Gd9pen/rfCZFMzKQiSL5xqiYZ AV3I3xdLokPyt+Hfy+kB/RdCLQioUVRtKEESq2mKcDHjqaL0r831SBcDseAYJdklUlZA Eo5OVrOlfZKjnpL3mu++Xy71yL5ZS+9xug1TAnXFJlSKmQ1HMhISR5+DSwqVi0DK8Deg bGPJMlCNO7f82U28/DBydNvmR2NaIkwNPbmr8Fe1yb516r8YwRBXXUO2Zfd68f7mAaLe YFGw== 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:autocrypt:from:references:cc:to:subject:dkim-signature; bh=q19Ah/81RNhSSUoDdSA3qN0BsGo/zMdRerlp4Tfhi0I=; b=kb5oWOQlATkzBhnyFbhXHXrObKh2Y1yar7S+XFvHH//p9uQC1arZyX7szxCLy09cJK WTcl2OG4ZAxnQS85SygjvyqmK++g1GAp03nrlsyUxEnf82d4cfix4sikp3Vq7r43G71A ezMkTKjryWB0ILENNbFw1UoTXjyI3YHry7BQIIo5y3at3uDvpyDn3yppw/fZnLHiZ7W4 5+W2+Ui9nX/JLsZS3sK2YxvUBYwIXEPOGdVFXB6ND0VCNlC0pO4EPFJQVDMPnjF98GXZ cA3FdKNcXgPxiuTW1HasmvAoOEvLBcn0o5M6u5k0FoWGSh5PVGzlYPOzW+s04dag/NKp F7Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=Fth+nhDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si4218316edm.270.2020.08.30.20.49.37; Sun, 30 Aug 2020 20:50:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=Fth+nhDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726927AbgHaDs4 (ORCPT + 99 others); Sun, 30 Aug 2020 23:48:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbgHaDsz (ORCPT ); Sun, 30 Aug 2020 23:48:55 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8AFAC061573 for ; Sun, 30 Aug 2020 20:48:54 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id l9so762643plt.8 for ; Sun, 30 Aug 2020 20:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs-ru.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=q19Ah/81RNhSSUoDdSA3qN0BsGo/zMdRerlp4Tfhi0I=; b=Fth+nhDDLQG50Ss+0l3gRgXCF8BXKE4rUp0l8pcUQhp6sL/jQPd+NSeaWf8ZufNrgw WNA/KAzoP/VQR0LXlpNg8HF4OyD85DZwPmFCubfRH/6ddzNv37LyCEoqXTSDvEF0+4Yr XVdRq1Bg7VCqVOcgRc2905NVvbos89CR1ZmwqKLFDpNbqmBx14rDult6nNGCDRNmp58v JNZVv/Es6RKIqbzft7gJLIH9n0LwNbS58kAeYmZq+PLl5mMvdvTMCG/dHL3bYFcUDtUQ tjI0WwCVa3liO+AjA2k8rUfxPL1vgBH0TbKzCtNkcAsuWicuwGpcrEDV+KGIFZCqyI0l zDCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=q19Ah/81RNhSSUoDdSA3qN0BsGo/zMdRerlp4Tfhi0I=; b=ItTjfI+jZVThl+MT/mEUBpsHquBABNoIWCr93XydGOpV7aXZWfWv/FIjXZtOdOZJwD wnSGUNQ2oerDECAplz18Gd77fmUV14VwgJUDn7ZhM2lbTenioYF4LN6QzAL4WWwrD+FG CpUGmTkwCP1o2a4Ir4BoFs90noEN/PW0Mg1LPA9FsDX6kKMPhzVSmZLKM1nyJXVF0bPC 993XFp9g0L6cNGTE0S7NTcz2MocHFjrhNVRH8BVHXnrmLOHHlKl8o79FZVwIm18+3Kuf qJZuDL8zy0CkdvvPSnIloRYyBO4aEi4rw+t2Jh633qqDw1zFraJ0BXhgkkdE1PM2/DKk eIiA== X-Gm-Message-State: AOAM533y3ifrUW54j0JCcJLdxcGCsa3VA+FtFwjSBpItY+YJLy0RxVKo Ea60b2DPFsyZSYrunoLkcgdotAfIyyQ8nA== X-Received: by 2002:a17:90a:8e82:: with SMTP id f2mr9055568pjo.11.1598845733887; Sun, 30 Aug 2020 20:48:53 -0700 (PDT) Received: from [192.168.10.94] (124-171-83-152.dyn.iinet.net.au. [124.171.83.152]) by smtp.gmail.com with ESMTPSA id b24sm5399634pjp.22.2020.08.30.20.48.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Aug 2020 20:48:53 -0700 (PDT) Subject: Re: [PATCH v1 01/10] powerpc/pseries/iommu: Replace hard-coded page shift To: Oliver O'Halloran Cc: Leonardo Bras , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , Joel Stanley , Thiago Jung Bauermann , Ram Pai , Brian King , Murilo Fossa Vicentini , David Dai , linuxppc-dev , Linux Kernel Mailing List References: <20200817234033.442511-1-leobras.c@gmail.com> <20200817234033.442511-2-leobras.c@gmail.com> <6232948f-033d-8322-e656-544f12c5f784@ozlabs.ru> <31e913d842693b6e107cb2b8e51fd45118b1bd2c.camel@gmail.com> <1e77a3d9-dff9-f58b-45be-77be7cbea41a@ozlabs.ru> <93037398c7afaabc0411890998f3f29f741c8aff.camel@gmail.com> From: Alexey Kardashevskiy Autocrypt: addr=aik@ozlabs.ru; keydata= mQINBE+rT0sBEADFEI2UtPRsLLvnRf+tI9nA8T91+jDK3NLkqV+2DKHkTGPP5qzDZpRSH6mD EePO1JqpVuIow/wGud9xaPA5uvuVgRS1q7RU8otD+7VLDFzPRiRE4Jfr2CW89Ox6BF+q5ZPV /pS4v4G9eOrw1v09lEKHB9WtiBVhhxKK1LnUjPEH3ifkOkgW7jFfoYgTdtB3XaXVgYnNPDFo PTBYsJy+wr89XfyHr2Ev7BB3Xaf7qICXdBF8MEVY8t/UFsesg4wFWOuzCfqxFmKEaPDZlTuR tfLAeVpslNfWCi5ybPlowLx6KJqOsI9R2a9o4qRXWGP7IwiMRAC3iiPyk9cknt8ee6EUIxI6 t847eFaVKI/6WcxhszI0R6C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2HQpnmPOJ9u02TPjYmdpeIfa X2tXyeBixa3i/6dWJ4nIp3vGQicQkut1YBwR7dJq67/FCV3Mlj94jI0myHT5PIrCS2S8LtWX ikTJSxWUKmh7OP5mrqhwNe0ezgGiWxxvyNwThOHc5JvpzJLd32VDFilbxgu4Hhnf6LcgZJ2c Zd44XWqUu7FzVOYaSgIvTP0hNrBYm/E6M7yrLbs3JY74fGzPWGRbBUHTZXQEqQnZglXaVB5V ZhSFtHopZnBSCUSNDbB+QGy4B/E++Bb02IBTGl/JxmOwG+kZUnymsPvTtnNIeTLHxN/H/ae0 c7E5M+/NpslPCmYnDjs5qg0/3ihh6XuOGggZQOqrYPC3PnsNs3NxirwOkVPQgO6mXxpuifvJ DG9EMkK8IBXnLulqVk54kf7fE0jT/d8RTtJIA92GzsgdK2rpT1MBKKVffjRFGwN7nQVOzi4T XrB5p+6ML7Bd84xOEGsj/vdaXmz1esuH7BOZAGEZfLRCHJ0GVCSssg== Message-ID: <1bba12c6-f1ec-9f1e-1d3e-c1efa5ceb7c7@ozlabs.ru> Date: Mon, 31 Aug 2020 13:48:46 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/08/2020 11:41, Oliver O'Halloran wrote: > On Mon, Aug 31, 2020 at 10:08 AM Alexey Kardashevskiy wrote: >> >> On 29/08/2020 05:55, Leonardo Bras wrote: >>> On Fri, 2020-08-28 at 12:27 +1000, Alexey Kardashevskiy wrote: >>>> >>>> On 28/08/2020 01:32, Leonardo Bras wrote: >>>>> Hello Alexey, thank you for this feedback! >>>>> >>>>> On Sat, 2020-08-22 at 19:33 +1000, Alexey Kardashevskiy wrote: >>>>>>> +#define TCE_RPN_BITS 52 /* Bits 0-51 represent RPN on TCE */ >>>>>> >>>>>> Ditch this one and use MAX_PHYSMEM_BITS instead? I am pretty sure this >>>>>> is the actual limit. >>>>> >>>>> I understand this MAX_PHYSMEM_BITS(51) comes from the maximum physical memory addressable in the machine. IIUC, it means we can access physical address up to (1ul << MAX_PHYSMEM_BITS). >>>>> >>>>> This 52 comes from PAPR "Table 9. TCE Definition" which defines bits >>>>> 0-51 as the RPN. By looking at code, I understand that it means we may input any address < (1ul << 52) to TCE. >>>>> >>>>> In practice, MAX_PHYSMEM_BITS should be enough as of today, because I suppose we can't ever pass a physical page address over >>>>> (1ul << 51), and TCE accepts up to (1ul << 52). >>>>> But if we ever increase MAX_PHYSMEM_BITS, it doesn't necessarily means that TCE_RPN_BITS will also be increased, so I think they are independent values. >>>>> >>>>> Does it make sense? Please let me know if I am missing something. >>>> >>>> The underlying hardware is PHB3/4 about which the IODA2 Version 2.4 >>>> 6Apr2012.pdf spec says: >>>> >>>> "The number of most significant RPN bits implemented in the TCE is >>>> dependent on the max size of System Memory to be supported by the platform". >>>> >>>> IODA3 is the same on this matter. >>>> >>>> This is MAX_PHYSMEM_BITS and PHB itself does not have any other limits >>>> on top of that. So the only real limit comes from MAX_PHYSMEM_BITS and >>>> where TCE_RPN_BITS comes from exactly - I have no idea. >>> >>> Well, I created this TCE_RPN_BITS = 52 because the previous mask was a >>> hardcoded 40-bit mask (0xfffffffffful), for hard-coded 12-bit (4k) >>> pagesize, and on PAPR+/LoPAR also defines TCE as having bits 0-51 >>> described as RPN, as described before. >>> >>> IODA3 Revision 3.0_prd1 (OpenPowerFoundation), Figure 3.4 and 3.5. >>> shows system memory mapping into a TCE, and the TCE also has bits 0-51 >>> for the RPN (52 bits). "Table 3.6. TCE Definition" also shows it. >>>> In fact, by the looks of those figures, the RPN_MASK should always be a >>> 52-bit mask, and RPN = (page >> tceshift) & RPN_MASK. >> >> I suspect the mask is there in the first place for extra protection >> against too big addresses going to the TCE table (or/and for virtial vs >> physical addresses). Using 52bit mask makes no sense for anything, you >> could just drop the mask and let c compiler deal with 64bit "uint" as it >> is basically a 4K page address anywhere in the 64bit space. Thanks, > > Assuming 4K pages you need 52 RPN bits to cover the whole 64bit > physical address space. The IODA3 spec does explicitly say the upper > bits are optional and the implementation only needs to support enough > to cover up to the physical address limit, which is 56bits of P9 / > PHB4. If you want to validate that the address will fit inside of > MAX_PHYSMEM_BITS then fine, but I think that should be done as a > WARN_ON or similar rather than just silently masking off the bits. We can do this and probably should anyway but I am also pretty sure we can just ditch the mask and have the hypervisor return an error which will show up in dmesg. -- Alexey