Commit Graph

314 Commits

Author SHA1 Message Date
lnlan 2e3bbf1e61 修复ppoll接口"[ERR]OsMemFree check error!"报错
【背景】
1.内核中释放用户空间指针报错:"[ERR]OsMemFree check error!"
2.现有ppoll实现存在问题
3.相关用例需要整理
【修改方案】
1.去掉释放用户空间指针操作
2.更正逻辑错误
3.更正掩码设置与恢复不起作用
4.修复补充现有用例
【影响】
对现有的产品编译不会有影响。

re #I47YWZ

Change-Id: Ib2f60986e9cafb2ea5ef1097ab8552cbb1ede5b4
Signed-off-by: lnlan <lanleinan@163.com>
2021-11-02 07:04:35 +00:00
pef 78a297fd4e 修复ppoll接口"[ERR]OsMemFree check error!"报错
【背景】
内核中释放用户空间指针报错:"[ERR]OsMemFree check error!"

【修改方案】
修改SysPpoll函数。

【影响】
对现有的产品编译不会有影响。

re #I47YWZ

Change-Id: Id7f86036870d4f32be8fc438b9aad85cdda59546
Signed-off-by: pef <cyd1997@126.com>
2021-10-29 08:14:20 +00:00
teamol a55f68f957 fix: fix ppoll
1.modifications:
modified:   syscall/fs_syscall.c
2.modify 2 testcases:
IO/full/IO_test_ppoll_001.cpp
IO/full/IO_test_ppoll_002.cpp
3.influence:
none

Signed-off-by: pef <cyd1997@126.com>
Change-Id: I85fc091098a6dfef1a4694a3bbc489640ee6dda2
2021-10-28 11:54:19 +00:00
openharmony_ci 2f6cd46372 !664 feat: 支持LOS_TaskJoin 和 LOS_TaskDetach
Merge pull request !664 from zhushengle/Join
2021-10-28 08:01:08 +00:00
openharmony_ci ea45982e1f !669 feat: 进程rlimit修改为动态分配,减少静态内存占用
Merge pull request !669 from zhushengle/rlimit
2021-10-28 02:35:27 +00:00
openharmony_ci 91c1737d1b !670 当hilog/hievent驱动缓存出问题时,进行恢复处理
Merge pull request !670 from shenchenkai/master
2021-10-28 02:03:03 +00:00
openharmony_ci 7676cdb886 !656 修复PR520的修改缺陷
Merge pull request !656 from lnlan/sigwait_patch
2021-10-26 01:39:06 +00:00
shenchenkai c121d0eea3 Description:[fix] clean hilog/hievent ring buffer after memory verification failed
Change-Id: I9310fe807ec95721be78deb60ed9728ef9b56e48
Signed-off-by: shenchenkai <shenchenkai@huawei.com>
2021-10-22 17:00:10 +08:00
zhushengle cf8446c941 feat: 进程rlimit修改为动态分配,减少静态内存占用
Close #I4EZY5

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I47ed0ff7a52f72e38875c3308b20e183cc5c4563
2021-10-22 11:55:52 +08:00
zhushengle 37bc11fa88 feat: 支持LOS_TaskJoin 和 LOS_TaskDetach
Close #I4EENF
Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: Iaa1582f567eb3524262bea383e0b8238b89b5fe2
2021-10-19 14:26:10 +08:00
openharmony_ci 0507b9e8ea !654 内核ERR打印,无进程和线程信息,不方便问题定位
Merge pull request !654 from zhangfanfan2/master
2021-10-18 03:03:28 +00:00
openharmony_ci acd631c731 !657 【fix】los_trace.h注释修正
Merge pull request !657 from Zhaotianyu/1012trace_fix
2021-10-15 07:42:21 +00:00
openharmony_ci bda00e6747 !655 TCB中使用的execFile字段改为execVnode
Merge pull request !655 from LeonChan/execfile
2021-10-15 01:45:58 +00:00
zff cb423f8454 fix: 内核ERR打印,无进程和线程信息,不方便问题定位。
close: #I4DAKM

Signed-off-by: zff <zhangfanfan2@huawei.com>
Change-Id: I5acc8b2b632633b0717eb4186773e6cae35ea0e4
2021-10-14 19:03:11 +08:00
openharmony_ci d3b618887a !660 fix: 优化trace buffer初始化,删除swtmr 桩中的无效参数
Merge pull request !660 from LiteOS/master
2021-10-14 02:41:05 +00:00
LiteOS2021 b551270ef5 fix: 优化trace buffer初始化,删除swtmr 桩中的无效参数
close #I4DQ1X
Signed-off-by: LiteOS2021 <dinglu@huawei.com>

