Subject: Re: [PATCH kernel] KVM: PPC: Expose userspace mm context id via debugfs

From: Paul Mackerras <[email-masked]>
Date: Tue, 17 Jul 2018 12:01:19 +1000

On Thu, Jul 12, 2018 at 05:30:26PM +1000, Alexey Kardashevskiy wrote:
> This adds a debugfs entry with mm context id of a process which is using
> KVM. This id is an index in the process table so the userspace can dump
> that tree provided it is granted access to /dev/mem.

Is the main intention here to be able to look at the PTEs for the
process that owns the VM?  If so, that doesn't seem particularly
KVM-specific, so perhaps something under powerpc/ in debugfs would be
more appropriate.

Is the information in /proc/<pid>/pagemap sufficient for what you
need?

Also, this doesn't seem very useful if /dev/mem is unavailable or
restricted, as it is in most distros these days.

How about a file under debugfs where you can just read out the PTEs
for a given process?

Paul.