Page MenuHomeFreeBSD

libkvm: add kvm_walk_pages API.
ClosedPublic

Authored by will on Sep 8 2017, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 4 2024, 12:11 AM
Unknown Object (File)
Jan 27 2024, 11:37 AM
Unknown Object (File)
Dec 22 2023, 11:10 PM
Unknown Object (File)
Nov 11 2023, 9:11 PM
Unknown Object (File)
Nov 8 2023, 7:32 PM
Unknown Object (File)
Nov 8 2023, 4:00 PM
Unknown Object (File)
Nov 6 2023, 8:03 PM
Unknown Object (File)
Nov 5 2023, 5:21 PM
Subscribers

Details

Summary

This API allows callers to enumerate all known pages, including any
direct map & kernel map virtual addresses, physical addresses, size,
offset into the core, & protection configured.

For architectures that support direct map addresses, also generate pages
for any direct map only addresses that are not associated with kernel
map addresses.

Fix page size portability issue left behind from previous kvm page table
lookup interface.

Test Plan

Install libkvm, make sure kgdb et al still work (should be a no-op).

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 11439
Build 11797: arc lint + arc unit

Event Timeline

  • kvm: pass up better error messages.
lib/libkvm/kvm.c
503

Minor style nit: parens around return value.

lib/libkvm/kvm_aarch64.h
47

Tab after #define instead of space

lib/libkvm/kvm_arm.h
56

Another tab vs space.

lib/libkvm/kvm_minidump_amd64.c
69

I found it somewhat confusing at first that there was both pde_get() and pte_get() for amd64, it might warrant a short block comment above these functions explaining that version 1 dumps use pte_get() and version 2 use pde_get()

342

Since this always reads pdes, does it only work for version 2? If so, we should check the version?

will marked 2 inline comments as done.
  • libkvm: fix minor nits.
lib/libkvm/kvm_minidump_amd64.c
342

You're right.

Version 2 was added in 2010, so all versions after that point only generate v2 minidumps. Would it be acceptable to simply leave it out of this change?

lib/libkvm/kvm_minidump_amd64.c
342

I think just adding a version check and failing for version 1 dumps is probably fine. I'd just rather have an explicit failure than undefined behavior.

  • libkvm: require v2 minidumps for walk_pages on amd64.
will marked an inline comment as done.Oct 2 2017, 5:53 PM

On amd64, this now requires v2 minidumps (generated since 2010).

@jhb Any further feedback? Does this look ready for HEAD?

This should be fine. I think the diff in phab is just a diff relative to the previous rather than the full diff FWIW.

This revision is now accepted and ready to land.Nov 6 2017, 8:48 PM
This revision was automatically updated to reflect the committed changes.