Page MenuHomeFreeBSD

libkvm: support access to vmm guest memory, allow writes to fwmem and vmm
ClosedPublic

Authored by avg on Nov 30 2016, 2:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 6, 8:38 AM
Unknown Object (File)
Wed, Mar 5, 4:40 AM
Unknown Object (File)
Fri, Feb 28, 9:11 AM
Unknown Object (File)
Feb 6 2025, 5:27 AM
Unknown Object (File)
Jan 31 2025, 2:36 AM
Unknown Object (File)
Jan 22 2025, 5:18 AM
Unknown Object (File)
Jan 13 2025, 10:12 AM
Unknown Object (File)
Jan 9 2025, 8:36 AM
Subscribers

Details

Summary

This change consists of two parts:

  • allow libkvm to recognize /dev/vmm/* character devices as devices that provide access to the physical memory of a system (similarly to /dev/fwmem*)
  • allow libkvm to recognize that /dev/vmm/* and /dev/fwmem* devices provide access to the physical memory of live remote systems and, thus, the memory is writable

As a result, it should be possible to run commands like
$ kgdb -w /path/to/kernel /dev/fwmem0.0
$ kgdb /path/to/kernel /dev/vmm/guest

And other commands that employ libkvm to access system memory images.

Diff Detail

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

Event Timeline

avg retitled this revision from to libkvm: support access to vmm guest memory, allow writes to fwmem and vmm.
avg updated this object.
avg edited the test plan for this revision. (Show Details)
avg added reviewers: jhb, ngie, kib.
kib edited edge metadata.
kib added inline comments.
lib/libkvm/kvm.c
185 ↗(On Diff #22618)

Shouldn't this depend on flags ? If O_RDONLY is used, writeable seems to be not true.

This revision is now accepted and ready to land.Nov 30 2016, 3:17 PM
lib/libkvm/kvm.c
185 ↗(On Diff #22618)

So, 'writable' should be read as 'potentially writable'. If a device is opened read-only, then writing to it will fail anyway and an appropriate error would be reported.

jhb edited edge metadata.

The writable name is a bit confusing as Kostantin noted, but I don't have a better suggestion.

This revision was automatically updated to reflect the committed changes.