Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/arch/aarch64/aarch64




>> Module Name:	src
>> Committed By:	ryo
>> Date:		Mon Sep 17 00:15:55 UTC 2018
>> 
>> Modified Files:
>> 	src/sys/arch/aarch64/aarch64: pmap.c
>> 
>> Log Message:
>> delete debug printf and KASSERT.
>
>i'm confused by this (moved) comment:
>
>/* pte is readable and writable, but occured fault? probably copy(9) */
>
>this sounds sound wrong.  under what conditions will it happen?
>copy(9)'s faults is about handling the userspace not being mapped
>at all, not getting faults while r/w.
>
>is there a stack trace related to the case?

kcopy(9) faults even in unplivedged access.

for test:

        /* pte is readable and writable, but occured fault? probably copy(9) */
-       if ((pte & LX_BLKPAG_AF) && ((pte & LX_BLKPAG_AP) == LX_BLKPAG_AP_RW))
+       if ((pte & LX_BLKPAG_AF) && ((pte & LX_BLKPAG_AP) == LX_BLKPAG_AP_RW)) {
+               cpu_Debugger();
                goto done;
+       }
 

# cat hello.c 
#include <sys/socket.h>
int main()
{
 sendmsg(0, (const void *)0xffffffc004200000, 0); /* Any kernel address (RW L3 page) */
}


# cc hello.c 
# ./a.out 
Stopped in pid 412.1 (a.out) at netbsd:cpu_Debugger+0x4:        ret
db{5}> bt
trace tf 0xffffffc0009fa180
---- trapframe 0xffffffc0009fa180 (304 bytes) ----
    pc=ffffffc00004f840,   spsr=0000000060000005
   esr=00000000f2000000,    far=ffffffc004200000
    x0=ffff0000098610a8,     x1=0000000000000400
    x2=0000000000000001,     x3=0000000000000007
    x4=00000000000f5eeb,     x5=00000000000ec07a
    x6=00000000000f5a1d,     x7=0000000000000002
    x8=ffffffc000a10490,     x9=0000000000000050
   x10=000000000000000c,    x11=000000000000003f
   x12=000003d11bf48f40,    x13=000003d11bf48f41
   x14=0000000000000040,    x15=0000f446fd23c060
   x16=0000000200110cf8,    x17=0000f446fd130d5c
   x18=0000fffff6440848,    x19=ffffffc004200000
   x20=ffffffc0009fa7c0,    x21=ffffffc0009fa7c0
   x22=ffff0000f5a1c000,    x23=0000000000000001
   x24=03e00000f5a1df03,    x25=0000000000000000
   x26=0000000000000000,    x27=000000000000000f
   x28=0000000000000025, fp=x29=ffffffc0a3e47b50
lr=x30=ffffffc0000556d4,     sp=ffffffc0a3e47b50
------------------------------------------------
fp ffffffc0a3e47b50 cpu_Debugger() at ffffffc00004f83c netbsd:cpu_Debugger
fp ffffffc0a3e47b90 data_abort_handler() at ffffffc000051e64 netbsd:data_abort_handler+0xfc
tf ffffffc0a3e47c00 el1_trap() at ffffffc00004f730 netbsd:el1_trap
---- trapframe 0xffffffc0a3e47c00 (304 bytes) ----
    pc=ffffffc00004e964,   spsr=0000000080000005
   esr=000000009600000f,    far=ffffffc004200000
    x0=ffffffc004200000,     x1=ffffffc0a3e47df0
    x2=0000000000000030,     x3=ffffffc0003ec250
    x4=0000000000000001,     x5=0000000000000000
    x6=0000ffffffb36f88,     x7=0000000000000000
    x8=0000000000000000,     x9=0000000000001003
   x10=000000000000000c,    x11=000000000000003f
   x12=000003d11bf48f40,    x13=000003d11bf48f41
   x14=0000000000000040,    x15=0000f446fd23c060
   x16=0000000200110cf8,    x17=0000f446fd130d5c
   x18=0000fffff6440848,    x19=ffffffc004200000
   x20=ffffffc0a3e47df0,    x21=ffffffc0a3e47e70
   x22=ffffffc003e85480,    x23=000000005600001c
   x24=ffffffc0a3e47ed0,    x25=ffffffc0a3e47e70
   x26=0000000000000000,    x27=0000000000000000
   x28=0000000000000000, fp=x29=ffffffc0a3e47db0
lr=x30=ffffffc00004e8dc,     sp=ffffffc0a3e47d30
------------------------------------------------
fp ffffffc0a3e47db0 copyin() at ffffffc00004e964 netbsd:copyin+0xac
fp ffffffc0a3e47dc0 sys_sendmsg() at ffffffc0003ec278 netbsd:sys_sendmsg+0x28
fp ffffffc0a3e47e20 syscall() at ffffffc000050ffc netbsd:syscall+0x174
tf ffffffc0a3e47ed0 el0_trap() at ffffffc00004f794 netbsd:el0_trap
---- trapframe 0xffffffc0a3e47ed0 (304 bytes) ----
    pc=0000f446fd130d60,   spsr=0000000080000000
   esr=000000005600001c,    far=0000f446fd195c20
    x0=0000000000000000,     x1=ffffffc004200000
    x2=0000000000000000,     x3=0000000000000001
    x4=0000f446fd225000,     x5=0000ffffffb374e8
    x6=0000ffffffb36f88,     x7=0000000000000000
    x8=0000000000000000,     x9=0000000000001003
   x10=000000000000000c,    x11=000000000000003f
   x12=000003d11bf48f40,    x13=000003d11bf48f41
   x14=0000000000000040,    x15=0000f446fd23c060
   x16=0000000200110cf8,    x17=0000f446fd130d5c
   x18=0000fffff6440848,    x19=0000000000000001
   x20=0000000000000001,    x21=0000ffffffb37fe0
   x22=0000000200110da8,    x23=0000000200110b28
   x24=0000ffffffb37fe0,    x25=0000fffff6420000
   x26=0000000000000000,    x27=0000000000000000
   x28=0000000000000000, fp=x29=0000ffffffb36f30
lr=x30=0000000200100944,     sp=0000ffffffb36f30
------------------------------------------------
db{5}>


-- 
ryo shimizu


Home | Main Index | Thread Index | Old Index