Subject: what are kernel vm limitations?
To: None <port-i386@NetBSD.ORG>
From: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
List: port-i386
Date: 03/01/1996 12:30:56
I'm trying to use a BIT3 PCI-VME adaptor on NetBSD-1.1/i386.
This card uses 3 memory windows, sizes are: 64k, 64k, 32M.
The driver tries to map them into kernel virtual memory - this is done
by pci_map_mem().
While mapping the pages of the third window, the system panics in
pmep_enter().
This is the console log:

pcivme0 at pci0 device 9: BIT3 PCI-VME 617 rev 72
pci_map_mem: mapping memory at virtual f9684000, physical fbfd0000
pci_map_mem: mapping memory at virtual f9694000, physical fbfc0000
pci_map_mem: mapping memory at virtual f96a4000, physical f8000000
panic: ptdi 1bf063

The triggering call to pmap_enter() is (from the backtrace):

pmap_enter(f81986c0,fb000000,f995c000,3,1)

I don't understand much of the vm system, but 2 things strike me:
- There seems to be a barrier at virtual 0xfb000000 which is not easy
   to decuce from the constants in param.h and vmparam.h.
- pmap_enter() calls kmem_alloc_pageable() to request the 32M virtual
   space before it tries to map anything. This call doesn't fail. Is there
   a different idea of free virtual mem in the mi and md parts? Or does an
   "allocation" not mean that the whole space is relly usable at one time?

Is there a chance to get the whole thing mapped by changing whatever
configuration constants?
How expensive would it be to do the actual page mappings at runtime?
What is the proper way to free the pages and/or the vm space?

best regards
Matthias Drochner