kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Alexander Graf <agraf@suse.de>, kvm-ppc@vger.kernel.org
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: Book3S: ifdef on CONFIG_KVM_BOOK3S_32_HANDLER for 32bit
Date: Mon, 07 Apr 2014 10:42:42 +0530	[thread overview]
Message-ID: <87k3b1soxh.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1396820111-27655-1-git-send-email-agraf@suse.de>

Alexander Graf <agraf@suse.de> writes:

> The book3s_32 target can get built as module which means we don't see the
> config define for it in code. Instead, check on the bool define
> CONFIG_KVM_BOOK3S_32_HANDLER whenever we want to know whether we're building
> for a book3s_32 host.
>
> This fixes running book3s_32 kvm as a module for me.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>

I thought Greg  Kurz had sent a patch for this. Remember discussing this
on irc. 

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

> ---
>  arch/powerpc/kvm/book3s.c    | 6 +++---
>  arch/powerpc/kvm/book3s_pr.c | 8 +++++---
>  2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
> index 94e597e..7af190a 100644
> --- a/arch/powerpc/kvm/book3s.c
> +++ b/arch/powerpc/kvm/book3s.c
> @@ -886,7 +886,7 @@ static int kvmppc_book3s_init(void)
>  	r = kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE);
>  	if (r)
>  		return r;
> -#ifdef CONFIG_KVM_BOOK3S_32
> +#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
>  	r = kvmppc_book3s_init_pr();
>  #endif
>  	return r;
> @@ -895,7 +895,7 @@ static int kvmppc_book3s_init(void)
>  
>  static void kvmppc_book3s_exit(void)
>  {
> -#ifdef CONFIG_KVM_BOOK3S_32
> +#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
>  	kvmppc_book3s_exit_pr();
>  #endif
>  	kvm_exit();
> @@ -905,7 +905,7 @@ module_init(kvmppc_book3s_init);
>  module_exit(kvmppc_book3s_exit);
>  
>  /* On 32bit this is our one and only kernel module */
> -#ifdef CONFIG_KVM_BOOK3S_32
> +#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
>  MODULE_ALIAS_MISCDEV(KVM_MINOR);
>  MODULE_ALIAS("devname:kvm");
>  #endif
> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
> index c5c052a..4f00bda 100644
> --- a/arch/powerpc/kvm/book3s_pr.c
> +++ b/arch/powerpc/kvm/book3s_pr.c
> @@ -1153,7 +1153,7 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_pr(struct kvm *kvm,
>  		goto free_vcpu;
>  	vcpu->arch.book3s = vcpu_book3s;
>  
> -#ifdef CONFIG_KVM_BOOK3S_32
> +#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
>  	vcpu->arch.shadow_vcpu =
>  		kzalloc(sizeof(*vcpu->arch.shadow_vcpu), GFP_KERNEL);
>  	if (!vcpu->arch.shadow_vcpu)
> @@ -1198,7 +1198,7 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_pr(struct kvm *kvm,
>  uninit_vcpu:
>  	kvm_vcpu_uninit(vcpu);
>  free_shadow_vcpu:
> -#ifdef CONFIG_KVM_BOOK3S_32
> +#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
>  	kfree(vcpu->arch.shadow_vcpu);
>  free_vcpu3s:
>  #endif
> @@ -1215,7 +1215,7 @@ static void kvmppc_core_vcpu_free_pr(struct kvm_vcpu *vcpu)
>  
>  	free_page((unsigned long)vcpu->arch.shared & PAGE_MASK);
>  	kvm_vcpu_uninit(vcpu);
> -#ifdef CONFIG_KVM_BOOK3S_32
> +#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
>  	kfree(vcpu->arch.shadow_vcpu);
>  #endif
>  	vfree(vcpu_book3s);
> @@ -1491,6 +1491,8 @@ int kvmppc_book3s_init_pr(void)
>  {
>  	int r;
>  
> +printk(KERN_INFO "%s:%d\n", __func__, __LINE__);
> +
>  	r = kvmppc_core_check_processor_compat_pr();
>  	if (r < 0)
>  		return r;
> -- 
> 1.8.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2014-04-07  5:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 21:35 [PATCH] KVM: PPC: Book3S: ifdef on CONFIG_KVM_BOOK3S_32_HANDLER for 32bit Alexander Graf
2014-04-06 22:05 ` Alexander Graf
2014-04-07  5:12 ` Aneesh Kumar K.V [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=87k3b1soxh.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.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 NNTP newsgroup(s).