Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144852
b: refs/heads/master
c: 7b5ca22
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed May 11, 2009
1 parent 3d7b6a4 commit 0d4c4f8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 124a6eece386226191ec79e279a5471bd2614f81
refs/heads/master: 7b5ca22643beba8fdd5b7055e0594a514b3710d7
13 changes: 9 additions & 4 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
#define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32))
#define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64))

#ifndef PHYSICAL_PAGE_MASK
#define PHYSICAL_PAGE_MASK PAGE_MASK
#endif

/* global iommu list, set NULL for ignored DMAR units */
static struct intel_iommu **g_iommus;

Expand Down Expand Up @@ -1216,7 +1220,7 @@ static void dmar_init_reserved_ranges(void)
if (!r->flags || !(r->flags & IORESOURCE_MEM))
continue;
addr = r->start;
addr &= PAGE_MASK;
addr &= PHYSICAL_PAGE_MASK;
size = r->end - addr;
size = PAGE_ALIGN(size);
iova = reserve_iova(&reserved_iova_list, IOVA_PFN(addr),
Expand Down Expand Up @@ -2173,7 +2177,8 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
* is not a big problem
*/
ret = domain_page_mapping(domain, start_paddr,
((u64)paddr) & PAGE_MASK, size, prot);
((u64)paddr) & PHYSICAL_PAGE_MASK,
size, prot);
if (ret)
goto error;

Expand Down Expand Up @@ -2463,8 +2468,8 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
addr = page_to_phys(sg_page(sg)) + sg->offset;
size = aligned_size((u64)addr, sg->length);
ret = domain_page_mapping(domain, start_addr + offset,
((u64)addr) & PAGE_MASK,
size, prot);
((u64)addr) & PHYSICAL_PAGE_MASK,
size, prot);
if (ret) {
/* clear the page */
dma_pte_clear_range(domain, start_addr,
Expand Down
6 changes: 4 additions & 2 deletions trunk/fs/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd)
{
if (unlikely(newfd == oldfd)) { /* corner case */
struct files_struct *files = current->files;
int retval = oldfd;

rcu_read_lock();
if (!fcheck_files(files, oldfd))
oldfd = -EBADF;
retval = -EBADF;
rcu_read_unlock();
return oldfd;
return retval;
}
return sys_dup3(oldfd, newfd, 0);
}
Expand Down

0 comments on commit 0d4c4f8

Please sign in to comment.