Skip to contentSkip to conversation

Remove --disable-cpu-emulation for qemu

PATCH In review Jerone Young 4 participants 11 messages Jun 10, 2008 – Jun 18, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove --disable-cpu-emulation for qemu

These patches remove all traces of --disable-cpu-emulation configuration flag.

6 files changed, 2 insertions(+), 227 deletions(-)
qemu/Makefile.target         |    6 --
qemu/configure               |   13 -----
qemu/target-i386/fake-exec.c |   54 ---------------------
qemu/target-ia64/fake-exec.c |   44 -----------------
qemu/target-ppc/fake-exec.c  |  104 ------------------------------------------
qemu/vl.c                    |    8 ---
#1 lore raw

PATCH 1/1 Remove qemu files and entries associated with --disable-cpu-emulation configure argument

6 files changed, 227 deletions(-)
qemu/Makefile.target         |    4 -
qemu/configure               |   13 -----
qemu/target-i386/fake-exec.c |   54 ---------------------
qemu/target-ia64/fake-exec.c |   44 -----------------
qemu/target-ppc/fake-exec.c  |  104 ------------------------------------------
qemu/vl.c                    |    8 ---
qemu/Makefile.target +0 -4
@@ -192,11 +192,7 @@ all: $(PROGS)
 # cpu emulator library
 LIBOBJS=exec.o kqemu.o cpu-exec.o host-utils.o
 
-ifeq ($(NO_CPU_EMULATION), 1)
-LIBOBJS+úke-exec.o
-else
 LIBOBJS+= translate-all.o translate.o
-endif
 ifdef CONFIG_DYNGEN_OP
 LIBOBJS+=op.o
 endif
qemu/configure +0 -13
@@ -116,7 +116,6 @@ uname_release=""
 uname_release=""
 curses="yes"
 nptl="yes"
-cpu_emulation="yes"
 device_tree_support=""
 
 # OS specific
@@ -353,8 +352,6 @@ for opt do
   ;;
   --disable-nptl) nptl="no"
   ;;
-  --disable-cpu-emulation) cpu_emulation="no"
-  ;;
   --disable-libfdt) device_tree_support="no"
   ;;
   *) echo "ERROR: unknown option $opt"; exit 1
@@ -463,7 +460,6 @@ echo "  --fmod-inc               path to
 echo "  --fmod-inc               path to FMOD includes"
 echo "  --enable-uname-release=R Return R for uname -r in usermode emulation"
 echo "  --sparc_cpu=V            Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
-echo "  --disable-cpu-emulation  disables use of qemu cpu emulation code"
 echo "  --disable-libfdt         disables use of libfdt support for device tree"
 echo ""
 echo "NOTE: The object files are built at the place where configure is launched"
@@ -926,7 +922,6 @@ fi
 fi
 echo "kqemu support     $kqemu"
 echo "kvm support       $kvm"
-echo "CPU emulation     $cpu_emulation"
 if test $cpu = "powerpc"; then
 echo "libfdt support    $device_tree_support"
 fi
