kvm-ppc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, linuxppc-dev@lists.ozlabs.org
Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	Fabiano Rosas <farosas@linux.ibm.com>
Subject: Re: [PATCH kernel v3] KVM: PPC: Merge powerpc's debugfs entry content into generic entry
Date: Fri, 17 Dec 2021 07:14:42 +0000	[thread overview]
Message-ID: <24a21799-89a3-4b38-2673-1e768e506044@kaod.org> (raw)
In-Reply-To: <e59eaa8c-6c60-521f-dc5d-d7c549a7c80f@ozlabs.ru>

On 12/17/21 04:07, Alexey Kardashevskiy wrote:
> 
> 
> On 12/16/21 05:11, Cédric Le Goater wrote:
>> On 12/15/21 02:33, Alexey Kardashevskiy wrote:
>>> At the moment KVM on PPC creates 3 types of entries under the kvm debugfs:
>>> 1) "%pid-%fd" per a KVM instance (for all platforms);
>>> 2) "vm%pid" (for PPC Book3s HV KVM);
>>> 3) "vm%u_vcpu%u_timing" (for PPC Book3e KVM).
>>>
>>> The problem with this is that multiple VMs per process is not allowed for
>>> 2) and 3) which makes it possible for userspace to trigger errors when
>>> creating duplicated debugfs entries.
>>>
>>> This merges all these into 1).
>>>
>>> This defines kvm_arch_create_kvm_debugfs() similar to
>>> kvm_arch_create_vcpu_debugfs().
>>>
>>> This defines 2 hooks in kvmppc_ops that allow specific KVM implementations
>>> add necessary entries, this adds the _e500 suffix to
>>> kvmppc_create_vcpu_debugfs_e500() to make it clear what platform it is for.
>>>
>>> This makes use of already existing kvm_arch_create_vcpu_debugfs() on PPC.
>>>
>>> This removes no more used debugfs_dir pointers from PPC kvm_arch structs.
>>>
>>> This stops removing vcpu entries as once created vcpus stay around
>>> for the entire life of a VM and removed when the KVM instance is closed,
>>> see commit d56f5136b010 ("KVM: let kvm_destroy_vm_debugfs clean up vCPU
>>> debugfs directories").
>>
>> It would nice to also move the KVM device debugfs files :
>>
>>     /sys/kernel/debug/powerpc/kvm-xive-%p
>>
>> These are dynamically created and destroyed at run time depending
>> on the interrupt mode negociated by CAS. It might be more complex ?
> 
> With this addition:
> 
> diff --git a/arch/powerpc/kvm/book3s_xive_native.c
> b/arch/powerpc/kvm/book3s_xive_native.c
> index 99db9ac49901..511f643e2875 100644
> --- a/arch/powerpc/kvm/book3s_xive_native.c
> +++ b/arch/powerpc/kvm/book3s_xive_native.c
> @@ -1267,10 +1267,10 @@ static void xive_native_debugfs_init(struct
> kvmppc_xive *xive)
>                  return;
>          }
> 
> -       xive->dentry = debugfs_create_file(name, 0444, arch_debugfs_dir,
> +       xive->dentry = debugfs_create_file(name, 0444,
> xive->kvm->debugfs_dentry,
>                                             xive, &xive_native_debug_fops);
> 
> 
> it looks fine, this is "before":
> 
> root@zz1:/sys/kernel/debug# find -iname "*xive*"
> ./slab/xive-provision
> ./powerpc/kvm-xive-c0000000208c0000
> ./powerpc/xive
> 
> 
> and this is "after" the patch applied.
> 
> root@zz1:/sys/kernel/debug# find -iname "*xive*"
> ./kvm/29058-11/kvm-xive-c0000000208c0000
> ./slab/xive-provision
> ./powerpc/xive
> 

I think "./kvm/29058-11/xive" should be enough now. The KVM prefix is
redundant and so is the %p which was used to distinguish VMs.

The same change could be done for the KVM XICS device.

Thanks,

C.

      reply	other threads:[~2021-12-17  7:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15  1:33 [PATCH kernel v3] KVM: PPC: Merge powerpc's debugfs entry content into generic entry Alexey Kardashevskiy
2021-12-15 10:26 ` kernel test robot
2021-12-15 18:11 ` Cédric Le Goater
2021-12-17  3:07   ` Alexey Kardashevskiy
2021-12-17  7:14     ` Cédric Le Goater [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24a21799-89a3-4b38-2673-1e768e506044@kaod.org \
    --to=clg@kaod.org \
    --cc=aik@ozlabs.ru \
    --cc=farosas@linux.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).