All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: jyoung5@us.ibm.com
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>,
	hollisb <hollisb@linux.vnet.ibm.com>
Subject: Re: [RFC] Qemu powerpc work around
Date: Tue, 12 Feb 2008 15:44:29 -0600	[thread overview]
Message-ID: <47B2133D.4090801@codemonkey.ws> (raw)
In-Reply-To: <1202852254.16861.6.camel@thinkpad.austin.ibm.com>

Jerone Young wrote:
> So the recent code in qemu cvs has problem powerpc. So what I have done
> is mainly work around this in the build system, by creating
> ppcemb_kvm-sofmmu target. Along with this is a fake-exec.c that stubs
> out the functions that are no longer defined (something done by Anthony
> Liguori attempting to fix qemu_cvs). What do folks think about this
> approach, for us all we really need is a qemu that is not built with tcg
> dependency.
>
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
>
> diff --git a/configure b/configure
> --- a/configure
> +++ b/configure
> @@ -102,7 +102,7 @@ fi
>  fi
>  
>  if [ "$arch" = "powerpc" ]; then
> -    target_exec="ppcemb-softmmu"
> +    target_exec="ppcemb_kvm-softmmu"
>  fi
>  
>  #configure user dir
> diff --git a/qemu/Makefile.target b/qemu/Makefile.target
> --- a/qemu/Makefile.target
> +++ b/qemu/Makefile.target
> @@ -21,6 +21,9 @@ TARGET_BASE_ARCH:=ppc
>  TARGET_BASE_ARCH:=ppc
>  endif
>  ifeq ($(TARGET_ARCH), ppcemb)
> +TARGET_BASE_ARCH:=ppc
> +endif
> +ifeq ($(TARGET_ARCH), ppcemb_kvm)
>  TARGET_BASE_ARCH:=ppc
>  endif
>  ifeq ($(TARGET_ARCH), sparc64)
> @@ -179,22 +182,26 @@ all: $(PROGS)
>  
>  #########################################################
>  # cpu emulator library
> -LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
> -        translate.o op.o host-utils.o
> +LIBOBJS=exec.o kqemu.o cpu-exec.o\
> +        host-utils.o
> +
> +CPPFLAGS+=-I$(SRC_PATH)
> +
> +ifeq ($(USE_KVM), 1)
> +LIBOBJS+=qemu-kvm.o
> +endif
> +ifdef CONFIG_SOFTFLOAT
> +LIBOBJS+=fpu/softfloat.o
> +else
> +LIBOBJS+=fpu/softfloat-native.o
> +endif
> +CPPFLAGS+=-I$(SRC_PATH)/fpu
> +
> +ifeq ($(TARGET_ARCH), i386)
>  # TCG code generator
>  LIBOBJS+= tcg/tcg.o tcg/tcg-dyngen.o tcg/tcg-runtime.o
>  CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
> -ifeq ($(USE_KVM), 1)
> -LIBOBJS+=qemu-kvm.o
> -endif
> -ifdef CONFIG_SOFTFLOAT
> -LIBOBJS+=fpu/softfloat.o
> -else
> -LIBOBJS+=fpu/softfloat-native.o
> -endif
> -CPPFLAGS+=-I$(SRC_PATH)/fpu
> -
> -ifeq ($(TARGET_ARCH), i386)
> +LIBOBJS+=translate-all.o op.o translate.o
>  LIBOBJS+=helper.o helper2.o
>  ifeq ($(USE_KVM), 1)
>  LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
> @@ -203,6 +210,10 @@ endif
>  endif
>  
>  ifeq ($(TARGET_ARCH), x86_64)
> +# TCG code generator
> +LIBOBJS+= tcg/tcg.o tcg/tcg-dyngen.o tcg/tcg-runtime.o
> +CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
> +LIBOBJS+=translate-all.o op.o translate.o
>  LIBOBJS+=helper.o helper2.o
>  ifeq ($(USE_KVM), 1)
>  LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
> @@ -214,6 +225,9 @@ LIBOBJS+= op_helper.o helper.o
>  LIBOBJS+= op_helper.o helper.o
>  ifeq ($(USE_KVM), 1)
>  LIBOBJS+= qemu-kvm-powerpc.o
> +LIBOBJS+= fake-exec.o
> +else
> +LIBOBJS+=translate-all.o op.o translate.o
>  endif
>  endif
>  
> diff --git a/qemu/configure b/qemu/configure
> --- a/qemu/configure
> +++ b/qemu/configure
> @@ -547,7 +547,7 @@ if test -z "$target_list" ; then
>  if test -z "$target_list" ; then
>  # these targets are portable
>      if [ "$softmmu" = "yes" ] ; then
> -        target_list="i386-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu m68k-softmmu sh4-softmmu sh4eb-softmmu cris-softmmu"
> +        target_list="i386-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu m68k-softmmu sh4-softmmu sh4eb-softmmu cris-softmmu ppcemb_kvm-softmmu"
>      fi
>  # the following are Linux specific
>      if [ "$linux_user" = "yes" ] ; then
> @@ -1027,6 +1027,7 @@ target_bigendian="no"
>  [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
>  [ "$target_cpu" = "ppc" ] && target_bigendian=yes
>  [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
> +[ "$target_cpu" = "ppcemb_kvm" ] && target_bigendian=yes
>  [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
>  [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
>  [ "$target_cpu" = "mips" ] && target_bigendian=yes
> @@ -1149,6 +1150,12 @@ elif test "$target_cpu" = "ppcemb" ; the
>    echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
>    echo "#define TARGET_PPC 1" >> $config_h
>    echo "#define TARGET_PPCEMB 1" >> $config_h
> +elif test "$target_cpu" = "ppcemb_kvm"; then
> +  echo "TARGET_ARCH=ppcemb_kvm" >> $config_mak
> +  echo "TARGET_ABI_DIR=ppc" >> $config_mak
> +  echo "#define TARGET_ARCH \"ppcemb\" " >> $config_mak
> +  echo "#define TARGET_PPC 1" >> $config_h
> +  echo "#define TARGET_PPCEMB 1" >> $config_h
>    configure_kvm
>  elif test "$target_cpu" = "ppc64" ; then
>    echo "TARGET_ARCH=ppc64" >> $config_mak
> diff --git a/qemu/exec.c b/qemu/exec.c
> --- a/qemu/exec.c
> +++ b/qemu/exec.c
> @@ -35,7 +35,11 @@
>  
>  #include "cpu.h"
>  #include "exec-all.h"
> +
> +#if defined(TARGET_i386) || defined(TARGET_X86_64)
>  #include "tcg-target.h"
> +#endif
>   

This is wrong and will break QEMU.

You need to change the #define TARGET_PPCEMB to be something else like 
TARGET_PPCEMB_KVM.  Then you can change the above to
#if !defined(TARGET_PPCEMB_KVM)

You can still generate a #define TARGET_PPCEMB too to keep other things 
working.

Likewise, the same is true in the Makefile.  You can't conditionally 
link against TCG if it's x86_64, you need to conditionally link if it's 
anything but PPCEMB_KVM.

Regards,

Anthony Liguori


-------------------------------------------------------------------------
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/

  reply	other threads:[~2008-02-12 21:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12 21:37 [RFC] Qemu powerpc work around Jerone Young
2008-02-12 21:44 ` Anthony Liguori [this message]
2008-02-12 21:53   ` Jerone Young
2008-02-12 22:03     ` Anthony Liguori
2008-02-12 22:50       ` Jerone Young
2008-02-13  0:47         ` Anthony Liguori
2008-02-13  7:29 ` Avi Kivity
2008-02-13 17:39   ` Jerone Young
2008-02-13 18:55     ` Anthony Liguori
2008-02-13 19:27       ` [PATCH] " Jerone Young
2008-02-13 20:20         ` Anthony Liguori
2008-02-13 20:29       ` [RFC] " Jerone Young
2008-02-14  9:33         ` Avi Kivity

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=47B2133D.4090801@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=hollisb@linux.vnet.ibm.com \
    --cc=jyoung5@us.ibm.com \
    --cc=kvm-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.