Change-Id: I79b416720f5327749a5884a65a5e61db07f2a17c
2021-10-14 09:47:11 +08:00
openharmony_ci 8096d9f575 !651 fix: 修复硬随机不可用时,地址随机化不可用问题
Merge pull request !651 from Harylee/shm
2021-10-12 03:25:40 +00:00
arvinzzz 6d249618ae fix: los_trace.h接口注释错误修正
1. LOS_TraceStop接口的功能描述应该是stop

close: #I4CYPZ

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: Iee0cf43f6e5ee8e544e233c0c307725c5bfebdcf
2021-10-12 10:30:30 +08:00
lnlan 40338918d9 fix: 修复PR520缺陷
【背景】
https://gitee.com/openharmony/kernel_liteos_a/pulls/520
上面修改,信号处理时才会释放申请的内存,当信号被屏蔽,且一直发送该信号时,
内存占用会不断变大
【修改方案】
1.
信号发送时已经有该信号的siginfo在链表中时,不再重新申请,重复使用之前的siginfo.

【影响】
对现有的产品编译不会有影响。

re#I4DEG5

Signed-off-by: lanleinan <lanleinan@163.com>

Change-Id: I74b3b7ff0b9efb0179313af9a0c8d1e12d1db5bb
2021-10-11 12:37:58 +00:00
openharmony_ci fd4b97e3f8 !650 通过g_uart_fputc_en关闭打印后,shell进程不能正常启动
Merge pull request !650 from zhangfanfan2/master
2021-10-11 07:46:26 +00:00
openharmony_ci 13e1e70358 !652 OsFutexWaitParamCheck函数中absTime为0时,直接返回,不需要打印
Merge pull request !652 from zhangfanfan2/other
2021-10-11 07:45:35 +00:00
openharmony_ci c360a97bab !631 fix: 进程在退出前回收vmspace中的所有Region
Merge pull request !631 from zhushengle/process
2021-10-11 03:55:22 +00:00
Haryslee 665c152c27 fix: 修复硬随机不可用时,地址随机化不可用问题
方案:硬随机不可用时,默认使用软随机数代替硬随机数

close #I4D4TK

Signed-off-by: Haryslee <lihao189@huawei.com>
Change-Id: Ia7d2a9583257d7b8041b8994a70a7c36149c33fb
2021-10-11 10:00:08 +08:00
zhangfanfan2 3f71be7535 fix: OsFutexWaitParamCheck函数中absTime为0时,直接返回,不需要打印
当设置的超时时间比较短时,会出现absTime为0的情况,直接返回,不需要阻塞和打印。

close: #I4D67E

Signed-off-by: zff <zhangfanfan2@huawei.com>
2021-10-10 08:49:56 +00:00
zhushengle 298ccea3fe fix: 进程退出前自己回收vmspace中的所有region
背景:
父进程fork一个子进程,调用waitpid等待子进程结束。
子进程dlopen一个文件a.so,并退出。当守护进程正在
1核回收子进程资源时,父进程在0核运行从waitpid返
回后,同时remove a.so概率失败。

Close #I4CKQC

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: Ie7940e7c931ced10ee357cf9aa7c64355effed49
2021-10-09 12:14:45 +08:00
openharmony_ci 56a92f9207 !641 feat: 支持AT_RANDOM以增强用户态栈保护能力
Merge pull request !641 from Harylee/shm
2021-10-08 06:01:21 +00:00
zff d21b05c0f6 fix: 通过g_uart_fputc_en关闭打印后,shell进程不能正常启动
console层的实现中复用g_uart_fputc_en用于关闭打印的功能,代码设计上认为
g_uart_fputc_en为0时console层未使能,导致shell进程中ioctl操作失败,shell
进程不能正常启动。

close: #I4CTY2

Signed-off-by: zff <zhangfanfan2@huawei.com>
Change-Id: I0a225c1db42f2b384ad590ca05b048c4b61db99c
2021-10-08 10:01:31 +08:00
Leon Chan e4a06623ce fix: change the execFile field in TCB to execVnode
TEE需要借用TCB中的execFile来校验打开的文件,pagecache修改后,可执行程序在mmap之后,会被立即关闭,因此将execFile改为execVnode

close: #I4CLL9

Signed-off-by: Leon Chan <chenwei26@huawei.com>
2021-09-30 14:33:36 +08:00
Haryslee 06ea03715f feat: 支持AT_RANDOM以增强用户态栈保护能力
背景:不开地址随机化时,用户态栈CANARY值是固定值
方案:支持AT_RANDOM,CANARY从AT_RANDOM获取随机值以增强用户态栈保护能力

