diff mbox

[23/24] Get CONFIG_CPU_EMULATION back to life

Message ID 67026adfd83b7e99dd1425ed9a7d7594e5543ad6.1253272938.git.quintela@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Juan Quintela Sept. 18, 2009, 11:41 a.m. UTC
Code compile with --disable-cpu-emulation, and that don't compile
tcg.  This is the minimal set of changes to get it working

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 Makefile.target         |    6 ++++--
 configure               |    6 ++++--
 exec.c                  |    2 ++
 target-i386/fake-exec.c |    4 ----
 vl.c                    |    2 +-
 5 files changed, 11 insertions(+), 9 deletions(-)

Comments

Marcelo Tosatti Sept. 18, 2009, 7:54 p.m. UTC | #1
On Fri, Sep 18, 2009 at 01:41:34PM +0200, Juan Quintela wrote:
> Code compile with --disable-cpu-emulation, and that don't compile
> tcg.  This is the minimal set of changes to get it working

Better see this upstreamed (and perhaps remove support from qemu-kvm, 
unless someone disagrees).

> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  Makefile.target         |    6 ++++--
>  configure               |    6 ++++--
>  exec.c                  |    2 ++
>  target-i386/fake-exec.c |    4 ----
>  vl.c                    |    2 +-
>  5 files changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/Makefile.target b/Makefile.target
> index 4a5352b..6846451 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -33,8 +33,10 @@ all: $(PROGS)
> 
>  #########################################################
>  # cpu emulator library
> -libobj-y = exec.o translate-all.o cpu-exec.o translate.o host-utils.o
> -libobj-y += tcg/tcg.o tcg/tcg-runtime.o
> +libobj-y = exec.o cpu-exec.o host-utils.o
> +libobj-$(CONFIG_NO_CPU_EMULATION) += fake-exec.o
> +libobj-$(CONFIG_CPU_EMULATION) += translate-all.o translate.o
> +libobj-$(CONFIG_CPU_EMULATION) += tcg/tcg.o tcg/tcg-runtime.o
>  libobj-$(CONFIG_SOFTFLOAT) += fpu/softfloat.o
>  libobj-$(CONFIG_NOSOFTFLOAT) += fpu/softfloat-native.o
>  libobj-y += op_helper.o helper.o
> diff --git a/configure b/configure
> index 289459a..ee37ea1 100755
> --- a/configure
> +++ b/configure
> @@ -2078,8 +2078,10 @@ fi
>  if test "$need_offsetof" = "yes" ; then
>    echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak
>  fi
> -if test $cpu_emulation = "no"; then
> -  echo "NO_CPU_EMULATION=1" >> $config_host_mak
> +if test $cpu_emulation = "yes"; then
> +  echo "CONFIG_CPU_EMULATION=y" >> $config_host_mak
> +else
> +  echo "CONFIG_NO_CPU_EMULATION=y" >> $config_host_mak
>  fi
> 
>  # XXX: suppress that
> diff --git a/exec.c b/exec.c
> index dd8881c..aff9ec8 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3795,7 +3795,9 @@ void dump_exec_info(FILE *f,
>      cpu_fprintf(f, "TB flush count      %d\n", tb_flush_count);
>      cpu_fprintf(f, "TB invalidate count %d\n", tb_phys_invalidate_count);
>      cpu_fprintf(f, "TLB flush count     %d\n", tlb_flush_count);
> +#ifdef CONFIG_PROFILER
>      tcg_dump_info(f, cpu_fprintf);
> +#endif
>  }
> 
>  #if !defined(CONFIG_USER_ONLY)
> diff --git a/target-i386/fake-exec.c b/target-i386/fake-exec.c
> index 737286d..dfa202d 100644
> --- a/target-i386/fake-exec.c
> +++ b/target-i386/fake-exec.c
> @@ -45,10 +45,6 @@ int cpu_x86_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size_ptr
>      return 0;
>  }
> 
> -void flush_icache_range(unsigned long start, unsigned long stop)
> -{
> -}
> -
>  void optimize_flags_init(void)
>  {
>  }
> diff --git a/vl.c b/vl.c
> index 88bd3eb..5d4e18f 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -5627,7 +5627,7 @@ int main(int argc, char **argv, char **envp)
> 
>          ret = kvm_init(smp_cpus);
>          if (ret < 0) {
> -#if defined(KVM_UPSTREAM) || defined(NO_CPU_EMULATION)
> +#if defined(KVM_UPSTREAM) || defined(CONFIG_NO_CPU_EMULATION)
>              fprintf(stderr, "failed to initialize KVM\n");
>              exit(1);
>  #endif
> -- 
> 1.6.2.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Juan Quintela Sept. 18, 2009, 9:44 p.m. UTC | #2
Marcelo Tosatti <mtosatti@redhat.com> wrote:
> On Fri, Sep 18, 2009 at 01:41:34PM +0200, Juan Quintela wrote:
>> Code compile with --disable-cpu-emulation, and that don't compile
>> tcg.  This is the minimal set of changes to get it working
>
> Better see this upstreamed (and perhaps remove support from qemu-kvm, 
> unless someone disagrees).

I am told it is needed for ia64 support.  But as ia64 port is not being
too active, it don't matter too much.

Later, Juan.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Avi Kivity Sept. 21, 2009, 9:13 a.m. UTC | #3
On 09/19/2009 12:44 AM, Juan Quintela wrote:
> Marcelo Tosatti<mtosatti@redhat.com>  wrote:
>    
>> On Fri, Sep 18, 2009 at 01:41:34PM +0200, Juan Quintela wrote:
>>      
>>> Code compile with --disable-cpu-emulation, and that don't compile
>>> tcg.  This is the minimal set of changes to get it working
>>>        
>> Better see this upstreamed (and perhaps remove support from qemu-kvm,
>> unless someone disagrees).
>>      
> I am told it is needed for ia64 support.  But as ia64 port is not being
> too active, it don't matter too much.
>    

Applied, but can you look at upstreaming this?  Thanks.
Juan Quintela Sept. 21, 2009, 9:36 a.m. UTC | #4
Avi Kivity <avi@redhat.com> wrote:
> On 09/19/2009 12:44 AM, Juan Quintela wrote:
>> Marcelo Tosatti<mtosatti@redhat.com>  wrote:
>>    
>>> On Fri, Sep 18, 2009 at 01:41:34PM +0200, Juan Quintela wrote:
>>>      
>>>> Code compile with --disable-cpu-emulation, and that don't compile
>>>> tcg.  This is the minimal set of changes to get it working
>>>>        
>>> Better see this upstreamed (and perhaps remove support from qemu-kvm,
>>> unless someone disagrees).
>>>      
>> I am told it is needed for ia64 support.  But as ia64 port is not being
>> too active, it don't matter too much.
>>    
>
> Applied, but can you look at upstreaming this?  Thanks.

Yeap, but upstream would not agree with this half-done implementation.
Will took at upstreaming the proper fix, but it will take a while.

Later, Juan.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Makefile.target b/Makefile.target
index 4a5352b..6846451 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -33,8 +33,10 @@  all: $(PROGS)

 #########################################################
 # cpu emulator library
-libobj-y = exec.o translate-all.o cpu-exec.o translate.o host-utils.o
-libobj-y += tcg/tcg.o tcg/tcg-runtime.o
+libobj-y = exec.o cpu-exec.o host-utils.o
+libobj-$(CONFIG_NO_CPU_EMULATION) += fake-exec.o
+libobj-$(CONFIG_CPU_EMULATION) += translate-all.o translate.o
+libobj-$(CONFIG_CPU_EMULATION) += tcg/tcg.o tcg/tcg-runtime.o
 libobj-$(CONFIG_SOFTFLOAT) += fpu/softfloat.o
 libobj-$(CONFIG_NOSOFTFLOAT) += fpu/softfloat-native.o
 libobj-y += op_helper.o helper.o
diff --git a/configure b/configure
index 289459a..ee37ea1 100755
--- a/configure
+++ b/configure
@@ -2078,8 +2078,10 @@  fi
 if test "$need_offsetof" = "yes" ; then
   echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak
 fi
-if test $cpu_emulation = "no"; then
-  echo "NO_CPU_EMULATION=1" >> $config_host_mak
+if test $cpu_emulation = "yes"; then
+  echo "CONFIG_CPU_EMULATION=y" >> $config_host_mak
+else
+  echo "CONFIG_NO_CPU_EMULATION=y" >> $config_host_mak
 fi

 # XXX: suppress that
diff --git a/exec.c b/exec.c
index dd8881c..aff9ec8 100644
--- a/exec.c
+++ b/exec.c
@@ -3795,7 +3795,9 @@  void dump_exec_info(FILE *f,
     cpu_fprintf(f, "TB flush count      %d\n", tb_flush_count);
     cpu_fprintf(f, "TB invalidate count %d\n", tb_phys_invalidate_count);
     cpu_fprintf(f, "TLB flush count     %d\n", tlb_flush_count);
+#ifdef CONFIG_PROFILER
     tcg_dump_info(f, cpu_fprintf);
+#endif
 }

 #if !defined(CONFIG_USER_ONLY)
diff --git a/target-i386/fake-exec.c b/target-i386/fake-exec.c
index 737286d..dfa202d 100644
--- a/target-i386/fake-exec.c
+++ b/target-i386/fake-exec.c
@@ -45,10 +45,6 @@  int cpu_x86_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size_ptr
     return 0;
 }

-void flush_icache_range(unsigned long start, unsigned long stop)
-{
-}
-
 void optimize_flags_init(void)
 {
 }
diff --git a/vl.c b/vl.c
index 88bd3eb..5d4e18f 100644
--- a/vl.c
+++ b/vl.c
@@ -5627,7 +5627,7 @@  int main(int argc, char **argv, char **envp)

         ret = kvm_init(smp_cpus);
         if (ret < 0) {
-#if defined(KVM_UPSTREAM) || defined(NO_CPU_EMULATION)
+#if defined(KVM_UPSTREAM) || defined(CONFIG_NO_CPU_EMULATION)
             fprintf(stderr, "failed to initialize KVM\n");
             exit(1);
 #endif