Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2395104pxb; Tue, 13 Apr 2021 00:23:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWdFyjeGvovSOQDRmqwehFeYyBJvN03JHnxzu1Jx4OL20oBwscgTxvavLEZYW4/1KGp2Kd X-Received: by 2002:a05:6402:397:: with SMTP id o23mr19243167edv.337.1618298587683; Tue, 13 Apr 2021 00:23:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618298587; cv=none; d=google.com; s=arc-20160816; b=X7z1yPnndapyfcj7nZm0a1OoryDsnPSjENAlbKywzcwqGD7G0EZYpFiyudrGONW8XU Ld36paPjt9WetWeuvaIhYoDyMmocIfb4UZCn+6l9Trlkdr3+wW+3yOXXNyzUOBugWX+I eVeLPQSbc8COebREoxP4Q5B2hVdLF4tV/X0d6wrW0qEGT13Vx8uAUD0+P4s7EsOgVosT 19wOkGDPlCcGnxyUmoh8Z5EBg75+oRQAp1t7gD71AsJJIKCanm/cMaEG/065QFNc7PDQ VhzzEbhloNvIkaByOfQQM2ZiDUkEnrTflOEiqo44yA8BxabjIP9OExdBqRrrKObrV7cJ QluA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LFTxCcpRLP/GgamHeg3NPtN/ELPXLPHJTkOHsvYEWXA=; b=hhaP9soRxsshJMo03+e+Ut3kqS0GipicWH5WGHbrRyi37pL5vOtdCsfHafxCdLjjeg NywxrQ0M6FlLnYZlWemBiWXDRxAL9ev8kQc3zjjGbUVG69Xk5D/ww9nT6iyVK40oOguB Yz05zqSp8sgWs3K81xBrPKw9UNJFgjK4xVGCeUyciuShVi2f1gMZTJaVYrehJrj7+37l 03MnIzoLjAR9tNvnSbnM6vlg7tdHvaxb4Q2V8/1ni7xHI735cDes7UE0ScEla2BR+c8G gZYRm8r22jQmhYjafOoG03vd8SchY83FPKH7k4Ew9qSVDsanNHEsEy6D/Cnfz0ratM32 HWyw== ARC-Authentication-Results: i=1; mx.google.com; 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 nd10si8822175ejc.600.2021.04.13.00.22.44; Tue, 13 Apr 2021 00:23:07 -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; 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 S1343698AbhDLW3Z (ORCPT + 99 others); Mon, 12 Apr 2021 18:29:25 -0400 Received: from gate.crashing.org ([63.228.1.57]:60963 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242505AbhDLW3Y (ORCPT ); Mon, 12 Apr 2021 18:29:24 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 13CMLi6p013457; Mon, 12 Apr 2021 17:21:44 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 13CMLhsf013456; Mon, 12 Apr 2021 17:21:43 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 12 Apr 2021 17:21:43 -0500 From: Segher Boessenkool To: Alexey Kardashevskiy Cc: Michael Ellerman , Leonardo Bras , Benjamin Herrenschmidt , Paul Mackerras , brking@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR Message-ID: <20210412222143.GO26583@gate.crashing.org> References: <20210407195613.131140-1-leobras.c@gmail.com> <87im4xe3pk.fsf@mpe.ellerman.id.au> <8e1ce7e9-415b-92ea-0437-a4331ed3c7f9@ozlabs.ru> <87ft01du50.fsf@mpe.ellerman.id.au> <21407a96-5b20-3fae-f1c8-895973b655ef@ozlabs.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21407a96-5b20-3fae-f1c8-895973b655ef@ozlabs.ru> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 09, 2021 at 02:36:16PM +1000, Alexey Kardashevskiy wrote: > On 08/04/2021 19:04, Michael Ellerman wrote: > >>>>+#define QUERY_DDW_PGSIZE_4K 0x01 > >>>>+#define QUERY_DDW_PGSIZE_64K 0x02 > >>>>+#define QUERY_DDW_PGSIZE_16M 0x04 > >>>>+#define QUERY_DDW_PGSIZE_32M 0x08 > >>>>+#define QUERY_DDW_PGSIZE_64M 0x10 > >>>>+#define QUERY_DDW_PGSIZE_128M 0x20 > >>>>+#define QUERY_DDW_PGSIZE_256M 0x40 > >>>>+#define QUERY_DDW_PGSIZE_16G 0x80 > >>> > >>>I'm not sure the #defines really gain us much vs just putting the > >>>literal values in the array below? > >> > >>Then someone says "uuuuu magic values" :) I do not mind either way. > >>Thanks, > > > >Yeah that's true. But #defining them doesn't make them less magic, if > >you only use them in one place :) > > Defining them with "QUERY_DDW" in the names kinda tells where they are > from. Can also grep QEMU using these to see how the other side handles > it. Dunno. And *not* defining anything reduces the mental load a lot. You can add a comment at the single spot you use them, explaining what this is, in a much better way! Comments are *good*. Segher