-
Notifications
You must be signed in to change notification settings - Fork 320
Add close_range() system call #43
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
Open
ricardobranco777
wants to merge
4
commits into
NetBSD:trunk
Choose a base branch
from
ricardobranco777:close_range
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
673e298
to
4b530cb
Compare
I think UNSHARE was implemented before and it was the same way sharing is done and undone in the clone system call. I added it back. I patched, I am doing a build now and will fix the sets. |
zoulasc
reviewed
Mar 25, 2025
zoulasc
reviewed
Mar 25, 2025
5898156
to
5774026
Compare
5774026
to
cde0094
Compare
netbsd-srcmastr
pushed a commit
that referenced
this pull request
Oct 1, 2025
sys/arch/i386/i386/locore.S: revision 1.202 sys/arch/i386/i386/locore.S: revision 1.203 sys/arch/i386/i386/locore.S: revision 1.204 sys/arch/amd64/amd64/locore.S: revision 1.231 sys/arch/amd64/amd64/locore.S: revision 1.232 sys/arch/amd64/amd64/locore.S: revision 1.233 sys/arch/xen/xen/hypervisor.c: revision 1.100 Our PVH bootstrap code assumed that the hvm_start_info structure provided by Xen is just after the end of the symbol case. With Xen 4.20 it's not always the case, so: - get the symbol table size from the first byte of the symbol table area provided by Xen. As we don't know if there is a symbol table or not, do a minimal sanity check on the size. - if the hvm_start_info structure is not in the page after kernel_end or esym, copy it there (this was already done in the genpvh case). While there, if we copy we can easily compute the size and not assume it all fits in one page. With this, a NetBSD PVH dom0 can boot on Xen 4.20 Fix some issues with symbol table detection on Xen PVH: - the stack grows down so the last pushed value is at 0(%esp), not -4(%esp). Pointed out by Joachim Kuebart. - 0x3fffffff is 1GB-1, not 1MB-1. Test the symtab size against 16MB (amd64 generic symbol table is just above 1MB these days) - I got confused by cmp's arguments order between intel and gas syntax, so the tests did the opposite of intended and the symtab was always considered valid. While there use unsigned conditions. Should fix booting in PVH mode with netbsd-INSTALL (which is stripped) Fix various typos, mainly in comments.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adapt existing code in
compat_linux
forclose_range
and make it use the new native system call.The existing test code for
closefrom(3)
was adapted and extended forclose_range(2)
.The manpage was adapted from FreeBSD using the Linux names for the parameters:
https://man.freebsd.org/cgi/man.cgi?query=close_range&sektion=2&n=1
Fixes kern/59081
CLOSE_RANGE_UNSHARE
was removed as it doesn't make sense on NetBSD which lacksunshare(2)
. From the Linux documentation: