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=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,URIBL_BLACK 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 DBAF2C6377C for ; Mon, 19 Jul 2021 19:15:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2966610D2 for ; Mon, 19 Jul 2021 19:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384451AbhGSS3V (ORCPT ); Mon, 19 Jul 2021 14:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357173AbhGSSF5 (ORCPT ); Mon, 19 Jul 2021 14:05:57 -0400 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09CEBC061766 for ; Mon, 19 Jul 2021 11:31:15 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id o9so8892610qvu.5 for ; Mon, 19 Jul 2021 11:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=gVSVogAXROTPh3Dssd0UNY8nOlWjhPggt2vXEoxEy3U=; b=oydbKBWLfMAN9YjAsnWY1riBcENGN55t7esTwa86bYBQusYt5haJf44rKAdNZgprlR NNtNSMrpy0XZUzl6fgTZTIBA62XF2R4XNlMQBbd/FJ/pmzsZvpmjeMsSsBV3kFuRndr/ KIAYISKEzbnLWgj47t4BrcD+EGmS5zfijzU0zhnKUAYgD3qfakhN+Ufr1W07GABWpWav nKqxGYL1aY4W+EyEYa0RCW0CaUteZqhYW4L9NCA8kNSyDvR8eRMYea6yESkA/j+O5Jq7 lU/GyjEvL9J+Q4NKZoBVVqd1KYexU6bLsvy6LMUneuRyHyeVJnJnyoSg6W7E8/FaEJWf /erA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=gVSVogAXROTPh3Dssd0UNY8nOlWjhPggt2vXEoxEy3U=; b=E7DrVUgRviY7Qfs/2vbqqYP6NRxmMC81wQbcghnfiHr2kKsp7zH+0h7vLSfijXGyBB Y5nLBh9yevraMIiUO5WvPp30zWYVFmwBSk/uP6Tn73Uc9TI/0bgdtv4F3jc8Ya9RS/8B fFTUzrejBXtVvVuG7lQJsroSdFZy/FSeDPp1EFBJ3u22RSwu0MWfm+WKqoRLRXfXaw6Y t6qQJSpCqizPbkzLbEDAowaC3NbbCt0KZTKf24AASNg/0gefMeH5cqK02VVvY9q5HQYq o9WTSDG3TmitjPNOquwP5Lkf2zjnPJ2PiwYwVl2HB5gAu/Hi+V767zvCJy3kDDl0VIHs mmgg== X-Gm-Message-State: AOAM5308mGx4Vp5uhQPZmVJ9CQqwtECcMed9mj2XuVS2Itw0jLPc0inS F4iKNGQjUtXq4nZqRiX5Y3U= X-Google-Smtp-Source: ABdhPJyHxmWj4jRy+IaYfbUTtp+JlyfSuTdFWpuyI6w/20JYm0iGpz1vIYlNh7ENCzyfsSCrPoqRZw== X-Received: by 2002:a0c:8c0c:: with SMTP id n12mr26495316qvb.13.1626720220683; Mon, 19 Jul 2021 11:43:40 -0700 (PDT) Received: from ?IPv6:2804:14c:482:92eb:ffdf:6b35:b94d:258? ([2804:14c:482:92eb:ffdf:6b35:b94d:258]) by smtp.gmail.com with ESMTPSA id n13sm558843qtx.92.2021.07.19.11.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 11:43:40 -0700 (PDT) Message-ID: Subject: Re: [PATCH v5 01/11] powerpc/pseries/iommu: Replace hard-coded page shift From: Leonardo =?ISO-8859-1?Q?Br=E1s?= To: Frederic Barrat , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Alexey Kardashevskiy , David Gibson , kernel test robot , Nicolin Chen Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Mon, 19 Jul 2021 15:43:59 -0300 In-Reply-To: References: <20210716082755.428187-1-leobras.c@gmail.com> <20210716082755.428187-2-leobras.c@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.3 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-07-19 at 15:48 +0200, Frederic Barrat wrote: > > > On 16/07/2021 10:27, Leonardo Bras wrote: > > Some functions assume IOMMU page size can only be 4K (pageshift == > > 12). > > Update them to accept any page size passed, so we can use 64K > > pages. > > > > In the process, some defines like TCE_SHIFT were made obsolete, and > > then > > removed. > > > > IODA3 Revision 3.0_prd1 (OpenPowerFoundation), Figures 3.4 and 3.5 > > show > > a RPN of 52-bit, and considers a 12-bit pageshift, so there should > > be > > no need of using TCE_RPN_MASK, which masks out any bit after 40 in > > rpn. > > It's usage removed from tce_build_pSeries(), tce_build_pSeriesLP(), > > and > > tce_buildmulti_pSeriesLP(). > > > > Most places had a tbl struct, so using tbl->it_page_shift was > > simple. > > tce_free_pSeriesLP() was a special case, since callers not always > > have a > > tbl struct, so adding a tceshift parameter seems the right thing to > > do. > > > > Signed-off-by: Leonardo Bras > > Reviewed-by: Alexey Kardashevskiy > > --- > > FWIW, > Reviewed-by: Frederic Barrat > Thanks! 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=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLACK 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 109F8C07E95 for ; Mon, 19 Jul 2021 18:44:16 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 612D06101E for ; Mon, 19 Jul 2021 18:44:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 612D06101E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GT9jn73ffz3bg3 for ; Tue, 20 Jul 2021 04:44:13 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=oydbKBWL; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::f2c; helo=mail-qv1-xf2c.google.com; envelope-from=leobras.c@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=oydbKBWL; dkim-atps=neutral Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GT9jG1kB4z2yMk for ; Tue, 20 Jul 2021 04:43:45 +1000 (AEST) Received: by mail-qv1-xf2c.google.com with SMTP id x6so8897320qvx.4 for ; Mon, 19 Jul 2021 11:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=gVSVogAXROTPh3Dssd0UNY8nOlWjhPggt2vXEoxEy3U=; b=oydbKBWLfMAN9YjAsnWY1riBcENGN55t7esTwa86bYBQusYt5haJf44rKAdNZgprlR NNtNSMrpy0XZUzl6fgTZTIBA62XF2R4XNlMQBbd/FJ/pmzsZvpmjeMsSsBV3kFuRndr/ KIAYISKEzbnLWgj47t4BrcD+EGmS5zfijzU0zhnKUAYgD3qfakhN+Ufr1W07GABWpWav nKqxGYL1aY4W+EyEYa0RCW0CaUteZqhYW4L9NCA8kNSyDvR8eRMYea6yESkA/j+O5Jq7 lU/GyjEvL9J+Q4NKZoBVVqd1KYexU6bLsvy6LMUneuRyHyeVJnJnyoSg6W7E8/FaEJWf /erA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=gVSVogAXROTPh3Dssd0UNY8nOlWjhPggt2vXEoxEy3U=; b=Xg9pAb8r7f7iZROJ0qRTbf8FubBiunTl+y+n+vIraMp8nRBIbhVvwgWM/ySKAXjkzj Li7tqi61lgGWldXgfn11wJ+EvBkmL/+XHqPuULt2Zd5I4zeWnCa9skAN8v4lpcGk9qhy L2d48rCgC8gdjdDaIORSb63hxHIRpADFTtkffvNVPjUyKIjx46zxZy+eRsshP8WHm1yh cKcqtuz4tMCCOnjgRQ/urhxsP1hj4BwIT3HNOA/sTjePdqjf0QPl30UgWujR3afCszm6 vTFbKzBmKyVI2Q9pDiKc2zsgAyRKbOFzfCQ3tuMxoiRvJNLyIzcCWBI9q1waRQeAUXYV ohfg== X-Gm-Message-State: AOAM531YNmbRkIP0oCA04A0g8hDATdJ2Cp4JCRRi686DTd/KpybAUv4B wiRZuUJyQ1Iox+h6JNcHF10= X-Google-Smtp-Source: ABdhPJyHxmWj4jRy+IaYfbUTtp+JlyfSuTdFWpuyI6w/20JYm0iGpz1vIYlNh7ENCzyfsSCrPoqRZw== X-Received: by 2002:a0c:8c0c:: with SMTP id n12mr26495316qvb.13.1626720220683; Mon, 19 Jul 2021 11:43:40 -0700 (PDT) Received: from ?IPv6:2804:14c:482:92eb:ffdf:6b35:b94d:258? ([2804:14c:482:92eb:ffdf:6b35:b94d:258]) by smtp.gmail.com with ESMTPSA id n13sm558843qtx.92.2021.07.19.11.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 11:43:40 -0700 (PDT) Message-ID: Subject: Re: [PATCH v5 01/11] powerpc/pseries/iommu: Replace hard-coded page shift From: Leonardo =?ISO-8859-1?Q?Br=E1s?= To: Frederic Barrat , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Alexey Kardashevskiy , David Gibson , kernel test robot , Nicolin Chen Date: Mon, 19 Jul 2021 15:43:59 -0300 In-Reply-To: References: <20210716082755.428187-1-leobras.c@gmail.com> <20210716082755.428187-2-leobras.c@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.3 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, 2021-07-19 at 15:48 +0200, Frederic Barrat wrote: > > > On 16/07/2021 10:27, Leonardo Bras wrote: > > Some functions assume IOMMU page size can only be 4K (pageshift == > > 12). > > Update them to accept any page size passed, so we can use 64K > > pages. > > > > In the process, some defines like TCE_SHIFT were made obsolete, and > > then > > removed. > > > > IODA3 Revision 3.0_prd1 (OpenPowerFoundation), Figures 3.4 and 3.5 > > show > > a RPN of 52-bit, and considers a 12-bit pageshift, so there should > > be > > no need of using TCE_RPN_MASK, which masks out any bit after 40 in > > rpn. > > It's usage removed from tce_build_pSeries(), tce_build_pSeriesLP(), > > and > > tce_buildmulti_pSeriesLP(). > > > > Most places had a tbl struct, so using tbl->it_page_shift was > > simple. > > tce_free_pSeriesLP() was a special case, since callers not always > > have a > > tbl struct, so adding a tceshift parameter seems the right thing to > > do. > > > > Signed-off-by: Leonardo Bras > > Reviewed-by: Alexey Kardashevskiy > > --- > > FWIW, > Reviewed-by: Frederic Barrat > Thanks!