Use it to implement some logic in the kern_copyin test (rather than
assuming that PS_STRINGS is fixed by the ABI).
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/sys/user.h | ||
---|---|---|
605 | I think it would be useful to pack all the information from struct vm_map and struct vmspace, which is potentially useful to userspace, into this kinfo. For instance, all non-kernel flags from vm_map->flags, event though they are available by proccontrol, could be usefully reported there. All vm_Xsize and vm_Xaddr should be exported as well. I think it is debatable but worth considering anon_loc and vm_stkgap (the later depends on the outcome of the stackgap rework, to be discussed in other place). |
Please bump __FreeBSD_version for this change.
I have a use case for qemu-user for this, and am quite keen on knowing the whole address space, not just kvm_max_user_address (though that would be useful). Linux exports a set of ranges that are mapped that is used to find a 'hole' big enough for the guest.
hmmm, I could do the stuff I need in qemu w/o a version bump and it would likely be better in case this is MFC'd
Isn't this already available via KERN_PROC_VMMAP? What information do you need, exactly?
What about exporting pmap pm_stats as well?
sys/kern/kern_proc.c | ||
---|---|---|
3234 | Why not do vm_map_min()/max() instead? sv_*user are only templates, and e.g. map_at_zero changes vm_map_min(). | |
3243 | I do not like the tie of the kernel-internal flags to the sysctl output, it moves them into ABI. IMO it should be the dedicated flags, translated. |
It seems rather orthogonal to the purpose of this sysctl, which exposes static information. The resident count can be obtained already in kinfo_proc.
sys/kern/kern_proc.c | ||
---|---|---|
3260 | I copied the handling of 32-bit procs from sysctl_kern_proc_sigfastblk(), but this munging is ugly. Perhaps the compat32 fields should be defined as uint64_t instead, or the native kinfo_vm_layout definition should use uint64_t everywhere. |
sys/kern/kern_proc.c | ||
---|---|---|
3214 | namelen is used only once? |