From: Joerg Roedel <joerg.roedel@amd.com>
To: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Cc: Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 4/8] x86/amd-iommu: Fix device table write order
Date: Fri, 4 Sep 2009 11:36:30 +0200 [thread overview]
Message-ID: <1252056994-31980-5-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1252056994-31980-1-git-send-email-joerg.roedel@amd.com>
The V bit of the device table entry has to be set after the
rest of the entry is written to not confuse the hardware.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
arch/x86/kernel/amd_iommu.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 7987f20..2b1e77c 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1087,9 +1087,9 @@ static void __attach_device(struct amd_iommu *iommu,
pte_root |= IOMMU_PTE_IR | IOMMU_PTE_IW | IOMMU_PTE_P | IOMMU_PTE_TV;
write_lock_irqsave(&amd_iommu_devtable_lock, flags);
- amd_iommu_dev_table[devid].data[0] = lower_32_bits(pte_root);
- amd_iommu_dev_table[devid].data[1] = upper_32_bits(pte_root);
amd_iommu_dev_table[devid].data[2] = domain->id;
+ amd_iommu_dev_table[devid].data[1] = upper_32_bits(pte_root);
+ amd_iommu_dev_table[devid].data[0] = lower_32_bits(pte_root);
amd_iommu_pd_table[devid] = domain;
write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
--
1.6.3.3
next prev parent reply other threads:[~2009-09-04 9:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-04 9:36 [PATCH 0/8] Passthrough support for AMD-IOMMU (AMD-Vi) Joerg Roedel
2009-09-04 9:36 ` [PATCH 1/8] x86/dma: Mark iommu_pass_through as __read_mostly Joerg Roedel
2009-09-04 9:36 ` [PATCH 2/8] x86/amd-iommu: Add core functions for pd allocation/freeing Joerg Roedel
2009-09-04 9:36 ` [PATCH 3/8] x86/amd-iommu: Add passthrough mode initialization functions Joerg Roedel
2009-09-04 9:36 ` Joerg Roedel [this message]
2009-09-04 9:36 ` [PATCH 5/8] x86/amd-iommu: Align locking between attach_device and detach_device Joerg Roedel
2009-09-04 9:36 ` [PATCH 6/8] x86/amd-iommu: Make sure a device is assigned in passthrough mode Joerg Roedel
2009-09-04 9:36 ` [PATCH 7/8] x86/amd-iommu: Don't detach device from pt domain on driver unbind Joerg Roedel
2009-09-04 9:36 ` [PATCH 8/8] x86/amd-iommu: Initialize passthrough mode when requested Joerg Roedel
2009-09-07 12:54 ` [PATCH 0/8] Passthrough support for AMD-IOMMU (AMD-Vi) David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1252056994-31980-5-git-send-email-joerg.roedel@amd.com \
--to=joerg.roedel@amd.com \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®