close #I4CB8M

Signed-off-by: Haryslee <lihao189@huawei.com>
Change-Id: I28cef09f7016a5096e2096d4f6aa72722fcf1fd7
2021-09-30 10:36:12 +08:00
zhushengle 48ca854bf0 fix: 临终遗言重定向内容缺失task相关信息,对应的shell命令中申请的内存需要cacheline对齐
1.内核打印的地方支持异常时重定向打印信息
2.excinfo 命令中申请的内存64对齐
Close #I482S5

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I4e8a971cc5b14f62d573bb160682089d9d50e64e
2021-09-29 16:26:31 +08:00
openharmony_ci 2c33cfce86 !599 feat: L0~L1 支持Perf
Merge pull request !599 from LiteOS/perf
2021-09-29 06:15:02 +00:00
openharmony_ci ee72b21aff !640 中断中调用PRINTK概率卡死,导致系统不能正常响应中断
Merge pull request !640 from zhangfanfan2/master
2021-09-29 02:48:49 +00:00
LiteOS2021 6e0a3f10bb feat: L0-L1 支持Perf
1.【需求描述】:
         L0-L1 支持Perf,提供2种模式的配置, 及3大类型的事件配置:
         2种模式:计数模式(仅统计事件发生次数)、采样模式(收集上下文如任务ID、pc、backtrace等)。
         3种事件类型:CPU硬件事件(cycle、branch、icache、dcache等)、OS软件事件(task switch、mux pend、irq等)、高精度周期事件(cpu          clock)。
    2.【方案描述】:
         L0:
         基于事件采样原理,以性能事件为基础,当事件发生时,相应的事件计数器溢出发生中断,在中断处理函数中记录事件信息,包括当前的pc、当前运         行的任务ID以及调用栈等信息。
         L1:
         新增perf字符设备,位于“dev/perf”,通过对设备节点的read\ioctl,实现用户态perf

    BREAKING CHANGE:
    1.新增一系列perf的对外API,位于los_perf.h中.
    LOS_PerfInit配置采样数据缓冲区
    LOS_PerfStart开启Perf采样
    LOS_PerfStop停止Perf采样
    LOS_PerfConfig配置Perf采样事件
    LOS_PerfDataRead读取采样数据
    LOS_PerfNotifyHookReg 注册采样数据缓冲区的钩子函数
    LOS_PerfFlushHookReg 注册缓冲区刷cache的钩子

    2. 用户态新增perf命令
  【Usage】:
./perf [start] /[start id] Start perf.
./perf [stop] Stop perf.
./perf [read nBytes] Read nBytes raw data from perf buffer and print out.
./perf [list] List events to be used in -e.
./perf [stat] or [record] <option> <command>
         -e, event selector. use './perf list' to list available events.
         -p, event period.
         -o, perf data output filename.
         -t, taskId filter(whiltelist), if not set perf will sample all tasks.
         -s, type of data to sample defined in PerfSampleType los_perf.h.
         -P, processId filter(whiltelist), if not set perf will sample all processes.
         -d, whether to prescaler (once every 64 counts), which only take effect on cpu cycle hardware event.

    Close #I47I9A

Signed-off-by: LiteOS2021 <dinglu@huawei.com>
Change-Id: Ieb9b7483c85d1495df7c55bc0027f4309dff9814
2021-09-28 19:28:34 +08:00
openharmony_ci e1b85a4570 !636 修正函数声明与定义不一致的问题
Merge pull request !636 from Caoruihong/fix_decl
2021-09-28 07:18:18 +00:00
zff 9726ba11a7 fix: 中断中调用PRINTK概率卡死,导致系统不能正常响应中断
当console层的打印缓冲buffer满且打印任务被饿死时,函数ConsoleOutput会出现在for循环中
不退出的情况,导致中断打印时卡死

close: #I4C9GC

Signed-off-by: zff <zhangfanfan2@huawei.com>
Change-Id: I70b9d7c848dce7d351c5679e7b08049df27a6f10
2021-09-28 15:03:43 +08:00
openharmony_ci 0fa1310a32 !584 OsLockDepCheckIn异常处理中存在g_lockdepAvailable锁嵌套调用,导致死锁异常信息不正常输出
Merge pull request !584 from zhangfanfan2/master
2021-09-28 06:14:00 +00:00
zff bf030b6bb5 fix: OsLockDepCheckIn异常处理中存在g_lockdepAvailable锁嵌套调用,
导致死锁异常信息不正常输出

close: #I457ZZ

