Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9176838rwp; Thu, 20 Jul 2023 00:15:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlHIj/Hf6QUJXWQtpbWY06yz/EDcltjsx3zlbbl8HrWoAUvWdvroWY1cfe7hyGnRdBssiVz4 X-Received: by 2002:aa7:d659:0:b0:51d:d295:6741 with SMTP id v25-20020aa7d659000000b0051dd2956741mr3915666edr.6.1689837309551; Thu, 20 Jul 2023 00:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689837309; cv=none; d=google.com; s=arc-20160816; b=y+TPXDzb7FI6uGIcsHua85HharE6GW7BkKXx3uPGwE7yjAFKJvOItZgKLpAjdOGyxZ 66dAlFFrXz+oYBsL3Fr1lna79b/cbLP13SBjlEOKYsnRpnxrNW6OzHytORu+yMtq2MAG aFygd+C2fHLWjT9hHlAGxRi1cKa7Xf1wdPf7Zjm+HagzKOihJnKnpQ/HSiI6718kz7gY lv8DVAye23V2FHTjn+ZleTX3X2S98/M4dBPSHmf3mNhrcWLeyjzl58Jjtno+0WqjUBdd bTTaTuHSCr2s301PXS2USBI/P1zSLSZ0shqG7PM3QfWHENgRcOGxn0FEcEQUaj0awMXe IwZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=joOfuOhlgFHQlvxgQ3+x0/c9S8lnM7GsuBzf9dYpahg=; fh=N+SE//EwVrBCpleSEjFjjqIzdsqQikFWywQnGO2Oh7U=; b=hG20nq/yQJ3v4/NwS4V10V5ldmZsMsarqOrB1Ap5NXr+Yax04UB+aTN2sCGNmZA7+j MQDJG18zi9bO3L85Ver0gSTmtKHfqybU8DzkFyM9LjhtTs+8PkJxUhxq5VfZiIBKp5xK fl0vjKc39/b22s1L7suWUVY5WAhzl0FlvSF8KH7xVElW/RYcf1WyiIJ6ZqTT5eziyb/o /697kirc6WQqcevhRc4Hi+TBAhGNoq9oAmlPevO2+pw/7azyGVWEuPAWGEn/iExkkovg RiHQP9AmQ6MZiOAB5qji8Yz91q2ANl+Am4zA6zBFkshzki671kz1JnxCzaQEa/m24KBn z6vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="NxJd/81K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j24-20020aa7c0d8000000b0051633932f25si405613edp.528.2023.07.20.00.14.45; Thu, 20 Jul 2023 00:15:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="NxJd/81K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231180AbjGTGj6 (ORCPT + 99 others); Thu, 20 Jul 2023 02:39:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231151AbjGTGjm (ORCPT ); Thu, 20 Jul 2023 02:39:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F30AC35AD for ; Wed, 19 Jul 2023 23:39:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 15C61618C9 for ; Thu, 20 Jul 2023 06:38:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC7C8C433C8; Thu, 20 Jul 2023 06:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689835127; bh=JUczBgKxXZiHONsdlYXF6A80Z7d/kbeRft7c934WaD0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=NxJd/81KtsyKg/wa11OhHkXzaEsTFhth/WuAbQtTnr1brzjJrc2zJvQc5yIVsiMqg 2CVsemVq8+V/2Jz5LhBbWDQ224CQUTfzR5CYugjGB8F7xt5l7aIIemG/sb8LAZ+QbG ZOgbfouoypCS5fmjNHoeZfAO9nEcOwO81Ewmpljl7tIGcs1yQdX040NRsbLe0QWxhR 12wXpInVUbtI9WEgf62AXOHuQaaQAspWnsEAVGkOCDsefAWEY9uFdo4r9imscLPIdQ gDsR2Yi/wiegRPEog/A/1V1TD+pzJAxpsZQslxBMYpwRnpQZomV/+UfbTiOSSuRC6c 686yLmeSNbQDg== Message-ID: Date: Thu, 20 Jul 2023 08:38:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 05/11] RISC-V: drivers/iommu/riscv: Add sysfs interface Content-Language: en-US To: Tomasz Jeznach , Joerg Roedel , Will Deacon , Robin Murphy , Paul Walmsley Cc: Palmer Dabbelt , Albert Ou , Anup Patel , Sunil V L , Nick Kossifidis , Sebastien Boeuf , iommu@lists.linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux@rivosinc.com References: <610abe685f90870be52bc7c2ca45ab5235bd8eb4.1689792825.git.tjeznach@rivosinc.com> From: Krzysztof Kozlowski In-Reply-To: <610abe685f90870be52bc7c2ca45ab5235bd8eb4.1689792825.git.tjeznach@rivosinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/07/2023 21:33, Tomasz Jeznach wrote: > Enable sysfs debug / visibility interface providing restricted > access to hardware registers. Please use subject prefixes matching the subsystem. You can get them for example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory your patch is touching. > > Signed-off-by: Tomasz Jeznach > --- > drivers/iommu/riscv/Makefile | 2 +- > drivers/iommu/riscv/iommu-sysfs.c | 183 ++++++++++++++++++++++++++++++ > drivers/iommu/riscv/iommu.c | 7 ++ > drivers/iommu/riscv/iommu.h | 2 + > 4 files changed, 193 insertions(+), 1 deletion(-) > create mode 100644 drivers/iommu/riscv/iommu-sysfs.c > > diff --git a/drivers/iommu/riscv/Makefile b/drivers/iommu/riscv/Makefile > index 38730c11e4a8..9523eb053cfc 100644 > --- a/drivers/iommu/riscv/Makefile > +++ b/drivers/iommu/riscv/Makefile > @@ -1 +1 @@ > -obj-$(CONFIG_RISCV_IOMMU) += iommu.o iommu-pci.o iommu-platform.o > \ No newline at end of file > +obj-$(CONFIG_RISCV_IOMMU) += iommu.o iommu-pci.o iommu-platform.o iommu-sysfs.o > \ No newline at end of file You have this error in multiple places. > diff --git a/drivers/iommu/riscv/iommu-sysfs.c b/drivers/iommu/riscv/iommu-sysfs.c > new file mode 100644 > index 000000000000..f038ea8445c5 > --- /dev/null > +++ b/drivers/iommu/riscv/iommu-sysfs.c > @@ -0,0 +1,183 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * IOMMU API for RISC-V architected Ziommu implementations. > + * > + * Copyright © 2022-2023 Rivos Inc. > + * > + * Author: Tomasz Jeznach > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "iommu.h" > + > +#define sysfs_dev_to_iommu(dev) \ > + container_of(dev_get_drvdata(dev), struct riscv_iommu_device, iommu) > + > +static ssize_t address_show(struct device *dev, > + struct device_attribute *attr, char *buf) Where is the sysfs ABI documented? Best regards, Krzysztof