All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Cc: kvm-ppc@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb.
Date: Thu, 11 Dec 2008 21:30:10 +0000	[thread overview]
Message-ID: <49418662.8000205@codemonkey.ws> (raw)
In-Reply-To: <a8986b56713649a250fb5f2435df33792d75e25c.1229027683.git.hollisb@us.ibm.com>

Hollis Blanchard wrote:
> Implement hooks called by generic KVM code.
>
> Also add code that will copy the host's CPU and timebase frequencies to the
> guest, which is necessary on KVM because the guest can directly access the
> timebase.
>
> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
> ---
>  Makefile.target      |    3 +
>  configure            |    6 ++
>  target-ppc/helper.c  |    5 +
>  target-ppc/kvm.c     |  212 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  target-ppc/kvm_ppc.c |  105 +++++++++++++++++++++++++
>  target-ppc/kvm_ppc.h |   15 ++++
>  6 files changed, 346 insertions(+), 0 deletions(-)
>  create mode 100644 target-ppc/kvm.c
>  create mode 100644 target-ppc/kvm_ppc.c
>  create mode 100644 target-ppc/kvm_ppc.h
>
> diff --git a/Makefile.target b/Makefile.target
> index 7152dff..d01231d 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -652,6 +652,9 @@ OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
>  OBJS+= unin_pci.o ppc_chrp.o
>  # PowerPC 4xx boards
>  OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
> +ifdef CONFIG_KVM
> +OBJS+= kvm_ppc.o
> +endif
>   

Shouldn't you be kvm.o?  If your file lives in target-ppc/kvm.c, it'll 
just work.