Signed-off-by: zff <zhangfanfan2@huawei.com>
Change-Id: Ic54ece064a4c85103b644dcbe8ed8bbdecbfc491
2021-09-27 21:56:20 +08:00
Caoruihong 63fd8bc39b fix: fix some function declarations
Signed-off-by: Caoruihong <crh.cao@huawei.com>
Change-Id: I3dfcc308de6fc24035d27bc4ed4a65a2d2b6650d
2021-09-27 21:01:46 +08:00
openharmony_ci 7d7cff4c51 !633 fix: codex清理
Merge pull request !633 from Far/master
2021-09-27 08:38:37 +00:00
Far 9ab3e351d3 fix: codex 清理
Close #I4BL3S

Signed-off-by: Far <yesiyuan2@huawei.com>
2021-09-27 14:43:28 +08:00
Haryslee 9fdb80f85f fix: 共享内存问题修复
Signed-off-by: Haryslee <lihao189@huawei.com>
背景:父进程移除共享内存并标记SHM_SEG_REMOVE,当子进程资源回收时在
ShmFindSeg接口中判断该共享内存具有SHM_SEG_REMOVE时返回空,但是此时
seg->ds.shm_nattch不为0,不应返回空。
方案:ShmFindSeg接口中增加seg->ds.shm_nattch为0的判断。

close #I47X2Z

Change-Id: I8735cd11ac237b17fa745c50313da0fd0649bb9f
2021-09-23 21:04:36 +08:00
openharmony_ci 93e74c5f0b !520 修复sigwait等待到的信号值与获取的siginfo中的值不一致
Merge pull request !520 from lnlan/fixed_sigwait
2021-09-23 03:22:04 +00:00
Leon Chan a375bf5668 fix: close file when process interpretor failed
close: #I4ATQX

Signed-off-by: Leon Chan <chenwei26@huawei.com>
2021-09-18 15:02:22 +08:00
openharmony_ci ecd9ca7781 !534 pagecache从filep改为使用vnode
Merge pull request !534 from LeonChan/pg
2021-09-15 03:51:50 +00:00
Leon Chan 38a6b804e9 feat: page cache backed by vnode instead of filep
1, change the owner of page to vnode
2, save the file path in vnode

close: #I44TBS
Signed-off-by: Leon Chan <chenwei26@huawei.com>
2021-09-14 15:31:33 +08:00
arvinzzz b3d96d166c refactor: 清理Makefile冗余项
清理Makefile冗余项,各模块Makefile里不需要再次引用公共路径,只需引用私有头文件路径

close: #I49MOO

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: I2dd7189c866498896461f78bfed5444ae1d86876
2021-09-13 18:14:15 +08:00
lnlan c3facd1b95 fix: 修复sigwait等待到的信号值与获取的siginfo中的值不一致
【背景】
集成测试发送两个不同的信号,sigwait第二次等到的仍是第一个信号
经定位,信号在kill时会将相关的siginfo信息拷贝到taskcb的unbinfo中,sigwait
处理时从unbinfo拷贝给用户。若此信号发送时处于屏蔽状态,再有其他信号发送会覆盖
掉unbinfo,此时sigwait等待这个信号获取到的info已经被覆盖
【修改方案】
1. 每个任务添加一个siginfo缓存链表,在处理信号前夕从缓存链表取出info到unbinfo中

【影响】
对现有的产品编译不会有影响。

re #I3M12H

Signed-off-by: lanleinan <lanleinan@163.com>

Change-Id: If4b064c18773f8eca7419c665977260167b09810
2021-09-10 03:21:58 +00:00
Caoruihong a627cdba0c chore(make): simplify build scripts
remove redundant script codes

Signed-off-by: Caoruihong <crh.cao@huawei.com>
Change-Id: I67695a69cccefc220ede55add9372bce0c59d7f5
2021-09-09 18:56:47 +08:00
openharmony_ci ba977dd5ab !605 refactor: 内核目录结构整理
Merge pull request !605 from Zhaotianyu/0902dir_refactor
2021-09-09 01:23:33 +00:00
arvinzzz 33d0c1bd0b refactor: 内核目录结构整理
1. 原kernel/common目录下属于内核拓展组件,统一移入kernel/extend管理
2. Kconfig分层,各模块自己的配置放到自己目录下管理
3. 原platform下不属于平台的公共代码抽到kernel/common下,只留板级链接脚本和一些编译脚本指向device目录下触发平台相关的编译
4. 对外公共头文件统一抽到对外include路径
5. 废弃宏,头文件清理

close: #I48KI4

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: I0cf5ea81c92a8fa7b113da9cbdc8b7bc935f5aae
2021-09-08 16:36:28 +08:00