Hi, Let me guess - kernel is running a privileged code therefore you don't get it trapped by General Protection #GP exception as you would be when running in user ring. Anyway have you tried to experiment with other addresses ? I think you're referring to a logical address here since paging is involved.
Cheers On Thu, Dec 16, 2010 at 2:38 AM, Luis Useche <use...@gmail.com> wrote: > Hi Guys, > > This is not very related to OpenBSD but perhaps somebody can help me from > this list. > > I need to find what happen when an invalid physical address is accessed > from > the kernel for a small project I am doing. My guess is that it will trigger > some kind of exception trapped by the kernel. I tried this with amd64 > OpenBSD to check what was the behavior. The result is that the invalid > physical memory is "accessed" with no trap. This does not make much sense. > > Here is the code in the kernel: > > u = malloc(PAGE_SIZE,0,M_WAITOK); > *u = 27; > printf("U 0: %llx %llx > %d\n",(vaddr_t)u,vtophys((vaddr_t)u),*u); > pte = vtopte((vaddr_t)u); > printf("PTE: %llx\n",*pte); > *pte &= ~PG_FRAME; > *pte |= 0x0000000230000000UL; > pmap_update_pg((vaddr_t)u); > printf("U 1: %llx %llx > %d\n",(vaddr_t)u,vtophys((vaddr_t)u),*u); > > The result in the dmesg is: > > USECHE 0: ffff8000001f7000 00000000bf33f000 27 > PTE: bf33f163 > USECHE 1: ffff8000001f7000 0000000230000000 -1 > > Somebody has a clue on why this does not crash or what happen when the > invalid physical memory is accessed? > > Thanks in advance, > Luis.