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: <576155FA.9080706@codeaurora.org>
Date:	Wed, 15 Jun 2016 09:19:54 -0400
From:	Sinan Kaya <okaya@...eaurora.org>
To:	Tomasz Nowicki <tn@...ihalf.com>, marc.zyngier@....com,
	tglx@...utronix.de, jason@...edaemon.net, rjw@...ysocki.net,
	bhelgaas@...gle.com, lorenzo.pieralisi@....com,
	robert.richter@...iumnetworks.com, shijie.huang@....com,
	Suravee.Suthikulpanit@....com, hanjun.guo@...aro.org
Cc:	al.stone@...aro.org, mw@...ihalf.com, graeme.gregory@...aro.org,
	Catalin.Marinas@....com, will.deacon@....com,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, ddaney.cavm@...il.com,
	andrea.gallo@...aro.org, linux-pci@...r.kernel.org,
	"Abdulhamid, Harb" <harba@...eaurora.org>
Subject: Re: [PATCH V6 1/7] ACPI: I/O Remapping Table (IORT) initial support

Hi Tomasz,

> +static acpi_status
> +iort_match_node_callback(struct acpi_iort_node *node, void *context)
> +{
> +	case ACPI_IORT_NODE_PCI_ROOT_COMPLEX: {
> +		struct acpi_iort_root_complex *pci_rc;
> +		struct pci_bus *bus;
> +
> +		bus = to_pci_bus(dev);
> +		pci_rc = (struct acpi_iort_root_complex *)node->node_data;
> +
> +		/*
> +		 * It is assumed that PCI segment numbers maps one-to-one
> +		 * with root complexes. Each segment number can represent only
> +		 * one root complex.
> +		 */
> +		if (pci_rc->pci_segment_number == pci_domain_nr(bus))
> +			return AE_OK;
> +

There is problem with the find_dev_node and callback for PCIe here. It assumes
a one-to-one relationship between an SMMU and root complex. 

Just checked with Charles offline to see if there is anything in the IORT spec that forces
this. And, the answer was no. 

Pasting the IORT requirements for you below.

“The IORT was intended to be flexible enough to define static RID to SID mappings, which should cover 
the following configurations:
-	Dedicated SMMU per RC
-	Multiple RC’s per SMMU (as you described)
-	Multiple SMMU’s per RC (with static RID:SID range per SMMU)

The SMMU instance must be identified by either a device ID *or* a combination of 
segment ID *and* Requestor ID. ”

If a root complex has multiple SMMUs, this code is going to return the first SMMU. This needs
to be corrected.

> +		break;
> +	}
> +	}
> +
> +	return AE_NOT_FOUND;
> +}
> +

> +
> +static struct acpi_iort_node *
> +iort_find_dev_node(struct device *dev)
> +{
> +	struct pci_bus *pbus;
> +
> +	if (!dev_is_pci(dev))
> +		return iort_scan_node(ACPI_IORT_NODE_NAMED_COMPONENT,
> +				      iort_match_node_callback, dev);
> +
> +	/* Find a PCI root bus */
> +	pbus = to_pci_dev(dev)->bus;
> +	while (!pci_is_root_bus(pbus))
> +		pbus = pbus->parent;
> +
> +	return iort_scan_node(ACPI_IORT_NODE_PCI_ROOT_COMPLEX,
> +			      iort_match_node_callback, &pbus->dev);
> +}
> +

-- 
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