Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp526944lqm; Wed, 1 May 2024 07:59:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXu9OfAVt+bmFqt3a7soiWu0tTUm8Ukstbm+YLWQrIFvWDaCYT8MwX2cA7ztke0P7XXUrVNS/8x9QRdxt3/1kvzJc8OKbgjJqZ9vcFzcw== X-Google-Smtp-Source: AGHT+IFIWoFsBcuD0JMVq3SLfiA7ScVy8aAjfe1/fKr/yx8RvJN1DaXyR7XvjEOX2XrYkF/9f88W X-Received: by 2002:a17:902:c213:b0:1e0:b689:950b with SMTP id 19-20020a170902c21300b001e0b689950bmr2884451pll.16.1714575590578; Wed, 01 May 2024 07:59:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714575590; cv=pass; d=google.com; s=arc-20160816; b=Uw5QpaD5HqQVPSgNiJrGdXbMGhvokKOLc3ckGIPSEhJT8etvmIdjnHhCEH/aIadM0X lp4zpQC3E+DQl7DHLHp42H7tTTngZxA064AziGLDYRYZVvkbJIaZHOHxfux2QW0Vjoeg Z7yJzmgUiD+6HOmHZq2RB9Crp9ZvXCfsBvvBOtrpo07Hq06l16Zt8IJVGXFv+08DKHtD qocxL7c9n9b3cqWXLkyHKdHgV+iuXNBc/WshLhuaXDMwb84kwv3j5kYYrVjrIwHcdX/l xl1iG4mBREqtDCd7Ugck96SdHqowMsj02tQVKBIrAVLxITJXItndQXJAZwkd8t/RUyl2 CegA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yMDuFgQIFZusBttFcIEeiK3dO+QLC27z5ORAgCsbWKI=; fh=4/Adwhd/l00eryWlhJVLlAD6pg/O8FyTpWzWV2daxCg=; b=DJhjt+SMvXXTluzcL1/dCnpTuL7ZUTFETzv4uRFV5NrxSEOh8suY/vunchWwHFhtzK oVtltrFLiLPP5yJMFE3LcdnCMXkE8f9FdXlgPUSDsGdUWb3KNe5vvxd/EpOvIAikoeQD NbM3m1bFsEzSuxx4AbFwVgTGDMSxG2RbvQkf4tho6NymJldpl0uH6vD+LgxoIMHgGKhp WZU3yA4ATYv3Xt2elwH5sa9io6RLbZLqwDVEyrX3/HLtmtf8qpHRyFKwTvV8UHRYkrt3 nmoHx7N0PIz6iIU7/llZJP2C+AH1VNpxSz/dR1U1uXG0m34e7LYwx1HvreH1c1iW1Ojj Fp/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=HOoF+NRT; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-165410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165410-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e14-20020a170903240e00b001e797d47ee3si22253681plo.76.2024.05.01.07.59.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 07:59:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=HOoF+NRT; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-165410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165410-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3AA2E2814EA for ; Wed, 1 May 2024 14:59:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B33012FB06; Wed, 1 May 2024 14:57:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="HOoF+NRT" Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EFA112F367 for ; Wed, 1 May 2024 14:57:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714575454; cv=none; b=iz2p+0jMSxC3BZaYNW+7jBXl7jNDs4fm2Qlmaki3jLY52J2B7mo/yQd9Glac2owlTvxHPu21wk6YNmNgWVGhxI5d3UPx6DbL/Ql8k3iuX73hwHPqDkrLuZGztVnGG/Y9lCagGe7PeIavxFMz8wqnF15LnF/julj3v7h8RGxo4ZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714575454; c=relaxed/simple; bh=ap3BJox/MGVOgxqCNy7fpIJSXCiWokvcBZnrVfJZjT4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QQbKgoCO3c/paFaXzYST4MUptTGXk50O5oIIcknvqOhR5MCI8LzKx42hMaZZWzm/p1QesqVfqWA06X9S1Z1anMLT5J6seeAnvZ1m/AZqoQelaAA2MRj0Be6iCF1uKc1LE2SJDRU68T2EXZs62JViZRA9up/QbBVjMas2+AT0cjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=HOoF+NRT; arc=none smtp.client-ip=209.85.222.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-790f91b834cso275434585a.0 for ; Wed, 01 May 2024 07:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1714575452; x=1715180252; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=yMDuFgQIFZusBttFcIEeiK3dO+QLC27z5ORAgCsbWKI=; b=HOoF+NRTkf8cPp1HPVTa/V5KOkmGUnuM8FNW+ZEucrvVRizDSeLFkKBZROoOzxNCF4 n33yNkaSdydbS1b3/8IYdH/HOZzrNzzYNBQF14eHvT8TgvYvx7gtvoNZ0igxXiTxuk6P adM+7ijguEhkjQgivQDLPws4moV+nPvGjU5W6G79rvXeNZ08wiGGrlIJ4lqYgk0A9EMs Ndhe2/AwLgYUx1EBqarKnj+us1MVaPheOS9nFMyaQHic+xBM7JndmP1uihelnJ4mbdR3 PHCXb/afHLM/4PucqpXlf/pUzyFsn2foa936bOrw+0k6zfsVZBu9rXjfgDQMsgak9ksv VPAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714575452; x=1715180252; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yMDuFgQIFZusBttFcIEeiK3dO+QLC27z5ORAgCsbWKI=; b=Fa3b2fjwIjB7+ROoUiplgLcFN1Wd+7QaJHLRg6/fSq18InwTtj5mUiqflpdqw+Aj+f 4hRzkEQMjFBzEtvk5hZVdiWQRqV4yjWIdP8SmvoJGsj9jJwKzS56Y8UQrxH8T9POOZTx iVp/dwmhlLupbq0ZW8IhoDoKudTKH+M/4OyccXtGd/KrPD4zQuHhsYTfgqLyuKVsMgfr 1MHxvH7LJQS78si2Epsrn6EnwpC44pI14iX0gB2+/XAq8xyv9akESxSw8X2lSqrlCwaG F8TjKA2xlz6iWbFiTAk3S6vS4u3nngy+3Y7TjY3rSrxeG8p+qTBtwfsK9YH5WZfTuEN8 HV3A== X-Forwarded-Encrypted: i=1; AJvYcCV2prPsvDiCTnypyvq2zXK5tmwbosq5meWR3jlJOWgDrcsR9kEWwoyQyyKNqo7knZMIAkOH9Q06emYj4n3tAm3r1npxL+mzx9d7R1C+ X-Gm-Message-State: AOJu0YyBpr/+XhdY6Tv9EGjHgfZjl1dNVTGsCd0EIpXvCXrPs8kW3qRO svg0QM4l+2/Eblz8AzQHUuv8qeqhk8MYKnzmSbbnL7xrk6kTRVTJmoVjM9OWJo4= X-Received: by 2002:a05:6214:2486:b0:6a0:cb42:993d with SMTP id gi6-20020a056214248600b006a0cb42993dmr3978427qvb.23.1714575452398; Wed, 01 May 2024 07:57:32 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-80-239.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.80.239]) by smtp.gmail.com with ESMTPSA id g18-20020ad45152000000b006a0af6e25c2sm5039912qvq.94.2024.05.01.07.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 07:57:31 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1s2BOl-00DcLt-Fb; Wed, 01 May 2024 11:57:31 -0300 Date: Wed, 1 May 2024 11:57:31 -0300 From: Jason Gunthorpe To: Tomasz Jeznach Cc: Joerg Roedel , Will Deacon , Robin Murphy , Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Sunil V L , Nick Kossifidis , Sebastien Boeuf , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, iommu@lists.linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux@rivosinc.com Subject: Re: [PATCH v3 5/7] iommu/riscv: Device directory management. Message-ID: <20240501145731.GE1723318@ziepe.ca> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Apr 30, 2024 at 01:01:55PM -0700, Tomasz Jeznach wrote: > Introduce device context allocation and device directory tree > management including capabilities discovery sequence, as described > in Chapter 2.1 of the RISC-V IOMMU Architecture Specification. > > Device directory mode will be auto detected using DDTP WARL property, > using highest mode supported by the driver and hardware. If none > supported can be configured, driver will fall back to global pass-through. > > First level DDTP page can be located in I/O (detected using DDTP WARL) > and system memory. > > Only simple identity and release (blocking) protection domains are > supported by this implementation. Why rename the concept? We call it a BLOCKING domain, just use that name please. > +static int riscv_iommu_attach_release_domain(struct iommu_domain *iommu_domain, > + struct device *dev) > +{ > + struct riscv_iommu_device *iommu = dev_to_iommu(dev); > + > + if (iommu->ddt_mode > RISCV_IOMMU_DDTP_MODE_BARE) > + riscv_iommu_iodir_update(iommu, dev, RISCV_IOMMU_FSC_BARE, 0); > + > + return 0; > +} > + > +static struct iommu_domain riscv_iommu_release_domain = { > + .type = IOMMU_DOMAIN_BLOCKED, > + .ops = &(const struct iommu_domain_ops) { > + .attach_dev = riscv_iommu_attach_release_domain, > + } > +}; 'riscv_iommu_release_domain' doesn't make sense.. Jason