* [PATCH 0/2]Add Variable Page Size and IA64 Support in Intel IOMMU
@ 2008-10-01 16:56 ` Fenghua Yu
0 siblings, 0 replies; 21+ messages in thread
From: Fenghua Yu @ 2008-10-01 16:56 UTC (permalink / raw)
To: Luck, Tony, Jesse Barnes, David Woodhouse, Ingo Molnar,
Avi Kivity, Stephen Rothwell, Andrew Morton
Cc: LKML, linux-ia64
The following two patches (Intel IOMMU generic patch and ia64 specific patch) together enable Intel IOMMU on IA64 platform. They are applied cleanly on the latest linux-next tree which contains Intel IOMMU interrupt remapping and VT-d driver KVM support code.
If applying only the generic patch on x86-64 kernel, x86-64 IOMMU is working fine, i.e. the generic patch doesn't have compilation and functionality impact on x86-64 IOMMU. If applying only the ia64 specific patch on ia64 kernel, ia64 is working as non-IOMMU/swiotlb case. If applying both of the patches and set CONFIG_DMAR=y, ia64 IOMMU is working.
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 0/2]Add Variable Page Size and IA64 Support in Intel IOMMU
@ 2008-10-01 16:56 ` Fenghua Yu
0 siblings, 0 replies; 21+ messages in thread
From: Fenghua Yu @ 2008-10-01 16:56 UTC (permalink / raw)
To: Luck, Tony, Jesse Barnes, David Woodhouse, Ingo Molnar,
Avi Kivity, Stephen Rothwell, Andrew Morton
Cc: LKML, linux-ia64
The following two patches (Intel IOMMU generic patch and ia64 specific patch) together enable Intel IOMMU on IA64 platform. They are applied cleanly on the latest linux-next tree which contains Intel IOMMU interrupt remapping and VT-d driver KVM support code.
If applying only the generic patch on x86-64 kernel, x86-64 IOMMU is working fine, i.e. the generic patch doesn't have compilation and functionality impact on x86-64 IOMMU. If applying only the ia64 specific patch on ia64 kernel, ia64 is working as non-IOMMU/swiotlb case. If applying both of the patches and set CONFIG_DMAR=y, ia64 IOMMU is working.
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 0/2]Add Variable Page Size and IA64 Support in Intel IOMMU
2008-10-01 16:56 ` Fenghua Yu
@ 2008-10-03 15:50 ` Bjorn Helgaas
-1 siblings, 0 replies; 21+ messages in thread
From: Bjorn Helgaas @ 2008-10-03 15:50 UTC (permalink / raw)
To: Fenghua Yu
Cc: Luck, Tony, Jesse Barnes, David Woodhouse, Ingo Molnar,
Avi Kivity, Stephen Rothwell, Andrew Morton, LKML, linux-ia64
On Wednesday 01 October 2008 10:56:06 am Fenghua Yu wrote:
> The following two patches (Intel IOMMU generic patch and ia64 specific patch) together enable Intel IOMMU on IA64 platform. They are applied cleanly on the latest linux-next tree which contains Intel IOMMU interrupt remapping and VT-d driver KVM support code.
General comment (not ia64-related): it looks like you detect the
IOMMU using the static DMAR table. Does the IOMMU also appear in
PCI config space or the ACPI namespace? I expect it would, because
the fact that the DMAR table is static precludes any sort of hot-plug
to add or remove IOMMUs.
If it *is* in config space or the namespace, it would be good to
exercise that discovery path to help shake out firmware bugs. For
example, arch/ia64/hp/common/sba_iommu.c uses acpi_bus_register_driver()
to discover HP IOMMUs. I wouldn't hold the sba_iommu.c discovery code
(most of which I take the blame for) up as a shining example of how to
do things, but it shows the point.
Bjorn
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 0/2]Add Variable Page Size and IA64 Support in Intel IOMMU
@ 2008-10-03 15:50 ` Bjorn Helgaas
0 siblings, 0 replies; 21+ messages in thread
From: Bjorn Helgaas @ 2008-10-03 15:50 UTC (permalink / raw)
To: Fenghua Yu
Cc: Luck, Tony, Jesse Barnes, David Woodhouse, Ingo Molnar,
Avi Kivity, Stephen Rothwell, Andrew Morton, LKML, linux-ia64
On Wednesday 01 October 2008 10:56:06 am Fenghua Yu wrote:
> The following two patches (Intel IOMMU generic patch and ia64 specific patch) together enable Intel IOMMU on IA64 platform. They are applied cleanly on the latest linux-next tree which contains Intel IOMMU interrupt remapping and VT-d driver KVM support code.
General comment (not ia64-related): it looks like you detect the
IOMMU using the static DMAR table. Does the IOMMU also appear in
PCI config space or the ACPI namespace? I expect it would, because
the fact that the DMAR table is static precludes any sort of hot-plug
to add or remove IOMMUs.
If it *is* in config space or the namespace, it would be good to
exercise that discovery path to help shake out firmware bugs. For
example, arch/ia64/hp/common/sba_iommu.c uses acpi_bus_register_driver()
to discover HP IOMMUs. I wouldn't hold the sba_iommu.c discovery code
(most of which I take the blame for) up as a shining example of how to
do things, but it shows the point.
Bjorn
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH 0/2]Add Variable Page Size and IA64 Support in Intel
2008-10-03 15:50 ` Bjorn Helgaas
@ 2008-10-06 19:44 ` Yu, Fenghua
-1 siblings, 0 replies; 21+ messages in thread
From: Yu, Fenghua @ 2008-10-06 19:44 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Luck, Tony, Jesse Barnes, David Woodhouse, Ingo Molnar,
Avi Kivity, Stephen Rothwell, Andrew Morton, LKML,
linux-ia64@vger.kernel.org
>> The following two patches (Intel IOMMU generic patch and ia64 specific
>the fact that the DMAR table is static precludes any sort of hot-plug
>to add or remove IOMMUs.
The latest VT-d spec v1.1 does not support hot plug. If the feature is available in newer spec, we will support it.
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH 0/2]Add Variable Page Size and IA64 Support in Intel IOMMU
@ 2008-10-06 19:44 ` Yu, Fenghua
0 siblings, 0 replies; 21+ messages in thread
From: Yu, Fenghua @ 2008-10-06 19:44 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Luck, Tony, Jesse Barnes, David Woodhouse, Ingo Molnar,
Avi Kivity, Stephen Rothwell, Andrew Morton, LKML,
linux-ia64@vger.kernel.org
>> The following two patches (Intel IOMMU generic patch and ia64 specific
>the fact that the DMAR table is static precludes any sort of hot-plug
>to add or remove IOMMUs.
The latest VT-d spec v1.1 does not support hot plug. If the feature is available in newer spec, we will support it.
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH V2 0/2] Add Variable Page Size and IA64 Support in Intel IOMMU
2008-10-01 16:56 ` Fenghua Yu
@ 2008-10-07 0:01 ` Fenghua Yu
-1 siblings, 0 replies; 21+ messages in thread
From: Fenghua Yu @ 2008-10-07 0:01 UTC (permalink / raw)
To: Luck, Tony, Jesse Barnes, David Woodhouse, Ingo Molnar,
Avi Kivity, Stephen Rothwell, Andrew Morton, Bjorn Helgaas
Cc: LKML, linux-ia64@vger.kernel.org
The patche set (Intel IOMMU generic patch and ia64 specific patch) together enable Intel IOMMU on IA64 platform. They are applied cleanly on the latest linux-next tree which contains Intel IOMMU interrupt remapping and VT-d driver KVM support code.
If applying only the generic patch on x86-64 kernel, x86-64 IOMMU is working fine, i.e. the generic patch doesn't have compilation and functionality impact on x86-64 IOMMU. If applying only the ia64 specific patch on ia64 kernel, ia64 is working as non-IOMMU/swiotlb case. If applying both of the patches and set CONFIG_DMAR=y, ia64 IOMMU is working.
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH V2 0/2] Add Variable Page Size and IA64 Support in Intel IOMMU
@ 2008-10-07 0:01 ` Fenghua Yu
0 siblings, 0 replies; 21+ messages in thread
From: Fenghua Yu @ 2008-10-07 0:01 UTC (permalink / raw)
To: Luck, Tony, Jesse Barnes, David Woodhouse, Ingo Molnar,
Avi Kivity, Stephen Rothwell, Andrew Morton, Bjorn Helgaas
Cc: LKML, linux-ia64@vger.kernel.org
The patche set (Intel IOMMU generic patch and ia64 specific patch) together enable Intel IOMMU on IA64 platform. They are applied cleanly on the latest linux-next tree which contains Intel IOMMU interrupt remapping and VT-d driver KVM support code.
If applying only the generic patch on x86-64 kernel, x86-64 IOMMU is working fine, i.e. the generic patch doesn't have compilation and functionality impact on x86-64 IOMMU. If applying only the ia64 specific patch on ia64 kernel, ia64 is working as non-IOMMU/swiotlb case. If applying both of the patches and set CONFIG_DMAR=y, ia64 IOMMU is working.
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH]iwlan dma mapping read and write changes
2008-10-01 16:56 ` Fenghua Yu
` (2 preceding siblings ...)
(?)
@ 2009-02-11 18:26 ` Fenghua Yu
2009-02-11 18:35 ` Bhavesh Davda
` (2 more replies)
-1 siblings, 3 replies; 21+ messages in thread
From: Fenghua Yu @ 2009-02-11 18:26 UTC (permalink / raw)
To: David Woodhouse, Ingo Molnar, Stephen Rothwell, Andrew Morton,
Johannes Berg, Emmanuel Grumbach, Tomas Winkler, Zhu Yi,
Chris Wright
Cc: LKML, iommu
When iwlan runs on IOMMU, IOMMU generates a lot of PTE write faults because PTE
write bit is not set on some of PTE's. This is because iwlan driver calls DMA
mapping with PCI_DMA_TODEVICE which is read only in mapping PTE. But iwlan device
actually writes to the mapped page to update its contents. This issue is not
exposed in swiotlb. But VT-d hardware can capture this fault and stop the fault
transaction.
The following patch fixes the issue.
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
iwl-tx.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c.orig 2009-02-10 21:28:45.000000000 -0800
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c 2009-02-10 21:41:02.000000000 -0800
@@ -148,7 +148,7 @@ static void iwl_hw_txq_free_tfd(struct i
pci_unmap_single(dev,
pci_unmap_addr(&txq->cmd[index]->meta, mapping),
pci_unmap_len(&txq->cmd[index]->meta, len),
- PCI_DMA_TODEVICE);
+ PCI_DMA_BIDIRECTIONAL);
/* Unmap chunks, if any. */
for (i = 1; i < num_tbs; i++) {
@@ -964,7 +964,7 @@ int iwl_tx_skb(struct iwl_priv *priv, st
* within command buffer array. */
txcmd_phys = pci_map_single(priv->pci_dev,
out_cmd, sizeof(struct iwl_cmd),
- PCI_DMA_TODEVICE);
+ PCI_DMA_BIDIRECTIONAL);
pci_unmap_addr_set(&out_cmd->meta, mapping, txcmd_phys);
pci_unmap_len_set(&out_cmd->meta, len, sizeof(struct iwl_cmd));
/* Add buffer containing Tx command and MAC(!) header to TFD's
@@ -1115,7 +1115,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *pr
IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd);
phys_addr = pci_map_single(priv->pci_dev, out_cmd,
- len, PCI_DMA_TODEVICE);
+ len, PCI_DMA_BIDIRECTIONAL);
pci_unmap_addr_set(&out_cmd->meta, mapping, phys_addr);
pci_unmap_len_set(&out_cmd->meta, len, len);
phys_addr += offsetof(struct iwl_cmd, hdr);
@@ -1212,7 +1212,7 @@ static void iwl_hcmd_queue_reclaim(struc
pci_unmap_single(priv->pci_dev,
pci_unmap_addr(&txq->cmd[cmd_idx]->meta, mapping),
pci_unmap_len(&txq->cmd[cmd_idx]->meta, len),
- PCI_DMA_TODEVICE);
+ PCI_DMA_BIDIRECTIONAL);
for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx;
q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 18:26 ` [PATCH]iwlan dma mapping read and write changes Fenghua Yu
@ 2009-02-11 18:35 ` Bhavesh Davda
2009-02-11 19:29 ` Yu, Fenghua
2009-02-11 18:59 ` Chris Wright
2009-02-11 21:27 ` Winkler, Tomas
2 siblings, 1 reply; 21+ messages in thread
From: Bhavesh Davda @ 2009-02-11 18:35 UTC (permalink / raw)
To: Fenghua Yu, David Woodhouse, Ingo Molnar, Stephen Rothwell,
Andrew Morton, Johannes Berg, Emmanuel Grumbach, Tomas Winkler,
Zhu Yi, Chris Wright
Cc: iommu@lists.linux-foundation.org, LKML
Looks good to me. Ship it!
- Bhavesh
Bhavesh P. Davda
> -----Original Message-----
> From: iommu-bounces@lists.linux-foundation.org [mailto:iommu-
> bounces@lists.linux-foundation.org] On Behalf Of Fenghua Yu
> Sent: Wednesday, February 11, 2009 10:27 AM
> To: David Woodhouse; Ingo Molnar; Stephen Rothwell; Andrew Morton;
> Johannes Berg; Emmanuel Grumbach; Tomas Winkler; Zhu Yi; Chris Wright
> Cc: iommu@lists.linux-foundation.org; LKML
> Subject: [PATCH]iwlan dma mapping read and write changes
>
> When iwlan runs on IOMMU, IOMMU generates a lot of PTE write faults
> because PTE
> write bit is not set on some of PTE's. This is because iwlan driver
> calls DMA
> mapping with PCI_DMA_TODEVICE which is read only in mapping PTE. But
> iwlan device
> actually writes to the mapped page to update its contents. This issue
> is not
> exposed in swiotlb. But VT-d hardware can capture this fault and stop
> the fault
> transaction.
>
> The following patch fixes the issue.
>
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
>
> ---
>
> iwl-tx.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> --- a/drivers/net/wireless/iwlwifi/iwl-tx.c.orig 2009-02-10
> 21:28:45.000000000 -0800
> +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c 2009-02-10
> 21:41:02.000000000 -0800
> @@ -148,7 +148,7 @@ static void iwl_hw_txq_free_tfd(struct i
> pci_unmap_single(dev,
> pci_unmap_addr(&txq->cmd[index]->meta,
> mapping),
> pci_unmap_len(&txq->cmd[index]->meta, len),
> - PCI_DMA_TODEVICE);
> + PCI_DMA_BIDIRECTIONAL);
>
> /* Unmap chunks, if any. */
> for (i = 1; i < num_tbs; i++) {
> @@ -964,7 +964,7 @@ int iwl_tx_skb(struct iwl_priv *priv, st
> * within command buffer array. */
> txcmd_phys = pci_map_single(priv->pci_dev,
> out_cmd, sizeof(struct iwl_cmd),
> - PCI_DMA_TODEVICE);
> + PCI_DMA_BIDIRECTIONAL);
> pci_unmap_addr_set(&out_cmd->meta, mapping, txcmd_phys);
> pci_unmap_len_set(&out_cmd->meta, len, sizeof(struct iwl_cmd));
> /* Add buffer containing Tx command and MAC(!) header to TFD's
> @@ -1115,7 +1115,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *pr
> IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd);
>
> phys_addr = pci_map_single(priv->pci_dev, out_cmd,
> - len, PCI_DMA_TODEVICE);
> + len, PCI_DMA_BIDIRECTIONAL);
> pci_unmap_addr_set(&out_cmd->meta, mapping, phys_addr);
> pci_unmap_len_set(&out_cmd->meta, len, len);
> phys_addr += offsetof(struct iwl_cmd, hdr);
> @@ -1212,7 +1212,7 @@ static void iwl_hcmd_queue_reclaim(struc
> pci_unmap_single(priv->pci_dev,
> pci_unmap_addr(&txq->cmd[cmd_idx]->meta, mapping),
> pci_unmap_len(&txq->cmd[cmd_idx]->meta, len),
> - PCI_DMA_TODEVICE);
> + PCI_DMA_BIDIRECTIONAL);
>
> for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx;
> q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH]iwlan dma mapping read and write changes
2009-02-11 18:26 ` [PATCH]iwlan dma mapping read and write changes Fenghua Yu
2009-02-11 18:35 ` Bhavesh Davda
@ 2009-02-11 18:59 ` Chris Wright
2009-02-11 21:27 ` Winkler, Tomas
2 siblings, 0 replies; 21+ messages in thread
From: Chris Wright @ 2009-02-11 18:59 UTC (permalink / raw)
To: Fenghua Yu
Cc: David Woodhouse, Ingo Molnar, Stephen Rothwell, Andrew Morton,
Johannes Berg, Emmanuel Grumbach, Tomas Winkler, Zhu Yi,
Chris Wright, LKML, iommu
* Fenghua Yu (fenghua.yu@intel.com) wrote:
> When iwlan runs on IOMMU, IOMMU generates a lot of PTE write faults because PTE
> write bit is not set on some of PTE's. This is because iwlan driver calls DMA
> mapping with PCI_DMA_TODEVICE which is read only in mapping PTE. But iwlan device
> actually writes to the mapped page to update its contents. This issue is not
> exposed in swiotlb. But VT-d hardware can capture this fault and stop the fault
> transaction.
>
> The following patch fixes the issue.
Yes, plain old driver bug! This fixes the iwlagn vt-d issue.
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Tested-by: Chris Wright <chrisw@sous-sol.org>
thanks,
chris
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 18:35 ` Bhavesh Davda
@ 2009-02-11 19:29 ` Yu, Fenghua
0 siblings, 0 replies; 21+ messages in thread
From: Yu, Fenghua @ 2009-02-11 19:29 UTC (permalink / raw)
To: 'Bhavesh Davda', 'David Woodhouse',
'Ingo Molnar', 'Stephen Rothwell',
'Andrew Morton', 'Johannes Berg',
Grumbach, Emmanuel, Winkler, Tomas, Zhu, Yi,
'Chris Wright'
Cc: 'iommu@lists.linux-foundation.org', 'LKML'
>Looks good to me. Ship it!
>
>- Bhavesh
>
>Bhavesh P. Davda
Reviewed-by: Bhavesh Davda <bhavesh@vmware.com>
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 18:26 ` [PATCH]iwlan dma mapping read and write changes Fenghua Yu
2009-02-11 18:35 ` Bhavesh Davda
2009-02-11 18:59 ` Chris Wright
@ 2009-02-11 21:27 ` Winkler, Tomas
2009-02-11 21:33 ` Johannes Berg
2 siblings, 1 reply; 21+ messages in thread
From: Winkler, Tomas @ 2009-02-11 21:27 UTC (permalink / raw)
To: Yu, Fenghua, David Woodhouse, Ingo Molnar, Stephen Rothwell,
Andrew Morton, Johannes Berg, Grumbach, Emmanuel, Zhu, Yi,
Chris Wright
Cc: LKML, iommu@lists.linux-foundation.org
>-----Original Message-----
>From: Yu, Fenghua
>Sent: Wednesday, February 11, 2009 8:27 PM
>To: David Woodhouse; Ingo Molnar; Stephen Rothwell; Andrew Morton; Johannes
>Berg; Grumbach, Emmanuel; Winkler, Tomas; Zhu, Yi; Chris Wright
>Cc: LKML; iommu@lists.linux-foundation.org
>Subject: [PATCH]iwlan dma mapping read and write changes
>
>When iwlan runs on IOMMU, IOMMU generates a lot of PTE write faults because
>PTE
>write bit is not set on some of PTE's. This is because iwlan driver calls
>DMA
>mapping with PCI_DMA_TODEVICE which is read only in mapping PTE. But iwlan
>device
>actually writes to the mapped page to update its contents. This issue is
>not
>exposed in swiotlb. But VT-d hardware can capture this fault and stop the
>fault
>transaction.
>
>The following patch fixes the issue.
>
>Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Indeed the firmware/ucode write back to host memory to update retry counter for APMDU packets. I'm not sure if this is needed for legacy traffic, though.
>---
>
> iwl-tx.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
>--- a/drivers/net/wireless/iwlwifi/iwl-tx.c.orig 2009-02-10
>21:28:45.000000000 -0800
>+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c 2009-02-10
>21:41:02.000000000 -0800
>@@ -148,7 +148,7 @@ static void iwl_hw_txq_free_tfd(struct i
> pci_unmap_single(dev,
> pci_unmap_addr(&txq->cmd[index]->meta, mapping),
> pci_unmap_len(&txq->cmd[index]->meta, len),
>- PCI_DMA_TODEVICE);
>+ PCI_DMA_BIDIRECTIONAL);
>
> /* Unmap chunks, if any. */
> for (i = 1; i < num_tbs; i++) {
>@@ -964,7 +964,7 @@ int iwl_tx_skb(struct iwl_priv *priv, st
> * within command buffer array. */
> txcmd_phys = pci_map_single(priv->pci_dev,
> out_cmd, sizeof(struct iwl_cmd),
>- PCI_DMA_TODEVICE);
>+ PCI_DMA_BIDIRECTIONAL);
> pci_unmap_addr_set(&out_cmd->meta, mapping, txcmd_phys);
> pci_unmap_len_set(&out_cmd->meta, len, sizeof(struct iwl_cmd));
> /* Add buffer containing Tx command and MAC(!) header to TFD's
>@@ -1115,7 +1115,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *pr
> IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd);
>
> phys_addr = pci_map_single(priv->pci_dev, out_cmd,
>- len, PCI_DMA_TODEVICE);
>+ len, PCI_DMA_BIDIRECTIONAL);
> pci_unmap_addr_set(&out_cmd->meta, mapping, phys_addr);
> pci_unmap_len_set(&out_cmd->meta, len, len);
> phys_addr += offsetof(struct iwl_cmd, hdr);
>@@ -1212,7 +1212,7 @@ static void iwl_hcmd_queue_reclaim(struc
> pci_unmap_single(priv->pci_dev,
> pci_unmap_addr(&txq->cmd[cmd_idx]->meta, mapping),
> pci_unmap_len(&txq->cmd[cmd_idx]->meta, len),
>- PCI_DMA_TODEVICE);
>+ PCI_DMA_BIDIRECTIONAL);
>
> for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx;
> q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 21:27 ` Winkler, Tomas
@ 2009-02-11 21:33 ` Johannes Berg
2009-02-11 21:41 ` Winkler, Tomas
0 siblings, 1 reply; 21+ messages in thread
From: Johannes Berg @ 2009-02-11 21:33 UTC (permalink / raw)
To: Winkler, Tomas
Cc: Yu, Fenghua, David Woodhouse, Ingo Molnar, Stephen Rothwell,
Andrew Morton, Grumbach, Emmanuel, Zhu, Yi, Chris Wright, LKML,
iommu@lists.linux-foundation.org
[-- Attachment #1: Type: text/plain, Size: 759 bytes --]
On Wed, 2009-02-11 at 23:27 +0200, Winkler, Tomas wrote:
> >mapping with PCI_DMA_TODEVICE which is read only in mapping PTE. But iwlan
> >device
> >actually writes to the mapped page to update its contents. This issue is
> >not
> >exposed in swiotlb. But VT-d hardware can capture this fault and stop the
> >fault
> >transaction.
> >
> >The following patch fixes the issue.
> >
> >Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> Acked-by: Tomas Winkler <tomas.winkler@intel.com>
>
> Indeed the firmware/ucode write back to host memory to update retry
> counter for APMDU packets. I'm not sure if this is needed for legacy
> traffic, though.
I don't think they can be seeing AMPDU packets since that is, well,
broken?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 21:33 ` Johannes Berg
@ 2009-02-11 21:41 ` Winkler, Tomas
2009-02-11 21:47 ` Johannes Berg
0 siblings, 1 reply; 21+ messages in thread
From: Winkler, Tomas @ 2009-02-11 21:41 UTC (permalink / raw)
To: Johannes Berg
Cc: Yu, Fenghua, David Woodhouse, Ingo Molnar, Stephen Rothwell,
Andrew Morton, Grumbach, Emmanuel, Zhu, Yi, Chris Wright, LKML,
iommu@lists.linux-foundation.org
>-----Original Message-----
>From: Johannes Berg [mailto:johannes@sipsolutions.net]
>Sent: Wednesday, February 11, 2009 11:34 PM
>To: Winkler, Tomas
>Cc: Yu, Fenghua; David Woodhouse; Ingo Molnar; Stephen Rothwell; Andrew
>Morton; Grumbach, Emmanuel; Zhu, Yi; Chris Wright; LKML; iommu@lists.linux-
>foundation.org
>Subject: RE: [PATCH]iwlan dma mapping read and write changes
>
>On Wed, 2009-02-11 at 23:27 +0200, Winkler, Tomas wrote:
>
>> >mapping with PCI_DMA_TODEVICE which is read only in mapping PTE. But
>iwlan
>> >device
>> >actually writes to the mapped page to update its contents. This issue is
>> >not
>> >exposed in swiotlb. But VT-d hardware can capture this fault and stop
>the
>> >fault
>> >transaction.
>> >
>> >The following patch fixes the issue.
>> >
>> >Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
>> Acked-by: Tomas Winkler <tomas.winkler@intel.com>
>>
>> Indeed the firmware/ucode write back to host memory to update retry
>> counter for APMDU packets. I'm not sure if this is needed for legacy
>> traffic, though.
>
>I don't think they can be seeing AMPDU packets since that is, well,
>broken?
Currently I'm not aware of any other cases where memory is accessed back but I may have not complete info. Will be back with the answer tomorrow.
Tomas
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 21:41 ` Winkler, Tomas
@ 2009-02-11 21:47 ` Johannes Berg
2009-02-11 21:50 ` Johannes Berg
0 siblings, 1 reply; 21+ messages in thread
From: Johannes Berg @ 2009-02-11 21:47 UTC (permalink / raw)
To: Winkler, Tomas
Cc: Yu, Fenghua, David Woodhouse, Ingo Molnar, Stephen Rothwell,
Grumbach, Emmanuel, Zhu, Yi, Chris Wright, LKML,
iommu@lists.linux-foundation.org
[-- Attachment #1: Type: text/plain, Size: 750 bytes --]
> >> Indeed the firmware/ucode write back to host memory to update retry
> >> counter for APMDU packets. I'm not sure if this is needed for legacy
> >> traffic, though.
> >
> >I don't think they can be seeing AMPDU packets since that is, well,
> >broken?
>
> Currently I'm not aware of any other cases where memory is accessed
> back but I may have not complete info. Will be back with the answer
> tomorrow.
I don't think it really matters, since AMPDU packets will be fixed soon,
and for those you know it's necessary (and the report says that under
some other circumstances it's also necessary). Unless there'd be some
benefit from using BIDI only when we know it'll be needed, and using
TODEV in the other cases?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 21:47 ` Johannes Berg
@ 2009-02-11 21:50 ` Johannes Berg
2009-02-11 22:10 ` Winkler, Tomas
0 siblings, 1 reply; 21+ messages in thread
From: Johannes Berg @ 2009-02-11 21:50 UTC (permalink / raw)
To: Winkler, Tomas
Cc: Yu, Fenghua, David Woodhouse, Ingo Molnar, Stephen Rothwell,
Grumbach, Emmanuel, Zhu, Yi, Chris Wright, LKML,
iommu@lists.linux-foundation.org
[-- Attachment #1: Type: text/plain, Size: 870 bytes --]
On Wed, 2009-02-11 at 22:47 +0100, Johannes Berg wrote:
> > >> Indeed the firmware/ucode write back to host memory to update retry
> > >> counter for APMDU packets. I'm not sure if this is needed for legacy
> > >> traffic, though.
> > >
> > >I don't think they can be seeing AMPDU packets since that is, well,
> > >broken?
> >
> > Currently I'm not aware of any other cases where memory is accessed
> > back but I may have not complete info. Will be back with the answer
> > tomorrow.
>
> I don't think it really matters, since AMPDU packets will be fixed soon,
> and for those you know it's necessary (and the report says that under
> some other circumstances it's also necessary). Unless there'd be some
> benefit from using BIDI only when we know it'll be needed, and using
> TODEV in the other cases?
Or if there's a firmware bug.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 21:50 ` Johannes Berg
@ 2009-02-11 22:10 ` Winkler, Tomas
2009-02-11 22:13 ` Yu, Fenghua
2009-02-11 22:13 ` David Woodhouse
0 siblings, 2 replies; 21+ messages in thread
From: Winkler, Tomas @ 2009-02-11 22:10 UTC (permalink / raw)
To: Johannes Berg, Yu, Fenghua
Cc: Yu, Fenghua, David Woodhouse, Ingo Molnar, Stephen Rothwell,
Grumbach, Emmanuel, Zhu, Yi, Chris Wright, LKML,
iommu@lists.linux-foundation.org
>-----Original Message-----
>From: Johannes Berg [mailto:johannes@sipsolutions.net]
>Sent: Wednesday, February 11, 2009 11:50 PM
>To: Winkler, Tomas
>Cc: Yu, Fenghua; David Woodhouse; Ingo Molnar; Stephen Rothwell; Grumbach,
>Emmanuel; Zhu, Yi; Chris Wright; LKML; iommu@lists.linux-foundation.org
>Subject: RE: [PATCH]iwlan dma mapping read and write changes
>
>On Wed, 2009-02-11 at 22:47 +0100, Johannes Berg wrote:
>> > >> Indeed the firmware/ucode write back to host memory to update retry
>> > >> counter for APMDU packets. I'm not sure if this is needed for legacy
>> > >> traffic, though.
>> > >
>> > >I don't think they can be seeing AMPDU packets since that is, well,
>> > >broken?
>> >
>> > Currently I'm not aware of any other cases where memory is accessed
>> > back but I may have not complete info. Will be back with the answer
>> > tomorrow.
>>
>> I don't think it really matters, since AMPDU packets will be fixed soon,
>> and for those you know it's necessary (and the report says that under
>> some other circumstances it's also necessary). Unless there'd be some
>> benefit from using BIDI only when we know it'll be needed, and using
>> TODEV in the other cases?
>
>Or if there's a firmware bug.
That's why it's better to clear the picture.
Fenghua
What exact HW do you get this error?
Thanks
Tomas
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 22:10 ` Winkler, Tomas
@ 2009-02-11 22:13 ` Yu, Fenghua
2009-02-11 22:13 ` David Woodhouse
1 sibling, 0 replies; 21+ messages in thread
From: Yu, Fenghua @ 2009-02-11 22:13 UTC (permalink / raw)
To: Winkler, Tomas, Johannes Berg
Cc: David Woodhouse, Ingo Molnar, Stephen Rothwell,
Grumbach, Emmanuel, Zhu, Yi, Chris Wright, LKML,
iommu@lists.linux-foundation.org
>>> > >> Indeed the firmware/ucode write back to host memory to update retry
>>> > >> counter for APMDU packets. I'm not sure if this is needed for legacy
>>> > >> traffic, though.
>> > >
>> > >I don't think they can be seeing AMPDU packets since that is, well,
>> > >broken?
>> >
>> > Currently I'm not aware of any other cases where memory is accessed
>> > back but I may have not complete info. Will be back with the answer
>> > tomorrow.
>>
>> I don't think it really matters, since AMPDU packets will be fixed soon,
>> and for those you know it's necessary (and the report says that under
>> some other circumstances it's also necessary). Unless there'd be some
>> benefit from using BIDI only when we know it'll be needed, and using
>> TODEV in the other cases?
>
>Or if there's a firmware bug.
>That's why it's better to clear the picture.
>Fenghua
>What exact HW do you get this error?
This is Lenovo T400 wireless lan. Firmware version is 5.4.1.16. I think this issue happens on other platform/hw as well.
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 22:10 ` Winkler, Tomas
2009-02-11 22:13 ` Yu, Fenghua
@ 2009-02-11 22:13 ` David Woodhouse
2009-02-12 13:42 ` Winkler, Tomas
1 sibling, 1 reply; 21+ messages in thread
From: David Woodhouse @ 2009-02-11 22:13 UTC (permalink / raw)
To: Winkler, Tomas
Cc: Johannes Berg, Yu, Fenghua, Ingo Molnar, Stephen Rothwell,
Grumbach, Emmanuel, Zhu, Yi, Chris Wright, LKML,
iommu@lists.linux-foundation.org
On Thu, 2009-02-12 at 00:10 +0200, Winkler, Tomas wrote:
>
> >-----Original Message-----
> >From: Johannes Berg [mailto:johannes@sipsolutions.net]
> >Sent: Wednesday, February 11, 2009 11:50 PM
> >To: Winkler, Tomas
> >Cc: Yu, Fenghua; David Woodhouse; Ingo Molnar; Stephen Rothwell; Grumbach,
> >Emmanuel; Zhu, Yi; Chris Wright; LKML; iommu@lists.linux-foundation.org
> >Subject: RE: [PATCH]iwlan dma mapping read and write changes
> >
> >On Wed, 2009-02-11 at 22:47 +0100, Johannes Berg wrote:
> >> > >> Indeed the firmware/ucode write back to host memory to update retry
> >> > >> counter for APMDU packets. I'm not sure if this is needed for legacy
> >> > >> traffic, though.
> >> > >
> >> > >I don't think they can be seeing AMPDU packets since that is, well,
> >> > >broken?
> >> >
> >> > Currently I'm not aware of any other cases where memory is accessed
> >> > back but I may have not complete info. Will be back with the answer
> >> > tomorrow.
> >>
> >> I don't think it really matters, since AMPDU packets will be fixed soon,
> >> and for those you know it's necessary (and the report says that under
> >> some other circumstances it's also necessary). Unless there'd be some
> >> benefit from using BIDI only when we know it'll be needed, and using
> >> TODEV in the other cases?
> >
> >Or if there's a firmware bug.
>
> That's why it's better to clear the picture.
> Fenghua
> What exact HW do you get this error?
Lenovo T400.
00:00.0 0600: 8086:2a40 (rev 07)
00:02.0 0300: 8086:2a42 (rev 07)
00:02.1 0380: 8086:2a43 (rev 07)
00:03.0 0780: 8086:2a44 (rev 07)
00:03.2 0101: 8086:2a46 (rev 07)
00:03.3 0700: 8086:2a47 (rev 07)
00:19.0 0200: 8086:10f5 (rev 03)
00:1a.0 0c03: 8086:2937 (rev 03)
00:1a.1 0c03: 8086:2938 (rev 03)
00:1a.2 0c03: 8086:2939 (rev 03)
00:1a.7 0c03: 8086:293c (rev 03)
00:1b.0 0403: 8086:293e (rev 03)
00:1c.0 0604: 8086:2940 (rev 03)
00:1c.1 0604: 8086:2942 (rev 03)
00:1c.2 0604: 8086:2944 (rev 03)
00:1c.3 0604: 8086:2946 (rev 03)
00:1c.4 0604: 8086:2948 (rev 03)
00:1d.0 0c03: 8086:2934 (rev 03)
00:1d.1 0c03: 8086:2935 (rev 03)
00:1d.2 0c03: 8086:2936 (rev 03)
00:1d.7 0c03: 8086:293a (rev 03)
00:1e.0 0604: 8086:2448 (rev 93)
00:1f.0 0601: 8086:2917 (rev 03)
00:1f.2 0106: 8086:2929 (rev 03)
00:1f.3 0c05: 8086:2930 (rev 03)
03:00.0 0280: 8086:4236
04:00.0 0580: 8086:444e (rev 11)
15:00.0 0607: 1180:0476 (rev ba)
15:00.1 0c00: 1180:0832 (rev 04)
--
dwmw2
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH]iwlan dma mapping read and write changes
2009-02-11 22:13 ` David Woodhouse
@ 2009-02-12 13:42 ` Winkler, Tomas
0 siblings, 0 replies; 21+ messages in thread
From: Winkler, Tomas @ 2009-02-12 13:42 UTC (permalink / raw)
To: David Woodhouse
Cc: Johannes Berg, Yu, Fenghua, Ingo Molnar, Stephen Rothwell,
Grumbach, Emmanuel, Zhu, Yi, Chris Wright, LKML,
iommu@lists.linux-foundation.org
>-----Original Message-----
>From: David Woodhouse [mailto:dwmw2@infradead.org]
>Sent: Thursday, February 12, 2009 12:14 AM
>To: Winkler, Tomas
>Cc: Johannes Berg; Yu, Fenghua; Ingo Molnar; Stephen Rothwell; Grumbach,
>Emmanuel; Zhu, Yi; Chris Wright; LKML; iommu@lists.linux-foundation.org
>Subject: RE: [PATCH]iwlan dma mapping read and write changes
>
>On Thu, 2009-02-12 at 00:10 +0200, Winkler, Tomas wrote:
>>
>> >-----Original Message-----
>> >From: Johannes Berg [mailto:johannes@sipsolutions.net]
>> >Sent: Wednesday, February 11, 2009 11:50 PM
>> >To: Winkler, Tomas
>> >Cc: Yu, Fenghua; David Woodhouse; Ingo Molnar; Stephen Rothwell;
>Grumbach,
>> >Emmanuel; Zhu, Yi; Chris Wright; LKML; iommu@lists.linux-foundation.org
>> >Subject: RE: [PATCH]iwlan dma mapping read and write changes
>> >
>> >On Wed, 2009-02-11 at 22:47 +0100, Johannes Berg wrote:
>> >> > >> Indeed the firmware/ucode write back to host memory to update
>retry
>> >> > >> counter for APMDU packets. I'm not sure if this is needed for
>legacy
>> >> > >> traffic, though.
>> >> > >
>> >> > >I don't think they can be seeing AMPDU packets since that is, well,
>> >> > >broken?
>> >> >
>> >> > Currently I'm not aware of any other cases where memory is accessed
>> >> > back but I may have not complete info. Will be back with the answer
>> >> > tomorrow.
>> >>
>> >> I don't think it really matters, since AMPDU packets will be fixed
>soon,
>> >> and for those you know it's necessary (and the report says that under
>> >> some other circumstances it's also necessary). Unless there'd be some
>> >> benefit from using BIDI only when we know it'll be needed, and using
>> >> TODEV in the other cases?
>> >
>> >Or if there's a firmware bug.
>>
>> That's why it's better to clear the picture.
>> Fenghua
>> What exact HW do you get this error?
>
>Lenovo T400.
>
>03:00.0 0280: 8086:4236
>
I can confirm that for 5000 series the patch is required also for regular frames. In this particular machine the NIC is 5300. For 4965 only for AMPDU frames are affected also the implementation is not the same but I'm not sure if it makes any sense to differentiate.
Does anybody know what performance implications of this change are?
Thanks Tomas
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2009-02-12 13:43 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-01 16:56 [PATCH 0/2]Add Variable Page Size and IA64 Support in Intel IOMMU Fenghua Yu
2008-10-01 16:56 ` Fenghua Yu
2008-10-03 15:50 ` Bjorn Helgaas
2008-10-03 15:50 ` Bjorn Helgaas
2008-10-06 19:44 ` [PATCH 0/2]Add Variable Page Size and IA64 Support in Intel Yu, Fenghua
2008-10-06 19:44 ` [PATCH 0/2]Add Variable Page Size and IA64 Support in Intel IOMMU Yu, Fenghua
2008-10-07 0:01 ` [PATCH V2 0/2] Add " Fenghua Yu
2008-10-07 0:01 ` Fenghua Yu
2009-02-11 18:26 ` [PATCH]iwlan dma mapping read and write changes Fenghua Yu
2009-02-11 18:35 ` Bhavesh Davda
2009-02-11 19:29 ` Yu, Fenghua
2009-02-11 18:59 ` Chris Wright
2009-02-11 21:27 ` Winkler, Tomas
2009-02-11 21:33 ` Johannes Berg
2009-02-11 21:41 ` Winkler, Tomas
2009-02-11 21:47 ` Johannes Berg
2009-02-11 21:50 ` Johannes Berg
2009-02-11 22:10 ` Winkler, Tomas
2009-02-11 22:13 ` Yu, Fenghua
2009-02-11 22:13 ` David Woodhouse
2009-02-12 13:42 ` Winkler, Tomas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.