Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1475162

Re: [PATCH 3/4] kvm: add stub for arch specific debugfs support

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/4] kvm: add stub for arch specific debugfs support
Date 2016-09-02 16:00 +0200
Message-ID <scXaF-9t-17@gated-at.bofh.it> (permalink)
References <schbr-59T-5@gated-at.bofh.it> <schbs-59T-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 31/08/2016 19:05, Luiz Capitulino wrote:
> kvm_arch_create_vm_debugfs() allows arch specific code to
> create entries in the VM's directory in debugfs. x86 will
> implement support for this in the next commit.
> 
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>  arch/arm/kvm/arm.c         | 5 +++++
>  arch/mips/kvm/mips.c       | 5 +++++
>  arch/powerpc/kvm/powerpc.c | 5 +++++
>  arch/s390/kvm/kvm-s390.c   | 5 +++++
>  arch/x86/kvm/x86.c         | 5 +++++
>  include/linux/kvm_host.h   | 2 ++
>  virt/kvm/kvm_main.c        | 4 ++++
>  7 files changed, 31 insertions(+)
> 
> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> index 75f130e..491211f 100644
> --- a/arch/arm/kvm/arm.c
> +++ b/arch/arm/kvm/arm.c
> @@ -144,6 +144,11 @@ out_fail_alloc:
>  	return ret;
>  }
>  
> +int kvm_arch_create_vm_debugfs(struct kvm *kvm)
> +{
> +	return 0;
> +}
> +
>  int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
>  {
>  	return VM_FAULT_SIGBUS;
> diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
> index a6ea084..a854b8b 100644
> --- a/arch/mips/kvm/mips.c
> +++ b/arch/mips/kvm/mips.c
> @@ -140,6 +140,11 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
>  	return 0;
>  }
>  
> +int kvm_arch_create_vm_debugfs(struct kvm *kvm)
> +{
> +	return 0;
> +}
> +
>  void kvm_mips_free_vcpus(struct kvm *kvm)
>  {
>  	unsigned int i;
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index 6ce40dd..d8867e5 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -436,6 +436,11 @@ err_out:
>  	return -EINVAL;
>  }
>  
> +int kvm_arch_create_vm_debugfs(struct kvm *kvm)
> +{
> +	return 0;
> +}
> +
>  void kvm_arch_destroy_vm(struct kvm *kvm)
>  {
>  	unsigned int i;
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index f142215..406324c 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -1490,6 +1490,11 @@ out_err:
>  	return rc;
>  }
>  
> +int kvm_arch_create_vm_debugfs(struct kvm *kvm)
> +{
> +	return 0;
> +}
> +
>  void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
>  {
>  	VCPU_EVENT(vcpu, 3, "%s", "free cpu");
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 19f9f9e..18dfbac 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -7779,6 +7779,11 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
>  	return 0;
>  }
>  
> +int kvm_arch_create_vm_debugfs(struct kvm *kvm)
> +{
> +	return 0;
> +}
> +
>  static void kvm_unload_vcpu_mmu(struct kvm_vcpu *vcpu)
>  {
>  	int r;
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 9c28b4d..d3810bf 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -835,6 +835,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type);
>  void kvm_arch_destroy_vm(struct kvm *kvm);
>  void kvm_arch_sync_events(struct kvm *kvm);
>  
> +int kvm_arch_create_vm_debugfs(struct kvm *kvm);
> +
>  int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu);
>  void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
>  
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 9293285..2db53a8 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -601,6 +601,10 @@ static int kvm_create_vm_debugfs(struct kvm *kvm, int fd)
>  					 stat_fops_per_vm[p->kind]))
>  			goto out_err;
>  	}
> +
> +	if (kvm_arch_create_vm_debugfs(kvm) < 0)
> +		goto out_err;
> +
>  	return 0;
>  
>  out_err:
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] kvm: export TSC offset to user-space Luiz Capitulino <lcapitulino@redhat.com> - 2016-08-31 19:10 +0200
  [PATCH 3/4] kvm: add stub for arch specific debugfs support Luiz Capitulino <lcapitulino@redhat.com> - 2016-08-31 19:10 +0200
    Re: [PATCH 3/4] kvm: add stub for arch specific debugfs support Paolo Bonzini <pbonzini@redhat.com> - 2016-09-02 16:00 +0200
    Re: [PATCH 3/4] kvm: add stub for arch specific debugfs support Masami Hiramatsu <mhiramat@kernel.org> - 2016-09-03 05:40 +0200
  [PATCH 4/4] kvm: x86: export TSC offset to user-space Luiz Capitulino <lcapitulino@redhat.com> - 2016-08-31 19:10 +0200
    Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Stefan Hajnoczi <stefanha@gmail.com> - 2016-09-02 15:50 +0200
      Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Steven Rostedt <rostedt@goodmis.org> - 2016-09-02 16:20 +0200
        Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Marcelo Tosatti <mtosatti@redhat.com> - 2016-09-03 02:30 +0200
          Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Masami Hiramatsu <mhiramat@kernel.org> - 2016-09-03 06:20 +0200
      Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Luiz Capitulino <lcapitulino@redhat.com> - 2016-09-02 18:30 +0200
        Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Luiz Capitulino <lcapitulino@redhat.com> - 2016-09-02 18:30 +0200
      Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Marcelo Tosatti <mtosatti@redhat.com> - 2016-09-03 02:30 +0200
        Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Luiz Capitulino <lcapitulino@redhat.com> - 2016-09-03 03:30 +0200
    Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Paolo Bonzini <pbonzini@redhat.com> - 2016-09-02 19:10 +0200
      Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Luiz Capitulino <lcapitulino@redhat.com> - 2016-09-02 19:40 +0200
        Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space Paolo Bonzini <pbonzini@redhat.com> - 2016-09-05 10:20 +0200

csiph-web