IORT revision C introduced SMMUv3 MSI support for control interrupts,
which introduced a device ID mapping index to retrieve the dev ID
and ITS parent, adding its support in this patch set, please refer
to each patch for detail commit message.
RFC v2 -> v1:
- Drop RFC tag;
- return the index value directly from iort_get_id_mapping_index()
then make the logic simple in iort_node_map_id();
- To make sure ID mapping index is only ignored if all interrupts are
GSIV based
- Sqursh part of the patch 4 to patch 3
RFC v1 -> RFC v2:
- Introduce a new API iort_set_device_domain() to find the MSI domain
for an SMMUv3 (or any other IORT table node) to reduce the complex
of doing that via acpi_configure_pmsi_domain().
Hanjun Guo (3):
ACPICA: Add SMMUv3 device ID mapping index support
ACPI: IORT: lookup iort node via fwnode
ACPI: IORT: Skip SMMUv3 device ID map for two steps mappings
Lorenzo Pieralisi (1):
ACPI: IORT: SMMUv3 nodes MSI support
drivers/acpi/arm64/iort.c | 152 ++++++++++++++++++++++++++++++++++++++++++++--
include/acpi/actbl2.h | 1 +
2 files changed, 147 insertions(+), 6 deletions(-)
--
1.9.1
SMMUv3 device ID mapping index is used for SMMUv3
MSIs, update the IORT to support that.
Signed-off-by: Hanjun Guo <redacted>
---
include/acpi/actbl2.h | 1 +
1 file changed, 1 insertion(+)
Now we have a helper function iort_get_fwnode() which
lookup fwnode via iort node for SMMU, but sometimes we
just need something exctly the opposite, which means we
need to get the iort node via fwnode.
For example, we need to get SMMU's iort node when adding
support for SMMU MSI, but SMMU is not a named component
which has a associated device node in DSDT, that means
we can't match the ACPI full path name to get the iort
node for SMMU.
But with SMMU or other devices in IORT probed as platform
device, it created a fwnode to associate with the iort
node, so we introduce iort_get_iort_node() to get the
iort node via fwnode.
This can be extended to PMCG node usage in IORT too.
Signed-off-by: Hanjun Guo <redacted>
---
drivers/acpi/arm64/iort.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
IORT revision C introduced SMMUv3 MSI support which adding a
device ID mapping index in SMMUv3 sub table, to get the SMMUv3
device ID mapping for the output ID (dev ID for ITS) and the
link to which ITS.
So if a platform supports SMMUv3 MSI for control interrupt,
there will be a additional single map entry under SMMU, this
will not introduce any difference for devices just use one
step map to get its output ID and parent (ITS or SMMU), such
as PCI/NC/PMCG ---> ITS or PCI/NC ---> SMMU, but we need to
do the special handling for two steps map case such as
PCI/NC--->SMMUv3--->ITS.
Take a PCI hostbridge for example,
|----------------------|
| Root Complex Node |
|----------------------|
| map entry[x] |
|----------------------|
| id value |
| output_reference |
|---|------------------|
|
| |----------------------|
|-->| SMMUv3 |
|----------------------|
| SMMU dev ID |
| mapping index 0 |
|----------------------|
| map entry[0] |
|----------------------|
| id value |
| output_reference-----------> ITS 1 (SMMU MSI domain)
|----------------------|
| map entry[1] |
|----------------------|
| id value |
| output_reference-----------> ITS 2 (PCI MSI domain)
|----------------------|
When the SMMU dev ID mapping index is 0, there is entry[0]
to map to a ITS, we need to skip that map entry for PCI
or NC (named component), or we may get the wrong ITS parent.
Introduce iort_get_id_mapping_index() to get the index then
skip the map entry in iort_node_map_id(), also to get the
dev ID directly for iort_pmsi_get_dev_id() for ITS platform
MSI preparation.
Signed-off-by: Hanjun Guo <redacted>
---
drivers/acpi/arm64/iort.c | 64 +++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 59 insertions(+), 5 deletions(-)
@@ -366,6 +367,40 @@ struct acpi_iort_node *iort_node_get_id(struct acpi_iort_node *node,returnNULL;}+staticintiort_get_id_mapping_index(structacpi_iort_node*node)+{+structacpi_iort_smmu_v3*smmu;++switch(node->type){+caseACPI_IORT_NODE_SMMU_V3:+/*+*SMMUv3devIDmappingindexwasintroduecedinrevision1+*table,notavailableinrevision0+*/+if(node->revision<1)+return-EINVAL;++smmu=(structacpi_iort_smmu_v3*)node->node_data;+/*+*IDmappingindexisonlyignoredifallinterruptsare+*GSIVbased+*/+if(smmu->event_gsiv&&smmu->pri_gsiv&&smmu->gerr_gsiv+&&smmu->sync_gsiv)+return-EINVAL;++if(smmu->id_mapping_index>=node->mapping_count){+pr_err(FW_BUG"[node %p type %d] ID mapping index overflows valid mappings\n",+node,node->type);+return-EINVAL;+}++returnsmmu->id_mapping_index;+default:+return-EINVAL;+}+}+staticstructacpi_iort_node*iort_node_map_id(structacpi_iort_node*node,u32id_in,u32*id_out,u8type_mask)
@@ -375,7 +410,7 @@ static struct acpi_iort_node *iort_node_map_id(struct acpi_iort_node *node,/* Parse the ID mapping tree to find specified node type */while(node){structacpi_iort_id_mapping*map;-inti;+inti,index;if(IORT_TYPE_MASK(node->type)&type_mask){if(id_out)
@@ -396,8 +431,19 @@ static struct acpi_iort_node *iort_node_map_id(struct acpi_iort_node *node,gotofail_map;}+/*+*weneedtogetSMMUv3devIDmappingindexandskipits+*associatedIDmapforsinglemappingcases,errorvalue+*returnedforindexwillbeaninvalidvalueinpractical.+*/+index=iort_get_id_mapping_index(node);+/* Do the ID translation */for(i=0;i<node->mapping_count;i++,map++){+/* if it's a SMMUv3 device id mapping index, skip it */+if(i==index)+continue;+if(!iort_id_map(map,node->type,id,&id))break;}
@@ -507,16 +553,24 @@ u32 iort_msi_map_rid(struct device *dev, u32 req_id)*/intiort_pmsi_get_dev_id(structdevice*dev,u32*dev_id){-inti;+inti,index;structacpi_iort_node*node;node=iort_find_dev_node(dev);if(!node)return-ENODEV;-for(i=0;i<node->mapping_count;i++){-if(iort_node_map_platform_id(node,dev_id,IORT_MSI_TYPE,i))+index=iort_get_id_mapping_index(node);+/* if there is a valid index, go get the dev_id directly */+if(index>=0){+if(iort_node_get_id(node,dev_id,index))return0;+}else{+for(i=0;i<node->mapping_count;i++){+if(iort_node_map_platform_id(node,dev_id,+IORT_MSI_TYPE,i))+return0;+}}return-ENODEV;
From: Lorenzo Pieralisi <redacted>
Since we make single mappings valid for SMMUv3 (and PMCG), also
we have a mapping index for SMMUv3 MSI, we can directly use that
index to get the map entry, then retrieve ITS parent to add SMMUv3
MSI support.
Introduce a new API iort_set_device_domain() to find the MSI domain
for an SMMUv3 (or any other IORT table node) to reduce the complex
of doing that via acpi_configure_pmsi_domain().
Signed-off-by: Lorenzo Pieralisi <redacted>
Signed-off-by: Hanjun Guo <redacted>
---
drivers/acpi/arm64/iort.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
From: Lorenzo Pieralisi <hidden> Date: 2017-09-27 13:54:49
Hi Hanjun,
On Wed, Sep 27, 2017 at 09:20:14AM +0800, Hanjun Guo wrote:
IORT revision C introduced SMMUv3 MSI support which adding a
device ID mapping index in SMMUv3 sub table, to get the SMMUv3
device ID mapping for the output ID (dev ID for ITS) and the
link to which ITS.
So if a platform supports SMMUv3 MSI for control interrupt,
there will be a additional single map entry under SMMU, this
will not introduce any difference for devices just use one
step map to get its output ID and parent (ITS or SMMU), such
as PCI/NC/PMCG ---> ITS or PCI/NC ---> SMMU, but we need to
do the special handling for two steps map case such as
PCI/NC--->SMMUv3--->ITS.
Take a PCI hostbridge for example,
|----------------------|
| Root Complex Node |
|----------------------|
| map entry[x] |
|----------------------|
| id value |
| output_reference |
|---|------------------|
|
| |----------------------|
|-->| SMMUv3 |
|----------------------|
| SMMU dev ID |
| mapping index 0 |
|----------------------|
| map entry[0] |
|----------------------|
| id value |
| output_reference-----------> ITS 1 (SMMU MSI domain)
|----------------------|
| map entry[1] |
|----------------------|
| id value |
| output_reference-----------> ITS 2 (PCI MSI domain)
|----------------------|
When the SMMU dev ID mapping index is 0, there is entry[0]
to map to a ITS, we need to skip that map entry for PCI
or NC (named component), or we may get the wrong ITS parent.
Is this actually true ? I think that currently we would simply skip
the entry and print an error log but we can't get a wrong ITS parent.
I am rewriting this commit (I will probably split it), it is doing the
right thing but the commit log is stale (probably caused by code
reshuffling).
Thanks,
Lorenzo
quoted hunk
Introduce iort_get_id_mapping_index() to get the index then
skip the map entry in iort_node_map_id(), also to get the
dev ID directly for iort_pmsi_get_dev_id() for ITS platform
MSI preparation.
Signed-off-by: Hanjun Guo <redacted>
---
drivers/acpi/arm64/iort.c | 64 +++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 59 insertions(+), 5 deletions(-)
@@ -366,6 +367,40 @@ struct acpi_iort_node *iort_node_get_id(struct acpi_iort_node *node,returnNULL;}+staticintiort_get_id_mapping_index(structacpi_iort_node*node)+{+structacpi_iort_smmu_v3*smmu;++switch(node->type){+caseACPI_IORT_NODE_SMMU_V3:+/*+*SMMUv3devIDmappingindexwasintroduecedinrevision1+*table,notavailableinrevision0+*/+if(node->revision<1)+return-EINVAL;++smmu=(structacpi_iort_smmu_v3*)node->node_data;+/*+*IDmappingindexisonlyignoredifallinterruptsare+*GSIVbased+*/+if(smmu->event_gsiv&&smmu->pri_gsiv&&smmu->gerr_gsiv+&&smmu->sync_gsiv)+return-EINVAL;++if(smmu->id_mapping_index>=node->mapping_count){+pr_err(FW_BUG"[node %p type %d] ID mapping index overflows valid mappings\n",+node,node->type);+return-EINVAL;+}++returnsmmu->id_mapping_index;+default:+return-EINVAL;+}+}+staticstructacpi_iort_node*iort_node_map_id(structacpi_iort_node*node,u32id_in,u32*id_out,u8type_mask)
@@ -375,7 +410,7 @@ static struct acpi_iort_node *iort_node_map_id(struct acpi_iort_node *node,/* Parse the ID mapping tree to find specified node type */while(node){structacpi_iort_id_mapping*map;-inti;+inti,index;if(IORT_TYPE_MASK(node->type)&type_mask){if(id_out)
@@ -396,8 +431,19 @@ static struct acpi_iort_node *iort_node_map_id(struct acpi_iort_node *node,gotofail_map;}+/*+*weneedtogetSMMUv3devIDmappingindexandskipits+*associatedIDmapforsinglemappingcases,errorvalue+*returnedforindexwillbeaninvalidvalueinpractical.+*/+index=iort_get_id_mapping_index(node);+/* Do the ID translation */for(i=0;i<node->mapping_count;i++,map++){+/* if it's a SMMUv3 device id mapping index, skip it */+if(i==index)+continue;+if(!iort_id_map(map,node->type,id,&id))break;}
@@ -507,16 +553,24 @@ u32 iort_msi_map_rid(struct device *dev, u32 req_id)*/intiort_pmsi_get_dev_id(structdevice*dev,u32*dev_id){-inti;+inti,index;structacpi_iort_node*node;node=iort_find_dev_node(dev);if(!node)return-ENODEV;-for(i=0;i<node->mapping_count;i++){-if(iort_node_map_platform_id(node,dev_id,IORT_MSI_TYPE,i))+index=iort_get_id_mapping_index(node);+/* if there is a valid index, go get the dev_id directly */+if(index>=0){+if(iort_node_get_id(node,dev_id,index))return0;+}else{+for(i=0;i<node->mapping_count;i++){+if(iort_node_map_platform_id(node,dev_id,+IORT_MSI_TYPE,i))+return0;+}}return-ENODEV;
Hi Lorenzo,
Sorry for the late reply, holidays in China for the past week.
At 2017/9/27 21:54, Lorenzo Pieralisi wrote:
Hi Hanjun,
On Wed, Sep 27, 2017 at 09:20:14AM +0800, Hanjun Guo wrote:
quoted
IORT revision C introduced SMMUv3 MSI support which adding a
device ID mapping index in SMMUv3 sub table, to get the SMMUv3
device ID mapping for the output ID (dev ID for ITS) and the
link to which ITS.
So if a platform supports SMMUv3 MSI for control interrupt,
there will be a additional single map entry under SMMU, this
will not introduce any difference for devices just use one
step map to get its output ID and parent (ITS or SMMU), such
as PCI/NC/PMCG ---> ITS or PCI/NC ---> SMMU, but we need to
do the special handling for two steps map case such as
PCI/NC--->SMMUv3--->ITS.
Take a PCI hostbridge for example,
|----------------------|
| Root Complex Node |
|----------------------|
| map entry[x] |
|----------------------|
| id value |
| output_reference |
|---|------------------|
|
| |----------------------|
|-->| SMMUv3 |
|----------------------|
| SMMU dev ID |
| mapping index 0 |
|----------------------|
| map entry[0] |
|----------------------|
| id value |
| output_reference-----------> ITS 1 (SMMU MSI domain)
|----------------------|
| map entry[1] |
|----------------------|
| id value |
| output_reference-----------> ITS 2 (PCI MSI domain)
|----------------------|
When the SMMU dev ID mapping index is 0, there is entry[0]
to map to a ITS, we need to skip that map entry for PCI
or NC (named component), or we may get the wrong ITS parent.
Is this actually true ? I think that currently we would simply skip
the entry and print an error log but we can't get a wrong ITS parent.
So the only valid single mapping under type SMMUv3 is SMMUv3's dev id
mapping, we need to fix the IORT spec as well.
I am rewriting this commit (I will probably split it), it is doing the
right thing but the commit log is stale (probably caused by code
reshuffling).
Do I need to resend another version, or you can help to update it?
please let me know.
By the way, this patch set was tested on Hisilicon Hip08 with MSI
for SMMU, and it works fine.
Thanks
Hanjun
From: Lorenzo Pieralisi <hidden> Date: 2017-10-10 09:20:36
On Tue, Oct 10, 2017 at 02:47:53PM +0800, Hanjun Guo wrote:
Hi Lorenzo,
Sorry for the late reply, holidays in China for the past week.
At 2017/9/27 21:54, Lorenzo Pieralisi wrote:
quoted
Hi Hanjun,
On Wed, Sep 27, 2017 at 09:20:14AM +0800, Hanjun Guo wrote:
quoted
IORT revision C introduced SMMUv3 MSI support which adding a
device ID mapping index in SMMUv3 sub table, to get the SMMUv3
device ID mapping for the output ID (dev ID for ITS) and the
link to which ITS.
So if a platform supports SMMUv3 MSI for control interrupt,
there will be a additional single map entry under SMMU, this
will not introduce any difference for devices just use one
step map to get its output ID and parent (ITS or SMMU), such
as PCI/NC/PMCG ---> ITS or PCI/NC ---> SMMU, but we need to
do the special handling for two steps map case such as
PCI/NC--->SMMUv3--->ITS.
Take a PCI hostbridge for example,
|----------------------|
| Root Complex Node |
|----------------------|
| map entry[x] |
|----------------------|
| id value |
| output_reference |
|---|------------------|
|
| |----------------------|
|-->| SMMUv3 |
|----------------------|
| SMMU dev ID |
| mapping index 0 |
|----------------------|
| map entry[0] |
|----------------------|
| id value |
| output_reference-----------> ITS 1 (SMMU MSI domain)
|----------------------|
| map entry[1] |
|----------------------|
| id value |
| output_reference-----------> ITS 2 (PCI MSI domain)
|----------------------|
When the SMMU dev ID mapping index is 0, there is entry[0]
to map to a ITS, we need to skip that map entry for PCI
or NC (named component), or we may get the wrong ITS parent.
Is this actually true ? I think that currently we would simply skip
the entry and print an error log but we can't get a wrong ITS parent.
So the only valid single mapping under type SMMUv3 is SMMUv3's dev id
mapping, we need to fix the IORT spec as well.
quoted
I am rewriting this commit (I will probably split it), it is doing the
right thing but the commit log is stale (probably caused by code
reshuffling).
Do I need to resend another version, or you can help to update it?
please let me know.
I reworked the patches, you can repost/retest them I made them available
in the branch below, we will have to add a guard around ACPICA smmu
struct (unfortunately I think we will have to use the ACPICA version as
a guard) or I can ask Rafael to pull the series if ACPICA goes via ACPI
tree (and your patch made it into the release - I will check ACPICA
upstream).
git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git iort/smmu-msi-for-4.15
On Tue, Oct 10, 2017 at 02:47:53PM +0800, Hanjun Guo wrote:
quoted
Hi Lorenzo,
Sorry for the late reply, holidays in China for the past week.
At 2017/9/27 21:54, Lorenzo Pieralisi wrote:
quoted
Hi Hanjun,
On Wed, Sep 27, 2017 at 09:20:14AM +0800, Hanjun Guo wrote:
quoted
IORT revision C introduced SMMUv3 MSI support which adding a
device ID mapping index in SMMUv3 sub table, to get the SMMUv3
device ID mapping for the output ID (dev ID for ITS) and the
link to which ITS.
So if a platform supports SMMUv3 MSI for control interrupt,
there will be a additional single map entry under SMMU, this
will not introduce any difference for devices just use one
step map to get its output ID and parent (ITS or SMMU), such
as PCI/NC/PMCG ---> ITS or PCI/NC ---> SMMU, but we need to
do the special handling for two steps map case such as
PCI/NC--->SMMUv3--->ITS.
Take a PCI hostbridge for example,
|----------------------|
| Root Complex Node |
|----------------------|
| map entry[x] |
|----------------------|
| id value |
| output_reference |
|---|------------------|
|
| |----------------------|
|-->| SMMUv3 |
|----------------------|
| SMMU dev ID |
| mapping index 0 |
|----------------------|
| map entry[0] |
|----------------------|
| id value |
| output_reference-----------> ITS 1 (SMMU MSI domain)
|----------------------|
| map entry[1] |
|----------------------|
| id value |
| output_reference-----------> ITS 2 (PCI MSI domain)
|----------------------|
When the SMMU dev ID mapping index is 0, there is entry[0]
to map to a ITS, we need to skip that map entry for PCI
or NC (named component), or we may get the wrong ITS parent.
Is this actually true ? I think that currently we would simply skip
the entry and print an error log but we can't get a wrong ITS parent.
So the only valid single mapping under type SMMUv3 is SMMUv3's dev id
mapping, we need to fix the IORT spec as well.
quoted
I am rewriting this commit (I will probably split it), it is doing the
right thing but the commit log is stale (probably caused by code
reshuffling).
Do I need to resend another version, or you can help to update it?
please let me know.
I reworked the patches, you can repost/retest them I made them available
in the branch below, we will have to add a guard around ACPICA smmu
struct (unfortunately I think we will have to use the ACPICA version as
a guard) or I can ask Rafael to pull the series if ACPICA goes via ACPI
tree (and your patch made it into the release - I will check ACPICA
upstream).
Bob already merged my pull request yesterday, I think it will be ready for
acpica release for this month.
From: Lorenzo Pieralisi <hidden> Date: 2017-10-11 10:24:24
On Wed, Oct 11, 2017 at 01:26:10PM +0800, Hanjun Guo wrote:
On 2017/10/10 17:20, Lorenzo Pieralisi wrote:
quoted
On Tue, Oct 10, 2017 at 02:47:53PM +0800, Hanjun Guo wrote:
quoted
Hi Lorenzo,
Sorry for the late reply, holidays in China for the past week.
At 2017/9/27 21:54, Lorenzo Pieralisi wrote:
quoted
Hi Hanjun,
On Wed, Sep 27, 2017 at 09:20:14AM +0800, Hanjun Guo wrote:
quoted
IORT revision C introduced SMMUv3 MSI support which adding a
device ID mapping index in SMMUv3 sub table, to get the SMMUv3
device ID mapping for the output ID (dev ID for ITS) and the
link to which ITS.
So if a platform supports SMMUv3 MSI for control interrupt,
there will be a additional single map entry under SMMU, this
will not introduce any difference for devices just use one
step map to get its output ID and parent (ITS or SMMU), such
as PCI/NC/PMCG ---> ITS or PCI/NC ---> SMMU, but we need to
do the special handling for two steps map case such as
PCI/NC--->SMMUv3--->ITS.
Take a PCI hostbridge for example,
|----------------------|
| Root Complex Node |
|----------------------|
| map entry[x] |
|----------------------|
| id value |
| output_reference |
|---|------------------|
|
| |----------------------|
|-->| SMMUv3 |
|----------------------|
| SMMU dev ID |
| mapping index 0 |
|----------------------|
| map entry[0] |
|----------------------|
| id value |
| output_reference-----------> ITS 1 (SMMU MSI domain)
|----------------------|
| map entry[1] |
|----------------------|
| id value |
| output_reference-----------> ITS 2 (PCI MSI domain)
|----------------------|
When the SMMU dev ID mapping index is 0, there is entry[0]
to map to a ITS, we need to skip that map entry for PCI
or NC (named component), or we may get the wrong ITS parent.
Is this actually true ? I think that currently we would simply skip
the entry and print an error log but we can't get a wrong ITS parent.
So the only valid single mapping under type SMMUv3 is SMMUv3's dev id
mapping, we need to fix the IORT spec as well.
quoted
I am rewriting this commit (I will probably split it), it is doing the
right thing but the commit log is stale (probably caused by code
reshuffling).
Do I need to resend another version, or you can help to update it?
please let me know.
I reworked the patches, you can repost/retest them I made them available
in the branch below, we will have to add a guard around ACPICA smmu
struct (unfortunately I think we will have to use the ACPICA version as
a guard) or I can ask Rafael to pull the series if ACPICA goes via ACPI
tree (and your patch made it into the release - I will check ACPICA
upstream).
Bob already merged my pull request yesterday, I think it will be ready for
acpica release for this month.
That's good, mind updating the patch series with an ACPICA guard in IORT
code in preparation for the pull request ?
On Wed, Oct 11, 2017 at 01:26:10PM +0800, Hanjun Guo wrote:
quoted
On 2017/10/10 17:20, Lorenzo Pieralisi wrote:
quoted
On Tue, Oct 10, 2017 at 02:47:53PM +0800, Hanjun Guo wrote:
quoted
Hi Lorenzo,
Sorry for the late reply, holidays in China for the past week.
At 2017/9/27 21:54, Lorenzo Pieralisi wrote:
quoted
Hi Hanjun,
On Wed, Sep 27, 2017 at 09:20:14AM +0800, Hanjun Guo wrote:
quoted
IORT revision C introduced SMMUv3 MSI support which adding a
device ID mapping index in SMMUv3 sub table, to get the SMMUv3
device ID mapping for the output ID (dev ID for ITS) and the
link to which ITS.
So if a platform supports SMMUv3 MSI for control interrupt,
there will be a additional single map entry under SMMU, this
will not introduce any difference for devices just use one
step map to get its output ID and parent (ITS or SMMU), such
as PCI/NC/PMCG ---> ITS or PCI/NC ---> SMMU, but we need to
do the special handling for two steps map case such as
PCI/NC--->SMMUv3--->ITS.
Take a PCI hostbridge for example,
|----------------------|
| Root Complex Node |
|----------------------|
| map entry[x] |
|----------------------|
| id value |
| output_reference |
|---|------------------|
|
| |----------------------|
|-->| SMMUv3 |
|----------------------|
| SMMU dev ID |
| mapping index 0 |
|----------------------|
| map entry[0] |
|----------------------|
| id value |
| output_reference-----------> ITS 1 (SMMU MSI domain)
|----------------------|
| map entry[1] |
|----------------------|
| id value |
| output_reference-----------> ITS 2 (PCI MSI domain)
|----------------------|
When the SMMU dev ID mapping index is 0, there is entry[0]
to map to a ITS, we need to skip that map entry for PCI
or NC (named component), or we may get the wrong ITS parent.
Is this actually true ? I think that currently we would simply skip
the entry and print an error log but we can't get a wrong ITS parent.
So the only valid single mapping under type SMMUv3 is SMMUv3's dev id
mapping, we need to fix the IORT spec as well.
quoted
I am rewriting this commit (I will probably split it), it is doing the
right thing but the commit log is stale (probably caused by code
reshuffling).
Do I need to resend another version, or you can help to update it?
please let me know.
I reworked the patches, you can repost/retest them I made them available
in the branch below, we will have to add a guard around ACPICA smmu
struct (unfortunately I think we will have to use the ACPICA version as
a guard) or I can ask Rafael to pull the series if ACPICA goes via ACPI
tree (and your patch made it into the release - I will check ACPICA
upstream).
Bob already merged my pull request yesterday, I think it will be ready for
acpica release for this month.
That's good, mind updating the patch series with an ACPICA guard in IORT
code in preparation for the pull request ?
Do you mean drop the acpica patch in this patch set and adding the code below?
From: Lorenzo Pieralisi <hidden> Date: 2017-10-12 09:50:17
On Thu, Oct 12, 2017 at 03:30:10PM +0800, Hanjun Guo wrote:
On 2017/10/11 18:24, Lorenzo Pieralisi wrote:
quoted
On Wed, Oct 11, 2017 at 01:26:10PM +0800, Hanjun Guo wrote:
quoted
On 2017/10/10 17:20, Lorenzo Pieralisi wrote:
quoted
On Tue, Oct 10, 2017 at 02:47:53PM +0800, Hanjun Guo wrote:
quoted
Hi Lorenzo,
Sorry for the late reply, holidays in China for the past week.
At 2017/9/27 21:54, Lorenzo Pieralisi wrote:
quoted
Hi Hanjun,
On Wed, Sep 27, 2017 at 09:20:14AM +0800, Hanjun Guo wrote:
quoted
IORT revision C introduced SMMUv3 MSI support which adding a
device ID mapping index in SMMUv3 sub table, to get the SMMUv3
device ID mapping for the output ID (dev ID for ITS) and the
link to which ITS.
So if a platform supports SMMUv3 MSI for control interrupt,
there will be a additional single map entry under SMMU, this
will not introduce any difference for devices just use one
step map to get its output ID and parent (ITS or SMMU), such
as PCI/NC/PMCG ---> ITS or PCI/NC ---> SMMU, but we need to
do the special handling for two steps map case such as
PCI/NC--->SMMUv3--->ITS.
Take a PCI hostbridge for example,
|----------------------|
| Root Complex Node |
|----------------------|
| map entry[x] |
|----------------------|
| id value |
| output_reference |
|---|------------------|
|
| |----------------------|
|-->| SMMUv3 |
|----------------------|
| SMMU dev ID |
| mapping index 0 |
|----------------------|
| map entry[0] |
|----------------------|
| id value |
| output_reference-----------> ITS 1 (SMMU MSI domain)
|----------------------|
| map entry[1] |
|----------------------|
| id value |
| output_reference-----------> ITS 2 (PCI MSI domain)
|----------------------|
When the SMMU dev ID mapping index is 0, there is entry[0]
to map to a ITS, we need to skip that map entry for PCI
or NC (named component), or we may get the wrong ITS parent.
Is this actually true ? I think that currently we would simply skip
the entry and print an error log but we can't get a wrong ITS parent.
So the only valid single mapping under type SMMUv3 is SMMUv3's dev id
mapping, we need to fix the IORT spec as well.
quoted
I am rewriting this commit (I will probably split it), it is doing the
right thing but the commit log is stale (probably caused by code
reshuffling).
Do I need to resend another version, or you can help to update it?
please let me know.
I reworked the patches, you can repost/retest them I made them available
in the branch below, we will have to add a guard around ACPICA smmu
struct (unfortunately I think we will have to use the ACPICA version as
a guard) or I can ask Rafael to pull the series if ACPICA goes via ACPI
tree (and your patch made it into the release - I will check ACPICA
upstream).
Bob already merged my pull request yesterday, I think it will be ready for
acpica release for this month.
That's good, mind updating the patch series with an ACPICA guard in IORT
code in preparation for the pull request ?
Do you mean drop the acpica patch in this patch set and adding the code below?
Yes unless we find a "smarter" way of handling the dependency.
Thanks,
Lorenzo