Page MenuHomeFreeBSD

kvm: fix types for `kvm_walk_pages`
ClosedPublic

Authored by emaste on Oct 8 2019, 6:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 2 2024, 10:22 PM
Unknown Object (File)
Feb 12 2024, 3:27 AM
Unknown Object (File)
Dec 20 2023, 3:52 AM
Unknown Object (File)
Dec 13 2023, 7:42 PM
Unknown Object (File)
Dec 11 2023, 5:17 AM
Unknown Object (File)
Dec 1 2023, 3:43 AM
Unknown Object (File)
Dec 1 2023, 3:43 AM
Unknown Object (File)
Dec 1 2023, 3:43 AM
Subscribers
None

Details

Summary

As with other libkvm interfaces use maximum-sized types to support cross-debugging (e.g. a 64-bit vmcore on a 32-bit host). See https://lists.freebsd.org/pipermail/svn-src-all/2019-February/176051.html for further discussion.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste added a reviewer: brooks.
emaste added inline comments.
sys/sys/types.h
260–261

there was some suggestion of introducing kvm_ types -- kvm_paddr_t, kvm_vaddr_t?

sys/sys/types.h
260–261

It probably makes sense to have a kpaddr_t in general. I'm not sure how much value lvm_* variants add in practice.

Note that the types are the same size on LP64 archs. This breaks the ABI on ILP32.

sys/sys/types.h
254–255

This comment needs updating, perhaps:

Types suitable for exporting physical addresses, virtual addresses (pointers), and
memory object sizes from the kernel independent of native word size.  These
should be used in place of vm_paddr_t, (u)intptr_t, and size_t in structs which
contain such types that are shared with userspace.

I'm fine with these changes, even though they break the API. For my purposes, it isn't a big deal, especially with the version bump.

I don't think I can say much about the appropriateness of the types, but it makes sense to me to have them.

This revision is now accepted and ready to land.Oct 11 2019, 5:21 PM
This revision was automatically updated to reflect the committed changes.