@@ -1291,13 +1286,6 @@ interp_prefix1=`echo "$interp_prefix" | 
 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
 
-disable_cpu_emulation() {
-  if test $cpu_emulation = "no"; then
-    echo "#define NO_CPU_EMULATION 1" >> $config_h
-    echo "NO_CPU_EMULATION=1" >> $config_mak
-  fi
-}
-
 configure_kvm() {
   if test $kvm = "yes" -a "$target_softmmu" = "yes" -a \
           \( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \); then
@@ -1308,7 +1296,6 @@ configure_kvm() {
 	echo "USE_KVM_PIT=1" >> $config_mak
 	echo "#define USE_KVM_PIT 1" >> $config_h
     fi
-    disable_cpu_emulation
   fi
 }
 
qemu/target-i386/fake-exec.c deleted +0 -54

54 lines not on this page · raw message

qemu/target-ia64/fake-exec.c deleted +0 -44

44 lines not on this page · raw message

qemu/target-ppc/fake-exec.c deleted +0 -104

104 lines not on this page · raw message

qemu/vl.c +0 -8
@@ -7786,9 +7786,7 @@ static void help(int exitcode)
            "-no-kqemu       disable KQEMU kernel module usage\n"
 #endif
 #ifdef USE_KVM
-#ifndef NO_CPU_EMULATION
 	   "-no-kvm         disable KVM hardware virtualization\n"
-#endif
 	   "-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC\n"
 	   "-no-kvm-pit	    disable KVM kernel mode PIT\n"
 #endif
@@ -7997,9 +7995,7 @@ const QEMUOption qemu_options[] = {
     { "kernel-kqemu", 0, QEMU_OPTION_kernel_kqemu },
 #endif
 #ifdef USE_KVM
-#ifndef NO_CPU_EMULATION
     { "no-kvm", 0, QEMU_OPTION_no_kvm },
-#endif
     { "no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip },
     { "no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit },
 #endif
@@ -9083,10 +9079,6 @@ int main(int argc, char **argv)
 	if (kvm_qemu_init() < 0) {
 	    extern int kvm_allowed;
 	    fprintf(stderr, "Could not initialize KVM, will disable KVM support\n");
-#ifdef NO_CPU_EMULATION
-	    fprintf(stderr, "Compiled with --disable-cpu-emulation, exiting.\n");
-	    exit(1);
-#endif
 	    kvm_allowed = 0;
 	}
     }
#2 lore raw

PATCH 1/1 Create dyngen dependency for exec.o for those who still have dyngen

In reply to Jerone Young
1 file changed, 2 insertions(+)

qemu/Makefile.target | 2 ++

This patch adds a make file dependency for compiling exec.c with archs that still have dyngen dependencies.

This allows powerpc qemu to now compile without the --disable-cpu-emulation flag.

qemu/Makefile.target +2 -0
@@ -334,6 +334,8 @@ op.o: op.c
 
 machine.o: machine.c
 	$(CC) $(OP_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+
+exec.o : exec.c $(OPC_H)
 
 # HELPER_CFLAGS is used for all the code compiled with static register
 # variables
#3 lore raw
In reply to Jerone Young

After getting some private emails on this patch. I felt that I needed to say that these patches probably should not go in.

There is some value in having a kvm only binary. So having the --disable cpu-emulation flag still has value.

So best not to remove this honestly until everything completely merges with upstream qemu.

Quoted 15 lines · Jerone Young

These patches remove all traces of --disable-cpu-emulation configuration flag.

6 files changed, 2 insertions(+), 227 deletions(-)
qemu/Makefile.target         |    6 --
qemu/configure               |   13 -----
qemu/target-i386/fake-exec.c |   54 ---------------------
qemu/target-ia64/fake-exec.c |   44 -----------------
qemu/target-ppc/fake-exec.c  |  104 ------------------------------------------
qemu/vl.c                    |    8 ---

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 3 lines · Jerone Young

After getting some private emails on this patch. I felt that I needed to say that these patches probably should not go in.

I agree with your sentiment, --disable-cpu-emulation is a terrible hack that's is only going to make things difficult to merge with upstream.

The proper solution is to implement a -kvm target type much like -softmmu and -linux-user.

So I think this patch series should go in.

Regards,

Anthony Liguori

Quoted 31 lines

There is some value in having a kvm only binary. So having the --disable cpu-emulation flag still has value.

So best not to remove this honestly until everything completely merges with upstream qemu.

Quoted 11 lines · Jerone Young

These patches remove all traces of --disable-cpu-emulation configuration flag.

6 files changed, 2 insertions(+), 227 deletions(-)
qemu/Makefile.target         |    6 --
qemu/configure               |   13 -----
qemu/target-i386/fake-exec.c |   54 ---------------------
qemu/target-ia64/fake-exec.c |   44 -----------------
qemu/target-ppc/fake-exec.c  |  104 ------------------------------------------
qemu/vl.c                    |    8 ---
Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 3 lines · Anthony Liguori
Quoted 2 lines

After getting some private emails on this patch. I felt that I needed to say that these patches probably should not go in.

So I think this patch series should go in.

I'm (one of?) the one(s) who e-mail Jerone about the patch.

I added a similar patch to the Ubuntu packages for the Hardy release, because we wanted to build with gcc 4.x, and the buzz at the time was that TCG was still somewhat experimental, so I wasn't too hot on the idea of supporting it for 5 years. The existence of --disable-cpu-emulation keeps me from having to maintain a delta to do the same thing.

If TCG is considered stable, then I'm cool with not having a --disable-cpu-emulation switch, but if it's still considered pre-beta stuff, then I'd very much like to keep it. It should be trivial to leave it out, when we try (again) to get kvm and qemu merged and then we can deal with it some other way.

Signature · 3 lines
Soren Hansen               | 
Virtualisation specialist  | Ubuntu Server Team
Canonical Ltd.             | http://www.ubuntu.com/
#6 lore raw
In reply to Anthony Liguori

I figured you would say that ;-) Seeing how Soren (so that's 2 votes) is also fine with it, then let's just kick it to the crub and go ahead and include the patch.

Quoted 53 lines · Anthony Liguori
Quoted 3 lines · Jerone Young

After getting some private emails on this patch. I felt that I needed to say that these patches probably should not go in.

I agree with your sentiment, --disable-cpu-emulation is a terrible hack that's is only going to make things difficult to merge with upstream.

The proper solution is to implement a -kvm target type much like -softmmu and -linux-user.

So I think this patch series should go in.

Regards,

Anthony Liguori

Quoted 26 lines

There is some value in having a kvm only binary. So having the --disable cpu-emulation flag still has value.

So best not to remove this honestly until everything completely merges with upstream qemu.

Quoted 11 lines · Jerone Young

These patches remove all traces of --disable-cpu-emulation configuration flag.

6 files changed, 2 insertions(+), 227 deletions(-)
qemu/Makefile.target         |    6 --
qemu/configure               |   13 -----
qemu/target-i386/fake-exec.c |   54 ---------------------
qemu/target-ia64/fake-exec.c |   44 -----------------
qemu/target-ppc/fake-exec.c  |  104 ------------------------------------------
qemu/vl.c                    |    8 ---
Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to Jerone Young
Quoted 2 lines · Jerone Young

These patches remove all traces of --disable-cpu-emulation configuration flag.

Avi: can you apply this series? --disable-cpu-emulation doesn't compile on x86 for kvm-70. It would be better to revert it then trying to fix it since it serves no purpose anymore.

Regards,

Anthony Liguori

Quoted 14 lines
6 files changed, 2 insertions(+), 227 deletions(-)
qemu/Makefile.target         |    6 --
qemu/configure               |   13 -----
qemu/target-i386/fake-exec.c |   54 ---------------------
qemu/target-ia64/fake-exec.c |   44 -----------------
qemu/target-ppc/fake-exec.c  |  104 ------------------------------------------
qemu/vl.c                    |    8 ---

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
In reply to Jerone Young
Quoted 3 lines · Jerone Young

These patches remove all traces of --disable-cpu-emulation configuration flag.

I kind of like --disable-cpu-emulation. It means we have the choice of kvm-only (low footprint, shuts up the security people), qemu-only (running cross-arch or on older cpu), and mixed mode (I'm a distro so don't know what cpu I'm running on).

Well, actually, at least Fedora already supplies both plain qemu and qemu-kvm, so it seems they don't care much about mixed mode. I'll look at applying the patches.

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
#9 lore raw
Quoted 6 lines · Avi Kivity
Quoted 4 lines · Jerone Young

These patches remove all traces of --disable-cpu-emulation configuration flag.

Quoted 9 lines

I kind of like --disable-cpu-emulation. It means we have the choice of kvm-only (low footprint, shuts up the security people), qemu-only (running cross-arch or on older cpu), and mixed mode (I'm a distro so don't know what cpu I'm running on).

Well, actually, at least Fedora already supplies both plain qemu and qemu-kvm, so it seems they don't care much about mixed mode. I'll look at applying the patches.

Er, that only makes sense with Anthony's idea of a -kvm subtarget thrown in as well.

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
#10 lore raw
Quoted 12 lines · Avi Kivity
Quoted 11 lines · Avi Kivity
Quoted 4 lines · Jerone Young

These patches remove all traces of --disable-cpu-emulation configuration flag.

I kind of like --disable-cpu-emulation. It means we have the choice of kvm-only (low footprint, shuts up the security people), qemu-only (running cross-arch or on older cpu), and mixed mode (I'm a distro so don't know what cpu I'm running on).

Quoted 7 lines
Quoted 4 lines

Well, actually, at least Fedora already supplies both plain qemu and qemu-kvm, so it seems they don't care much about mixed mode. I'll look at applying the patches.

Er, that only makes sense with Anthony's idea of a -kvm subtarget thrown in as well.

The -kvm subtarget is really easy to implement. If anyone is interested in doing this, let me know and I'll point them in the right direction. The good thing about a -kvm subtarget is that we can introduce a CONFIG_KVM_ONLY #define which we can use to compile out l1_phys_map et al. That will give a much better RSS reduction than not linking in TCG. I doubt --disable-cpu-emulation really reduces RSS size an observable amount.

Regards,

Anthony Liguori