Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29558
b: refs/heads/master
c: c2a5a46
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller authored and David S. Miller committed Jun 24, 2006
1 parent 43161f8 commit 77ce30f
Show file tree
Hide file tree
Showing 4 changed files with 40 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: 486ad10a7e1b2bb61ea9e48c4d9510f50cd74fc5
refs/heads/master: c2a5a46be4a1c682e18e29e67785126b7610b14d
15 changes: 10 additions & 5 deletions trunk/arch/sparc64/kernel/pci_sun4v.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,13 @@ static unsigned long probe_existing_entries(struct pci_pbm_info *pbm,
HV_PCI_TSBID(0, i),
&io_attrs, &ra);
if (ret == HV_EOK) {
cnt++;
__set_bit(i, arena->map);
if (page_in_phys_avail(ra)) {
pci_sun4v_iommu_demap(devhandle,
HV_PCI_TSBID(0, i), 1);
} else {
cnt++;
__set_bit(i, arena->map);
}
}
}

Expand Down Expand Up @@ -1062,9 +1067,9 @@ static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
iommu->arena.limit = num_tsb_entries;

sz = probe_existing_entries(pbm, iommu);

printk("%s: TSB entries [%lu], existing mapings [%lu]\n",
pbm->name, num_tsb_entries, sz);
if (sz)
printk("%s: Imported %lu TSB entries from OBP\n",
pbm->name, sz);
}

static void pci_sun4v_get_bus_range(struct pci_pbm_info *pbm)
Expand Down
28 changes: 27 additions & 1 deletion trunk/arch/sparc64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ static void __init taint_real_pages(void)
while (old_start < old_end) {
int n;

for (n = 0; pavail_rescan_ents; n++) {
for (n = 0; n < pavail_rescan_ents; n++) {
unsigned long new_start, new_end;

new_start = pavail_rescan[n].phys_addr;
Expand All @@ -1418,6 +1418,32 @@ static void __init taint_real_pages(void)
}
}

int __init page_in_phys_avail(unsigned long paddr)
{
int i;

paddr &= PAGE_MASK;

for (i = 0; i < pavail_rescan_ents; i++) {
unsigned long start, end;

start = pavail_rescan[i].phys_addr;
end = start + pavail_rescan[i].reg_size;

if (paddr >= start && paddr < end)
return 1;
}
if (paddr >= kern_base && paddr < (kern_base + kern_size))
return 1;
#ifdef CONFIG_BLK_DEV_INITRD
if (paddr >= __pa(initrd_start) &&
paddr < __pa(PAGE_ALIGN(initrd_end)))
return 1;
#endif

return 0;
}

void __init mem_init(void)
{
unsigned long codepages, datapages, initpages;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-sparc64/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,8 @@ extern unsigned long *sparc64_valid_addr_bitmap;
#define kern_addr_valid(addr) \
(test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap))

extern int page_in_phys_avail(unsigned long paddr);

extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
unsigned long pfn,
unsigned long size, pgprot_t prot);
Expand Down

0 comments on commit 77ce30f

Please sign in to comment.