diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-08 22:50:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-08 22:50:26 -0500 |
commit | 6f84b4dbe92e3ffb00f4d8cbe9a31b5be5ecd8ca (patch) | |
tree | 8b42bb624869aae84977b7990a7ef37d67959476 /arch | |
parent | 7f336bf1e59a0d49ffc178a5747ed7da25c6a6a3 (diff) | |
parent | 087052b02f42b50316c6e4d7f2d8dfba3de6fc2e (diff) |
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: fix default_spin_lock_flags() prototype
AMD IOMMU: __unmap_single: check for bad_dma_address instead of 0
AMD IOMMU: fix WARN_ON in dma_ops unmap path
AMD IOMMU: fix typo in comment
AMD IOMMU: fix loop counter in free_pagetable function
AMD IOMMU: fix iommu_map_page function
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 13 | ||||
-rw-r--r-- | arch/x86/kernel/paravirt-spinlocks.c | 3 |
2 files changed, 9 insertions, 7 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 5662e226b0c9..a7b6dec6fc3f 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -344,7 +344,7 @@ static int iommu_map(struct protection_domain *dom, | |||
344 | u64 __pte, *pte, *page; | 344 | u64 __pte, *pte, *page; |
345 | 345 | ||
346 | bus_addr = PAGE_ALIGN(bus_addr); | 346 | bus_addr = PAGE_ALIGN(bus_addr); |
347 | phys_addr = PAGE_ALIGN(bus_addr); | 347 | phys_addr = PAGE_ALIGN(phys_addr); |
348 | 348 | ||
349 | /* only support 512GB address spaces for now */ | 349 | /* only support 512GB address spaces for now */ |
350 | if (bus_addr > IOMMU_MAP_SIZE_L3 || !(prot & IOMMU_PROT_MASK)) | 350 | if (bus_addr > IOMMU_MAP_SIZE_L3 || !(prot & IOMMU_PROT_MASK)) |
@@ -600,7 +600,7 @@ static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom) | |||
600 | continue; | 600 | continue; |
601 | 601 | ||
602 | p2 = IOMMU_PTE_PAGE(p1[i]); | 602 | p2 = IOMMU_PTE_PAGE(p1[i]); |
603 | for (j = 0; j < 512; ++i) { | 603 | for (j = 0; j < 512; ++j) { |
604 | if (!IOMMU_PTE_PRESENT(p2[j])) | 604 | if (!IOMMU_PTE_PRESENT(p2[j])) |
605 | continue; | 605 | continue; |
606 | p3 = IOMMU_PTE_PAGE(p2[j]); | 606 | p3 = IOMMU_PTE_PAGE(p2[j]); |
@@ -910,7 +910,7 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu, | |||
910 | if (address >= dom->aperture_size) | 910 | if (address >= dom->aperture_size) |
911 | return; | 911 | return; |
912 | 912 | ||
913 | WARN_ON(address & 0xfffULL || address > dom->aperture_size); | 913 | WARN_ON(address & ~PAGE_MASK || address >= dom->aperture_size); |
914 | 914 | ||
915 | pte = dom->pte_pages[IOMMU_PTE_L1_INDEX(address)]; | 915 | pte = dom->pte_pages[IOMMU_PTE_L1_INDEX(address)]; |
916 | pte += IOMMU_PTE_L0_INDEX(address); | 916 | pte += IOMMU_PTE_L0_INDEX(address); |
@@ -922,8 +922,8 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu, | |||
922 | 922 | ||
923 | /* | 923 | /* |
924 | * This function contains common code for mapping of a physically | 924 | * This function contains common code for mapping of a physically |
925 | * contiguous memory region into DMA address space. It is uses by all | 925 | * contiguous memory region into DMA address space. It is used by all |
926 | * mapping functions provided by this IOMMU driver. | 926 | * mapping functions provided with this IOMMU driver. |
927 | * Must be called with the domain lock held. | 927 | * Must be called with the domain lock held. |
928 | */ | 928 | */ |
929 | static dma_addr_t __map_single(struct device *dev, | 929 | static dma_addr_t __map_single(struct device *dev, |
@@ -983,7 +983,8 @@ static void __unmap_single(struct amd_iommu *iommu, | |||
983 | dma_addr_t i, start; | 983 | dma_addr_t i, start; |
984 | unsigned int pages; | 984 | unsigned int pages; |
985 | 985 | ||
986 | if ((dma_addr == 0) || (dma_addr + size > dma_dom->aperture_size)) | 986 | if ((dma_addr == bad_dma_address) || |
987 | (dma_addr + size > dma_dom->aperture_size)) | ||
987 | return; | 988 | return; |
988 | 989 | ||
989 | pages = iommu_num_pages(dma_addr, size, PAGE_SIZE); | 990 | pages = iommu_num_pages(dma_addr, size, PAGE_SIZE); |
diff --git a/arch/x86/kernel/paravirt-spinlocks.c b/arch/x86/kernel/paravirt-spinlocks.c index 0e9f1982b1dd..95777b0faa73 100644 --- a/arch/x86/kernel/paravirt-spinlocks.c +++ b/arch/x86/kernel/paravirt-spinlocks.c | |||
@@ -7,7 +7,8 @@ | |||
7 | 7 | ||
8 | #include <asm/paravirt.h> | 8 | #include <asm/paravirt.h> |
9 | 9 | ||
10 | static void default_spin_lock_flags(struct raw_spinlock *lock, unsigned long flags) | 10 | static inline void |
11 | default_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) | ||
11 | { | 12 | { |
12 | __raw_spin_lock(lock); | 13 | __raw_spin_lock(lock); |
13 | } | 14 | } |