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)
Mon, Jan 13, 10:12 AM
Unknown Object (File)
Thu, Jan 9, 8:36 AM
Unknown Object (File)
Tue, Jan 7, 9:24 AM
Unknown Object (File)
Tue, Dec 24, 7:46 AM
Unknown Object (File)
Dec 10 2024, 3:01 AM
Unknown Object (File)
Nov 28 2024, 5:46 AM
Unknown Object (File)
Nov 26 2024, 6:13 AM
Unknown Object (File)
Nov 21 2024, 2:37 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.