>  diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> new file mode 100644
> index 0000000..90b943b
> --- /dev/null
> +++ b/target-ppc/kvm.c
> @@ -0,0 +1,212 @@
> +int kvm_arch_put_registers(CPUState *env)
> +{
> +	struct kvm_regs regs;
> +	int ret;
> +	int i;
>   

Your indent is off.

> +int kvm_arch_get_registers(CPUState *env)
> +{
> +	struct kvm_regs regs;
> +	uint32_t i, ret;
> +
> +	ret = kvm_vcpu_ioctl(env, KVM_GET_REGS, &regs);
> +	if (ret < 0)
> +		return ret;
> +
> +	env->ctr = regs.ctr;
> +	env->lr = regs.lr;
> +	env->xer = regs.xer;
> +	env->msr = regs.msr;
> +	/* calculate hflags based on the current msr using the ppc qemu helper */
> +	hreg_compute_hflags(env);
>   

Do you need this?  Practically speaking, I don't even think we need to 
maintain them on x86 anymore.

> diff --git a/target-ppc/kvm_ppc.c b/target-ppc/kvm_ppc.c
> new file mode 100644
> index 0000000..b2b56df
> --- /dev/null
> +++ b/target-ppc/kvm_ppc.c
>   

Hence my confusion.  These are just kvm related helper?

I don't know that kvm_ppc.c is a very information name for this sort of 
stuff.  Since this is really host specific, not target specific, why not 
move it out of target-ppc.

Regards,

Anthony Liguori

WARNING: multiple messages have this Message-ID (diff)
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Cc: kvm-ppc@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb.
Date: Thu, 11 Dec 2008 15:30:10 -0600	[thread overview]
Message-ID: <49418662.8000205@codemonkey.ws> (raw)
In-Reply-To: <a8986b56713649a250fb5f2435df33792d75e25c.1229027683.git.hollisb@us.ibm.com>

Hollis Blanchard wrote:
> Implement hooks called by generic KVM code.
>
> Also add code that will copy the host's CPU and timebase frequencies to the
> guest, which is necessary on KVM because the guest can directly access the
> timebase.
>
> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
> ---
>  Makefile.target      |    3 +
>  configure            |    6 ++
>  target-ppc/helper.c  |    5 +
>  target-ppc/kvm.c     |  212 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  target-ppc/kvm_ppc.c |  105 +++++++++++++++++++++++++
>  target-ppc/kvm_ppc.h |   15 ++++
>  6 files changed, 346 insertions(+), 0 deletions(-)
>  create mode 100644 target-ppc/kvm.c
>  create mode 100644 target-ppc/kvm_ppc.c
>  create mode 100644 target-ppc/kvm_ppc.h
>
> diff --git a/Makefile.target b/Makefile.target
> index 7152dff..d01231d 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -652,6 +652,9 @@ OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
>  OBJS+= unin_pci.o ppc_chrp.o
>  # PowerPC 4xx boards
>  OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
> +ifdef CONFIG_KVM
> +OBJS+= kvm_ppc.o
> +endif
>   

Shouldn't you be kvm.o?  If your file lives in target-ppc/kvm.c, it'll 
just work.

>  diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> new file mode 100644
> index 0000000..90b943b
> --- /dev/null
> +++ b/target-ppc/kvm.c
> @@ -0,0 +1,212 @@
> +int kvm_arch_put_registers(CPUState *env)
> +{
> +	struct kvm_regs regs;
> +	int ret;
> +	int i;
>   

Your indent is off.

> +int kvm_arch_get_registers(CPUState *env)
> +{
> +	struct kvm_regs regs;
> +	uint32_t i, ret;
> +
> +	ret = kvm_vcpu_ioctl(env, KVM_GET_REGS, &regs);
> +	if (ret < 0)
> +		return ret;
> +
> +	env->ctr = regs.ctr;
> +	env->lr = regs.lr;
> +	env->xer = regs.xer;
> +	env->msr = regs.msr;
> +	/* calculate hflags based on the current msr using the ppc qemu helper */
> +	hreg_compute_hflags(env);
>   

Do you need this?  Practically speaking, I don't even think we need to 
maintain them on x86 anymore.

> diff --git a/target-ppc/kvm_ppc.c b/target-ppc/kvm_ppc.c
> new file mode 100644
> index 0000000..b2b56df
> --- /dev/null
> +++ b/target-ppc/kvm_ppc.c
>   

Hence my confusion.  These are just kvm related helper?

I don't know that kvm_ppc.c is a very information name for this sort of 
stuff.  Since this is really host specific, not target specific, why not 
move it out of target-ppc.

Regards,

Anthony Liguori

  parent reply	other threads:[~2008-12-11 21:30 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11 20:52 PowerPC KVM support Hollis Blanchard
2008-12-11 20:52 ` [Qemu-devel] " Hollis Blanchard
2008-12-11 20:52 ` [PATCH 1/6] Include headers for types used in helper_regs.h Hollis Blanchard
2008-12-11 20:52   ` [Qemu-devel] " Hollis Blanchard
2008-12-11 20:52 ` [PATCH 2/6] kvm: sync vcpu state during initialization Hollis Blanchard
2008-12-11 20:52   ` [Qemu-devel] " Hollis Blanchard
2008-12-11 20:57   ` Hollis Blanchard
2008-12-11 20:57     ` [Qemu-devel] " Hollis Blanchard
2008-12-11 21:24   ` [Qemu-devel] " Anthony Liguori
2008-12-11 21:24     ` Anthony Liguori
2008-12-13  0:23     ` [Qemu-devel] [PATCH 2/6] kvm: sync vcpu state during Hollis Blanchard
2008-12-13  0:23       ` [Qemu-devel] [PATCH 2/6] kvm: sync vcpu state during initialization Hollis Blanchard
2008-12-13  0:24       ` [Qemu-devel] [PATCH 2/6] kvm: sync vcpu state during Hollis Blanchard
2008-12-13  0:24         ` [Qemu-devel] [PATCH 2/6] kvm: sync vcpu state during initialization Hollis Blanchard
2008-12-13 16:37         ` Anthony Liguori
2008-12-13 16:37           ` Anthony Liguori
2008-12-11 20:52 ` [PATCH 3/6] Enable KVM for ppcemb Hollis Blanchard
2008-12-11 20:52   ` [Qemu-devel] " Hollis Blanchard
2008-12-11 21:19   ` Blue Swirl
2008-12-12  0:04     ` Hollis Blanchard
2008-12-11 21:30   ` Anthony Liguori [this message]
2008-12-11 21:30     ` Anthony Liguori
2008-12-11 22:54     ` Hollis Blanchard
2008-12-11 22:54       ` Hollis Blanchard
2008-12-14  1:37       ` Hollis Blanchard
2008-12-14  1:37         ` Hollis Blanchard
2008-12-14  3:29         ` Anthony Liguori
2008-12-14  3:29           ` Anthony Liguori
2008-12-11 20:52 ` [PATCH 4/6] Implement device tree support needed for Bamboo emulation Hollis Blanchard
2008-12-11 20:52   ` [Qemu-devel] " Hollis Blanchard
2008-12-11 21:33   ` [Qemu-devel] [PATCH 4/6] Implement device tree support needed Anthony Liguori
2008-12-11 21:33     ` [Qemu-devel] [PATCH 4/6] Implement device tree support needed for Bamboo emulation Anthony Liguori
2008-12-11 20:52 ` [PATCH 5/6] PowerPC 440EP SoC emulation Hollis Blanchard
2008-12-11 20:52   ` [Qemu-devel] " Hollis Blanchard
2008-12-11 20:52 ` [PATCH 6/6] IBM PowerPC 440EP Bamboo reference board emulation Hollis Blanchard
2008-12-11 20:52   ` [Qemu-devel] " Hollis Blanchard
2008-12-11 21:25   ` Blue Swirl
2008-12-11 21:25     ` Blue Swirl
2008-12-11 21:39   ` [Qemu-devel] [PATCH 6/6] IBM PowerPC 440EP Bamboo reference board Anthony Liguori
2008-12-11 21:39     ` [Qemu-devel] [PATCH 6/6] IBM PowerPC 440EP Bamboo reference board emulation Anthony Liguori
2008-12-11 23:08     ` [Qemu-devel] [PATCH 6/6] IBM PowerPC 440EP Bamboo reference Hollis Blanchard
2008-12-11 23:08       ` [Qemu-devel] [PATCH 6/6] IBM PowerPC 440EP Bamboo reference board emulation Hollis Blanchard

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=49418662.8000205@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=qemu-devel@nongnu.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 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.