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.