lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86o6ylouc5.wl-maz@kernel.org>
Date: Sat, 01 Mar 2025 11:37:14 +0000
From: Marc Zyngier <maz@...nel.org>
To: Frank Li <Frank.Li@....com>
Cc: Kishon Vijay Abraham I <kishon@...nel.org>,	"Rafael J. Wysocki"
 <rafael@...nel.org>,	Thomas Gleixner <tglx@...utronix.de>,	Anup Patel
 <apatel@...tanamicro.com>,	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Danilo Krummrich <dakr@...nel.org>,	Manivannan Sadhasivam
 <manivannan.sadhasivam@...aro.org>,	Krzysztof Wilczyński
 <kw@...ux.com>,	Bjorn Helgaas <bhelgaas@...gle.com>,	Arnd Bergmann
 <arnd@...db.de>,	Shuah Khan <shuah@...nel.org>,	Richard Zhu
 <hongxing.zhu@....com>,	Lucas Stach <l.stach@...gutronix.de>,	Lorenzo
 Pieralisi <lpieralisi@...nel.org>,	Rob Herring <robh@...nel.org>,	Shawn Guo
 <shawnguo@...nel.org>,	Sascha Hauer <s.hauer@...gutronix.de>,	Pengutronix
 Kernel Team <kernel@...gutronix.de>,	Fabio Estevam <festevam@...il.com>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,	Conor Dooley
 <conor+dt@...nel.org>,	Niklas Cassel <cassel@...nel.org>,
	dlemoal@...nel.org,	jdmason@...zu.us,	linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,	linux-pci@...r.kernel.org,
	linux-kselftest@...r.kernel.org,	imx@...ts.linux.dev,
	devicetree@...r.kernel.org
Subject: Re: [PATCH v15 04/15] irqchip/gic-v3-its: Add support for device tree msi-map and msi-mask

On Tue, 11 Feb 2025 19:21:57 +0000,
Frank Li <Frank.Li@....com> wrote:
> 
> Some platform devices create child devices dynamically and require the
> parent device's msi-map to map device IDs to actual sideband information.
> 
> A typical use case is using ITS as a PCIe Endpoint Controller(EPC)'s
> doorbell function, where PCI hosts send TLP memory writes to the EP
> controller. The EP controller converts these writes to AXI transactions
> and appends platform-specific sideband information.  See below figure.
> 
>                ┌────────────────────────────────┐
>                │                                │
>                │     PCI Endpoint Controller    │
>                │                                │
>                │  ┌─────┐   ┌─────┐     ┌─────┐ │
>     PCI Bus    │  │     │   │     │     │     │ │
>     ─────────► │  │Func1│   │Func2│ ... │Func │ │
>     TLP Memory │  │     │   │     │     │<n>  │ │
>     Write Push │  │     │   │     │     │     │ │
>     DoorBell   │  └─┬─┬─┘   └──┬──┘     └──┬──┘ │
>                │    │ │        │           │    │
>                └────┼─┼────────┼───────────┼────┘
>         sideband    │ │ Address│           │
>         information ▼ ▼ /Data  ▼           ▼
>                    ┌────────────────────────┐
>                    │    MSI Controller      │
>                    └────────────────────────┘
>

Please stop using these figures in commit messages. I don't think they
help, and they are not in consistent with the way the commit messages
are managed.

> EPC's DTS will provide such information by msi-map and msi-mask. A
> simplified dts as
> 
> pcie-ep@...00000 {
> 	...
> 	msi-map = <0 &its 0xc 8>;
>                           ^^^ 0xc is implement defined sideband information,
> 			      which append to AXI write transaction.
> 	           ^ 0 is function index.

What does this sideband field represent? How is the ITS driver
supposed to use that data? Is it the full devid as presented to the
ITS? Something combined with the "function index"? Is the "function
index" a full RID, as defined in the documentation?

Also, msi-map is so far reserved to a PCIe RC, not this sort of wonky
contraption. This needs to be documented.

> 
> 	msi-mask = <0x7>
> }
> 
> Check msi-map if msi-parent missed to keep compatility with existed system.
> 
> Signed-off-by: Frank Li <Frank.Li@....com>
> ---
> change from v14 to v15
> - none
> 
> change from v13 to v14
> new patch
> ---
>  drivers/irqchip/irq-gic-v3-its-msi-parent.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/irqchip/irq-gic-v3-its-msi-parent.c b/drivers/irqchip/irq-gic-v3-its-msi-parent.c
> index e150365fbe892..6c7389bb84a4a 100644
> --- a/drivers/irqchip/irq-gic-v3-its-msi-parent.c
> +++ b/drivers/irqchip/irq-gic-v3-its-msi-parent.c
> @@ -118,6 +118,14 @@ static int of_pmsi_get_dev_id(struct irq_domain *domain, struct device *dev,
>  		index++;
>  	} while (!ret);
>  
> +	if (ret) {
> +		struct device_node *np = NULL;
> +
> +		ret = of_map_id(dev->of_node, dev->id, "msi-map", "msi-map-mask", &np, dev_id);
> +		if (np)
> +			of_node_put(np);
> +	}
> +
>  	return ret;
>  }
>  
> 

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