All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sourceforge.net,
	kvm-ppc-devel@lists.sourceforge.net,
	Jerone Young <jyoung5@us.ibm.com>
Subject: Re: [kvm-ppc-devel] [kvm-devel] [PATCH] Move kvm_get_pit to
Date: Fri, 21 Mar 2008 20:26:20 +0000	[thread overview]
Message-ID: <1206131180.3136.46.camel@basalt> (raw)
In-Reply-To: <b136c0450c0f7c6ff226.1205266631@thinkpad.austin.ibm.com>

Avi, please apply the patch at the end of this mail.

On Tue, 2008-03-11 at 15:17 -0500, Jerone Young wrote:
> # HG changeset patch
> # User Jerone Young <jyoung5@us.ibm.com>
> # Date 1205266548 18000
> # Branch merge
> # Node ID b136c0450c0f7c6ff2262437b1beb9896b1585e3
> # Parent  c14fbbaee36241aa0fab0d6391e47cf9f4ac8012
> Move kvm_get_pit to libkvm.c common code
> 
> This fixes compilation issues for PowerPC and other non x86 archs that
> do not
> have in kernel pit. The pit code is added into the kvm_context in
> kvm-common.h &the error causing the issue is coming from a definition
> in qemu. This seems to be the proper fix as there is also a common
> function:
> kvm_irqchip_in_kernel
> for in kernel irq that handles this the same way.
> 
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
> 
> diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
> --- a/libkvm/libkvm-x86.c
> +++ b/libkvm/libkvm-x86.c
> @@ -660,12 +660,3 @@ int kvm_disable_tpr_access_reporting(kvm
>  }
> 
>  #endif
> -
> -int kvm_pit_in_kernel(kvm_context_t kvm)
> -{
> -#ifdef KVM_CAP_PIT
> -	return kvm->pit_in_kernel;
> -#else
> -	return 0;
> -#endif
> -}
> diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
> --- a/libkvm/libkvm.c
> +++ b/libkvm/libkvm.c
> @@ -962,3 +962,8 @@ int kvm_irqchip_in_kernel(kvm_context_t 
>  {
>      return kvm->irqchip_in_kernel;
>  }
> +
> +int kvm_pit_in_kernel(kvm_context_t kvm)
> +{
> +	return kvm->pit_in_kernel;
> +}
> diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
> --- a/libkvm/libkvm.h
> +++ b/libkvm/libkvm.h
> @@ -530,6 +530,13 @@ int kvm_set_lapic(kvm_context_t kvm, int
> 
>  #endif
> 
> +/*!
> + * \brief Query wheather in kernel pit is used
> + *
> + *  \param kvm Pointer to the current kvm_context
> + */
> +int kvm_pit_in_kernel(kvm_context_t kvm);
> +
>  #ifdef KVM_CAP_PIT
> 
>  /*!

This doesn't fix libkvm, and qemu is even worse off:

In file included from ../qemu-kvm.h:80,
                 from ../hw/i8254.c:29:
/home/hollisb/source/kvm-userspace-ppc.hg/qemu/../libkvm/libkvm.h:550: warning: "struct kvm_pit_state" declared inside parameter list
/home/hollisb/source/kvm-userspace-ppc.hg/qemu/../libkvm/libkvm.h:550: warning: its scope is only this definition or declaration, which is probably not what you want
/home/hollisb/source/kvm-userspace-ppc.hg/qemu/../libkvm/libkvm.h:561: warning: "struct kvm_pit_state" declared inside parameter list
../hw/i8254.c: In function `kvm_kernel_pit_save_to_user':
../hw/i8254.c:421: error: storage size of 'pit' isn't known
../hw/i8254.c:431: error: dereferencing pointer to incomplete type
[repeated a lot]


The below patch fixes the libkvm.h issue, taking the same approach as
kvm_get/set_lapic() just above it. (I can't say I'm a fan of this
approach, but kvm-userspace is eroding my idealism.)

The qemu breakage is fixed by Anthony's PIT patch that creates
i8254-kvm.c.



Don't compile kvm_*_pit() on architectures whose currently supported
platforms do not contain a PIT.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>

diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -539,6 +539,7 @@ int kvm_pit_in_kernel(kvm_context_t kvm)
 
 #ifdef KVM_CAP_PIT
 
+#if defined(__i386__) || defined(__x86_64__) || defined(__ia64__) 
 /*!
  * \brief Get in kernel PIT of the virtual domain
  *
@@ -562,6 +563,8 @@ int kvm_set_pit(kvm_context_t kvm, struc
 
 #endif
 
+#endif
+
 #ifdef KVM_CAP_VAPIC
 
 /*!


-- 
Hollis Blanchard
IBM Linux Technology Center


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-ppc-devel mailing list
kvm-ppc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel

WARNING: multiple messages have this Message-ID (diff)
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sourceforge.net,
	kvm-ppc-devel@lists.sourceforge.net,
	Jerone Young <jyoung5@us.ibm.com>
Subject: Re: [PATCH] Move kvm_get_pit to libkvm.c common code
Date: Fri, 21 Mar 2008 15:26:20 -0500	[thread overview]
Message-ID: <1206131180.3136.46.camel@basalt> (raw)
In-Reply-To: <b136c0450c0f7c6ff226.1205266631@thinkpad.austin.ibm.com>

Avi, please apply the patch at the end of this mail.

On Tue, 2008-03-11 at 15:17 -0500, Jerone Young wrote:
> # HG changeset patch
> # User Jerone Young <jyoung5@us.ibm.com>
> # Date 1205266548 18000
> # Branch merge
> # Node ID b136c0450c0f7c6ff2262437b1beb9896b1585e3
> # Parent  c14fbbaee36241aa0fab0d6391e47cf9f4ac8012
> Move kvm_get_pit to libkvm.c common code
> 
> This fixes compilation issues for PowerPC and other non x86 archs that
> do not
> have in kernel pit. The pit code is added into the kvm_context in
> kvm-common.h &the error causing the issue is coming from a definition
> in qemu. This seems to be the proper fix as there is also a common
> function:
> kvm_irqchip_in_kernel
> for in kernel irq that handles this the same way.
> 
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
> 
> diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
> --- a/libkvm/libkvm-x86.c
> +++ b/libkvm/libkvm-x86.c
> @@ -660,12 +660,3 @@ int kvm_disable_tpr_access_reporting(kvm
>  }
> 
>  #endif
> -
> -int kvm_pit_in_kernel(kvm_context_t kvm)
> -{
> -#ifdef KVM_CAP_PIT
> -	return kvm->pit_in_kernel;
> -#else
> -	return 0;
> -#endif
> -}
> diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
> --- a/libkvm/libkvm.c
> +++ b/libkvm/libkvm.c
> @@ -962,3 +962,8 @@ int kvm_irqchip_in_kernel(kvm_context_t 
>  {
>      return kvm->irqchip_in_kernel;
>  }
> +
> +int kvm_pit_in_kernel(kvm_context_t kvm)
> +{
> +	return kvm->pit_in_kernel;
> +}
> diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
> --- a/libkvm/libkvm.h
> +++ b/libkvm/libkvm.h
> @@ -530,6 +530,13 @@ int kvm_set_lapic(kvm_context_t kvm, int
> 
>  #endif
> 
> +/*!
> + * \brief Query wheather in kernel pit is used
> + *
> + *  \param kvm Pointer to the current kvm_context
> + */
> +int kvm_pit_in_kernel(kvm_context_t kvm);
> +
>  #ifdef KVM_CAP_PIT
> 
>  /*!

This doesn't fix libkvm, and qemu is even worse off:

In file included from ../qemu-kvm.h:80,
                 from ../hw/i8254.c:29:
/home/hollisb/source/kvm-userspace-ppc.hg/qemu/../libkvm/libkvm.h:550: warning: "struct kvm_pit_state" declared inside parameter list
/home/hollisb/source/kvm-userspace-ppc.hg/qemu/../libkvm/libkvm.h:550: warning: its scope is only this definition or declaration, which is probably not what you want
/home/hollisb/source/kvm-userspace-ppc.hg/qemu/../libkvm/libkvm.h:561: warning: "struct kvm_pit_state" declared inside parameter list
../hw/i8254.c: In function `kvm_kernel_pit_save_to_user':
../hw/i8254.c:421: error: storage size of 'pit' isn't known
../hw/i8254.c:431: error: dereferencing pointer to incomplete type
[repeated a lot]


The below patch fixes the libkvm.h issue, taking the same approach as
kvm_get/set_lapic() just above it. (I can't say I'm a fan of this
approach, but kvm-userspace is eroding my idealism.)

The qemu breakage is fixed by Anthony's PIT patch that creates
i8254-kvm.c.



Don't compile kvm_*_pit() on architectures whose currently supported
platforms do not contain a PIT.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>

diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -539,6 +539,7 @@ int kvm_pit_in_kernel(kvm_context_t kvm)
 
 #ifdef KVM_CAP_PIT
 
+#if defined(__i386__) || defined(__x86_64__) || defined(__ia64__) 
 /*!
  * \brief Get in kernel PIT of the virtual domain
  *
@@ -562,6 +563,8 @@ int kvm_set_pit(kvm_context_t kvm, struc
 
 #endif
 
+#endif
+
 #ifdef KVM_CAP_VAPIC
 
 /*!


-- 
Hollis Blanchard
IBM Linux Technology Center


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  parent reply	other threads:[~2008-03-21 20:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11 20:17 [kvm-ppc-devel] [PATCH] Move kvm_get_pit to libkvm.c common code Jerone Young
2008-03-11 20:17 ` Jerone Young
2008-03-12  6:36 ` [kvm-ppc-devel] [kvm-devel] [PATCH] Move kvm_get_pit to Yang, Sheng
2008-03-12  6:36   ` [PATCH] Move kvm_get_pit to libkvm.c common code Yang, Sheng
2008-03-16 11:35 ` [kvm-ppc-devel] [kvm-devel] [PATCH] Move kvm_get_pit to Avi Kivity
2008-03-16 11:35   ` [PATCH] Move kvm_get_pit to libkvm.c common code Avi Kivity
2008-03-21 20:26 ` Hollis Blanchard [this message]
2008-03-21 20:26   ` Hollis Blanchard
2008-03-23  8:44   ` [kvm-ppc-devel] [kvm-devel] [PATCH] Move kvm_get_pit to Avi Kivity
2008-03-23  8:44     ` [PATCH] Move kvm_get_pit to libkvm.c common code Avi Kivity
2008-03-24  1:51     ` [kvm-ppc-devel] [kvm-devel] [PATCH] Move kvm_get_pit tolibkvm.c Zhang, Xiantao
2008-03-24  1:51       ` [kvm-ppc-devel] [PATCH] Move kvm_get_pit tolibkvm.c common code Zhang, Xiantao

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=1206131180.3136.46.camel@basalt \
    --to=hollisb@us.ibm.com \
    --cc=avi@qumranet.com \
    --cc=jyoung5@us.ibm.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=kvm-ppc-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.