Page MenuHomeFreeBSD

kvm: fix types for `kvm_walk_pages`
ClosedPublic

Authored by emaste on Oct 8 2019, 6:29 PM.
Tags
None
Referenced Files
F132422376: D21945.id64074.diff
Thu, Oct 16, 7:31 PM
F132415374: D21945.id63107.diff
Thu, Oct 16, 6:05 PM
Unknown Object (File)
Wed, Oct 15, 11:40 PM
Unknown Object (File)
Wed, Oct 15, 11:26 PM
Unknown Object (File)
Wed, Oct 15, 7:56 PM
Unknown Object (File)
Wed, Oct 15, 5:02 PM
Unknown Object (File)
Mon, Oct 13, 11:59 PM
Unknown Object (File)
Sun, Oct 12, 6:30 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste added a reviewer: brooks.
emaste added inline comments.
sys/sys/types.h
260–261 ↗(On Diff #63048)

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

sys/sys/types.h
260–261 ↗(On Diff #63048)

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
255 ↗(On Diff #63048)

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.