From patchwork Fri Sep 18 11:41:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 48513 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8IBgMvW013993 for ; Fri, 18 Sep 2009 11:42:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756736AbZIRLmP (ORCPT ); Fri, 18 Sep 2009 07:42:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756756AbZIRLmM (ORCPT ); Fri, 18 Sep 2009 07:42:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49555 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756661AbZIRLmK (ORCPT ); Fri, 18 Sep 2009 07:42:10 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8IBgELf025497 for ; Fri, 18 Sep 2009 07:42:14 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8IBfa98017440; Fri, 18 Sep 2009 07:42:09 -0400 From: Juan Quintela To: kvm@vger.kernel.org Subject: [PATCH 23/24] Get CONFIG_CPU_EMULATION back to life Date: Fri, 18 Sep 2009 13:41:34 +0200 Message-Id: <67026adfd83b7e99dd1425ed9a7d7594e5543ad6.1253272938.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- 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