Kernel KVM-PPC virtualization development
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Cc: kvm@vger.kernel.org, aneesh.kumar@linux.vnet.ibm.com
Subject: Re: [PATCH] KVM: PPC: Book3S: ifdef on CONFIG_KVM_BOOK3S_32_HANDLER for 32bit
Date: Sun, 06 Apr 2014 22:05:52 +0000	[thread overview]
Message-ID: <5341CFC0.8050703@suse.de> (raw)
In-Reply-To: <1396820111-27655-1-git-send-email-agraf@suse.de>


On 06.04.14 23:35, Alexander Graf wrote:
> 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>
> ---
>   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__);
> +

Without this debug hunk of course ;)


Alex


  reply	other threads:[~2014-04-06 22:05 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 [this message]
2014-04-07  5:24 ` Aneesh Kumar K.V

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=5341CFC0.8050703@suse.de \
    --to=agraf@suse.de \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --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