Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch feat robust futex #682

Merged

Conversation

1037827920
Copy link
Contributor

No description provided.

@dragonosbot
Copy link

@1037827920: no appropriate reviewer found, use r? to override

@dragonosbot dragonosbot added the S-等待审查 Status: 等待assignee以及相关方的审查。 label Apr 1, 2024
@@ -0,0 +1 @@
{"rustc_fingerprint":4791525129410595491,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/hmt/.rustup/toolchains/nightly-2023-08-15-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.73.0-nightly (180dffba1 2023-08-14)\nbinary: rustc\ncommit-hash: 180dffba142c47240ca0d93096ce90b9fd97c8d7\ncommit-date: 2023-08-14\nhost: x86_64-unknown-linux-gnu\nrelease: 1.73.0-nightly\nLLVM version: 17.0.0\n","stderr":""},"551431409088304268":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.a\nlib___.so\n/home/hmt/.rustup/toolchains/nightly-2023-08-15-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"musl\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nunix\n","stderr":"warning: dropping unsupported crate type `dylib` for target `x86_64-unknown-linux-musl`\n\nwarning: dropping unsupported crate type `cdylib` for target `x86_64-unknown-linux-musl`\n\nwarning: 2 warnings emitted\n\n"}},"successes":{}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这测试项目没加.gitignore

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些错误提交进来的东西要删掉。并且在测试项目里面添加ignore

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些错误提交进来的东西要删掉。并且在测试项目里面添加ignore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

除了license还有其他错误提交的文件吗?

@@ -0,0 +1,14 @@
# DragonOS Rust-Application Template
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README需要改

@@ -0,0 +1,201 @@
Apache License
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我记得LICENSE也是不要的

@fslongjin
Copy link
Member

@dragonosbot author

@dragonosbot dragonosbot added S-等待作者修改 Status: 这正在等待作者的一些操作(例如代码更改或更多信息)。 and removed S-等待审查 Status: 等待assignee以及相关方的审查。 labels Apr 1, 2024
Copy link
Member

@fslongjin fslongjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请先删除多余的文件。

@1037827920
Copy link
Contributor Author

@dragonosbot review

@dragonosbot dragonosbot added S-等待审查 Status: 等待assignee以及相关方的审查。 and removed S-等待作者修改 Status: 这正在等待作者的一些操作(例如代码更改或更多信息)。 labels Apr 2, 2024
Copy link
Member

@fslongjin fslongjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该要把整个target文件夹都删掉,并且把整个文件夹加到Ignore

@fslongjin
Copy link
Member

@dragonosbot author

@dragonosbot dragonosbot added S-等待作者修改 Status: 这正在等待作者的一些操作(例如代码更改或更多信息)。 and removed S-等待审查 Status: 等待assignee以及相关方的审查。 labels Apr 2, 2024
@1037827920
Copy link
Contributor Author

@dragonosbot review

@dragonosbot dragonosbot added S-等待审查 Status: 等待assignee以及相关方的审查。 and removed S-等待作者修改 Status: 这正在等待作者的一些操作(例如代码更改或更多信息)。 labels Apr 2, 2024
@@ -0,0 +1,16 @@
# This file is automatically @generated by Cargo.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cargo.lock还没删

LICENSE Outdated
@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是要把DragonOS的LICENSE删了

@fslongjin
Copy link
Member

r? @chiichen

}

//获取当前线程的robust list head 和 长度
let robust_list_head = match *pcb.get_robust_list() {
Copy link
Member

@fslongjin fslongjin Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用ok_or方法比较好,所有这种match某个option的,都应该用OK_or

.ok()
{
Some(ubr) => ubr,
None => return None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这种地方直接打?就行了。不清楚为什么clippy没报错?

let len = args[1];

//判断用户空间地址的合法性
verify_area(head_uaddr, core::mem::size_of::<u32>())?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个校验应该在里面那个函数那里做

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

futex这个系统调用校验用户空间地址也在syscall/mod.rs里面校验,要不要顺便改了。https://code.dragonos.org.cn/xref/DragonOS/kernel/src/syscall/mod.rs?r=9b96c5b547c337502db7ec820312f119f95eece1#689

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以

@fslongjin
Copy link
Member

@dragonosbot author

@dragonosbot dragonosbot added S-等待作者修改 Status: 这正在等待作者的一些操作(例如代码更改或更多信息)。 and removed S-等待审查 Status: 等待assignee以及相关方的审查。 labels Apr 2, 2024
PROT_READ, PROT_WRITE,
};

const SYS_FUTEX: i64 = 202;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些数字不要这么定义,而是应该使用sc库或者nix?系统调用号是跟架构相关的,将来我们移植到riscv,这些数值都会不一样。

Copy link
Member

@fslongjin fslongjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

得先改一下测试程序的那个comment(刚才手滑点错了approve)

@fslongjin fslongjin merged commit 06560af into DragonOS-Community:master Apr 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-等待作者修改 Status: 这正在等待作者的一些操作(例如代码更改或更多信息)。
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants