summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAriane van der Steldt <ariane@cvs.openbsd.org>2011-05-18 23:36:32 +0000
committerAriane van der Steldt <ariane@cvs.openbsd.org>2011-05-18 23:36:32 +0000
commitc12cdf0eef70475987751dde34220e8c134e6b30 (patch)
tree959ded77a7e815dd15bd84cb8330415de981e68a /sys
parent17269a30740554e56d247219ff107e7e858c5314 (diff)
When the sparc64 iommu fails to lookup a vaddr, it prints a message and
returns EFBIG. This cannot be recovered from and is usually indicative of a damaged pmap. Therefor, panic right here instead. This diff meant the difference between dropping into single-user mode versus getting a traceable panic. ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/dev/iommu.c16
-rw-r--r--sys/arch/sparc64/dev/viommu.c16
2 files changed, 10 insertions, 22 deletions
diff --git a/sys/arch/sparc64/dev/iommu.c b/sys/arch/sparc64/dev/iommu.c
index 52837d17d0b..2b9de41917e 100644
--- a/sys/arch/sparc64/dev/iommu.c
+++ b/sys/arch/sparc64/dev/iommu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iommu.c,v 1.63 2011/04/07 15:30:16 miod Exp $ */
+/* $OpenBSD: iommu.c,v 1.64 2011/05/18 23:36:31 ariane Exp $ */
/* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */
/*
@@ -713,11 +713,8 @@ iommu_dvmamap_load(bus_dma_tag_t t, bus_dma_tag_t t0, bus_dmamap_t map,
for (a = trunc_page(addr); a < aend; a += PAGE_SIZE) {
paddr_t pa;
- if (pmap_extract(pmap, a, &pa) == FALSE) {
- printf("iomap pmap error addr 0x%llx\n", a);
- iommu_iomap_clear_pages(ims);
- return (EFBIG);
- }
+ if (pmap_extract(pmap, a, &pa) == FALSE)
+ panic("iomap pmap error addr 0x%llx\n", a);
err = iommu_iomap_insert_page(ims, pa);
if (err) {
@@ -791,11 +788,8 @@ iommu_dvmamap_load(bus_dma_tag_t t, bus_dma_tag_t t0, bus_dmamap_t map,
int pglen;
/* Yuck... Redoing the same pmap_extract... */
- if (pmap_extract(pmap, a, &pa) == FALSE) {
- printf("iomap pmap error addr 0x%llx\n", a);
- err = EFBIG;
- break;
- }
+ if (pmap_extract(pmap, a, &pa) == FALSE)
+ panic("iomap pmap error addr 0x%llx\n", a);
pgstart = pa | (MAX(a, addr) & PAGE_MASK);
pgend = pa | (MIN(a + PAGE_SIZE - 1,
diff --git a/sys/arch/sparc64/dev/viommu.c b/sys/arch/sparc64/dev/viommu.c
index 41d5260931e..9c14a566480 100644
--- a/sys/arch/sparc64/dev/viommu.c
+++ b/sys/arch/sparc64/dev/viommu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: viommu.c,v 1.11 2011/04/07 15:30:16 miod Exp $ */
+/* $OpenBSD: viommu.c,v 1.12 2011/05/18 23:36:31 ariane Exp $ */
/* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */
/*
@@ -327,11 +327,8 @@ viommu_dvmamap_load(bus_dma_tag_t t, bus_dma_tag_t t0, bus_dmamap_t map,
for (a = trunc_page(addr); a < aend; a += PAGE_SIZE) {
paddr_t pa;
- if (pmap_extract(pmap, a, &pa) == FALSE) {
- printf("iomap pmap error addr 0x%llx\n", a);
- iommu_iomap_clear_pages(ims);
- return (EFBIG);
- }
+ if (pmap_extract(pmap, a, &pa) == FALSE)
+ panic("iomap pmap error addr 0x%llx\n", a);
err = iommu_iomap_insert_page(ims, pa);
if (err) {
@@ -400,11 +397,8 @@ viommu_dvmamap_load(bus_dma_tag_t t, bus_dma_tag_t t0, bus_dmamap_t map,
int pglen;
/* Yuck... Redoing the same pmap_extract... */
- if (pmap_extract(pmap, a, &pa) == FALSE) {
- printf("iomap pmap error addr 0x%llx\n", a);
- err = EFBIG;
- break;
- }
+ if (pmap_extract(pmap, a, &pa) == FALSE)
+ panic("iomap pmap error addr 0x%llx\n", a);
pgstart = pa | (MAX(a, addr) & PAGE_MASK);
pgend = pa | (MIN(a + PAGE_SIZE - 1,