[Qemu-devel] OS Circular on KVM/KQEMU/QEMU

2007-05-18 Thread Kuniyasu Suzaki

Hello,

We release the script for OS Circular on QEMU/KQEMU/KVM.  OS Circular
is Internet Disk Image Distributor for VM.
OS Circular depended on Xen-HVM and required the CPU which includes
virtualization extension(Intel-VT or AMD-SVM). The script enables to
run OS Circular on normal x86 CPU because it selects QEMU or KQEMU
when the CPU don't have virtualization extension.
The script is effective on VMKNOPPIX. 

 VM KNOPPIX
 http://unit.aist.go.jp/itri/knoppix/vmknoppix/index-en.html
 OS Circular
 http://openlab.jp/oscircular/
 
 Script
 http://unit.aist.go.jp/itri/knoppix/vmknoppix/qemu-httpfuse.sh 
 ISO of VMKNOPPIX
 
ftp://unit.aist.go.jp/itri/knoppix/iso/knoppix_v5.1.1CD_20070104_xen3.0.4.1_vbox_ima-20070316+IPAFont_AC20070328.iso
 
 Bittorrent for ISO of VMKNOPPIX
 
http://unit.aist.go.jp/itri/knoppix/vmknoppix/knoppix_v5.1.1CD_20070104_xen3.0.4.1_vbox_ima-20070316+IPAFont_AC20070328.iso.torrent
 

*** USAGE ***
* Boot VMKNOPPIX. Select normal kernel at GRUB Menu. 
* Download qemu-httpfuse.sh. Change the permission. 
   # chmod a+x qemu-httpfuse.sh 

* After that run the script. It checks the CPU and select the best one
  among KVM, KQEMU and QEMU for OS Circular.
  # ./qemu-httpfuse.sh 

The Guest OS image is obtained by HTTP-FUSE CLOOP. Current available
OS is Debian GNU/Linux.

--
suzaki




Re: [Qemu-devel] Rewritten Linux kernel loader

2007-05-18 Thread Adam Lackorzynski
Hi,

On Thu May 17, 2007 at 14:06:57 -0700, H. Peter Anvin wrote:
 +/* Generate an initial boot sector which sets state and jump to
 +   a specified vector */
 +static int generate_bootsect(uint32_t gpr[8], uint16_t segs[6], uint16_t ip)
 +{
 +uint8_t bootsect[512], *p;
 +int i;
 +
 +if (bs_table[0] == NULL) {
 + fprintf(stderr, A disk image must be given for 'hda' when booting 
 + a Linux kernel\n);
 + exit(1);
 +}
 +
 +memset(bootsect, 0, sizeof(bootsect));
 +
 +/* Copy the MSDOS partition table if possible */
 +bdrv_read(bs_table[0], 0, bootsect, 1);
 +
 +/* Make sure we have a partition signature */
 +bootsect[0x510] = 0x55;
 +bootsect[0x511] = 0xaa;

These two should be decimal instead of hex.



Adam
-- 
Adam [EMAIL PROTECTED]
  Lackorzynski http://os.inf.tu-dresden.de/~adam/




[Qemu-devel] [PATCH] Fix sysrq support from the monitor mux

2007-05-18 Thread Jason Wessel
The monitor mux code calls uses the wrong opaque structure and crashes 
qemu.   This patch fixes it such that the sysrq support works correctly.


Signed-off-by: Jason Wessel [EMAIL PROTECTED]

Jason.


---
 vl.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: qemu/vl.c
===
--- qemu.orig/vl.c
+++ qemu/vl.c
@@ -1371,7 +1371,7 @@ static int mux_proc_byte(CharDriverState
 break;
 case 'b':
 if (chr-chr_event)
-chr-chr_event(chr-opaque, CHR_EVENT_BREAK);
+chr-chr_event(chr-handler_opaque, CHR_EVENT_BREAK);
 break;
 case 'c':
 /* Switch to the next registered device */


[Qemu-devel] qemu/target-mips cpu.h exec.h op.c op_helper.c ...

2007-05-18 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer ths 07/05/18 11:55:54

Modified files:
target-mips: cpu.h exec.h op.c op_helper.c translate.c 

Log message:
- Move FPU exception handling into helper functions, since they are big.
- Fix FP-conditional branches.
- Check FPU register mode at runtime, not translation time, as the F64
  status bit can change.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/cpu.h?cvsroot=qemur1=1.33r2=1.34
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/exec.h?cvsroot=qemur1=1.27r2=1.28
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/op.c?cvsroot=qemur1=1.56r2=1.57
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/op_helper.c?cvsroot=qemur1=1.46r2=1.47
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/translate.c?cvsroot=qemur1=1.79r2=1.80




Re: [Qemu-devel] Rewritten Linux kernel loader

2007-05-18 Thread H. Peter Anvin
Adam Lackorzynski wrote:
 +
 +/* Make sure we have a partition signature */
 +bootsect[0x510] = 0x55;
 +bootsect[0x511] = 0xaa;
 
 These two should be decimal instead of hex.
 

Oh, yes, duh.  510 and 511 or 0x1fe and 0x1ff.

-hpa




[Qemu-devel] qemu vl.c

2007-05-18 Thread Andrzej Zaborowski
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Andrzej Zaborowski balrog 07/05/18 17:46:59

Modified files:
.  : vl.c 

Log message:
Fix sysrq support from the monitor mux (originally by Jason Wessel).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/vl.c?cvsroot=qemur1=1.295r2=1.296




Re: [Qemu-devel] qemu/target-mips op.c translate.c

2007-05-18 Thread Stefan Weil
This change still does not fix the problems with
self-modifying code in Linux FPU emulation.

Linux FPU emulation calls mips_dsemul which calls flush_cache_sigtramp
which is local_r4k_flush_cache_sigtramp for MIPS 4KEc. So I had expected
that the new code would fix the problems with FPU emulation.

But programs like aptitude crash (caused by FPU emulation)
even with latest QEMU CVS.

Stefan


Thiemo Seufer schrieb:
 CVSROOT: /sources/qemu
 Module name: qemu
 Changes by: Thiemo Seufer ths 07/05/18 01:13:09

 Modified files:
 target-mips : op.c translate.c

 Log message:
 Work around the lack of proper handling for self-modifying code.

 CVSWeb URLs:
 http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/op.c?cvsroot=qemur1=1.55r2=1.56
 http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/translate.c?cvsroot=qemur1=1.78r2=1.79




Re: [Qemu-devel] qemu/target-mips op.c translate.c

2007-05-18 Thread Thiemo Seufer
Stefan Weil wrote:
 This change still does not fix the problems with
 self-modifying code in Linux FPU emulation.
 
 Linux FPU emulation calls mips_dsemul which calls flush_cache_sigtramp
 which is local_r4k_flush_cache_sigtramp for MIPS 4KEc. So I had expected
 that the new code would fix the problems with FPU emulation.
 
 But programs like aptitude crash (caused by FPU emulation)
 even with latest QEMU CVS.

Indeed, it fixes gdb breakpoints, though. (Which means I believe by
now Paul was right with his analysis of the FPU problem.)


Thiemo




Re: [Qemu-devel] qemu/target-mips op.c translate.c

2007-05-18 Thread Paul Brook
On Friday 18 May 2007, Thiemo Seufer wrote:
 Stefan Weil wrote:
  This change still does not fix the problems with
  self-modifying code in Linux FPU emulation.
 
  Linux FPU emulation calls mips_dsemul which calls flush_cache_sigtramp
  which is local_r4k_flush_cache_sigtramp for MIPS 4KEc. So I had expected
  that the new code would fix the problems with FPU emulation.
 
  But programs like aptitude crash (caused by FPU emulation)
  even with latest QEMU CVS.

 Indeed, it fixes gdb breakpoints, though. (Which means I believe by
 now Paul was right with his analysis of the FPU problem.)

I think Daniel also mentioned how to fix breakpoints properly.

Paul




Re: [Qemu-devel] Block driver and constant sector size

2007-05-18 Thread Paul Brook
On Saturday 12 May 2007, Jonathan Phenix wrote:
 Hi,

 currently the block driver in qemu only handles blocks (or sectors)
 which are 512 bytes long, 
...
 Then, each probe functions should be modified to reject sector size
 which is not 512 bytes, except for the raw block driver, which will be
 modified to accept any block sizes. This change would probably solve the
 whole problem without having a negative impact on the rest of the code.

 Is it the right way to solve the problem? If this solution is accepted,
 I will code it and submit a patch.

Seems like it might just be simpler to have the qemu block ABI use bytes 
rather than blocks. Maybe with some common helper functions for doing R/M/W 
on hard sectored devices.

By adding variable sized sectors you're just shifting complexity from the 
block backends to the device emulation.

Paul




[Qemu-devel] support 64-bit compile on Solaris 10/X86

2007-05-18 Thread Ben Taylor

This set of patches allows 64-bit Solaris 10/11 X86 to compile qemu in a 64bit
environment.  It requires a 64-bit libsdl, but has been tested with all the 
tests
(sparc, arm, mips, mipsel, linux-i386, and DamnSmallLinux)

Ben

--- qemu.ORIG/Makefile.target	2007-05-16 07:59:39.0 -0400
+++ qemu/Makefile.target	2007-05-18 10:21:33.498971000 -0400
@@ -120,7 +120,10 @@
 endif
 
 ifeq ($(ARCH),x86_64)
-BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+  BASE_LDFLAGS+=-m64
+  ifneq ($(CONFIG_SOLARIS),yes)
+BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+  endif
 endif
 
 ifeq ($(ARCH),ppc)
@@ -518,6 +521,13 @@
   endif
 endif
 
+ifeq ($(ARCH),x86_64)
+  VL_LDFLAGS+=-m64
+  ifneq ($(CONFIG_SOLARIS),yes)
+VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+  endif
+endif
+
 ifdef CONFIG_WIN32
 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
 endif
--- qemu.ORIG/configure	2007-05-13 14:02:43.0 -0400
+++ qemu/configure	2007-05-18 10:29:17.151695000 -0400
@@ -141,6 +141,12 @@
 install=ginstall
 needs_libsunmath=no
 solarisrev=`uname -r | cut -f2 -d.`
+# have to select again, because `uname -m` returns i86pc 
+# even on an x86_64 box.
+solariscpu=`isainfo -k`
+if test ${solariscpu} = amd64 ; then
+cpu=x86_64
+fi
 if [ $cpu = i386 -o $cpu = x86_64 ] ; then
 if test $solarisrev -le 9 ; then
 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
@@ -317,6 +323,11 @@
;;
 esac
 
+if [ $solaris = yes -a  $cpu = x86_64 ] ; then
+CFLAGS=${CFLAGS} -m64
+OS_CFLAGS=${OS_CFLAGS} -m64
+fi
+
 if test x$show_help = xyes ; then
 cat  EOF
 
@@ -547,7 +558,7 @@
 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
 EOF
 
-if $cc -o $TMPE `$sdl_config --cflags 2 /dev/null` $TMPC `$sdl_config --libs 2 /dev/null` 2 /dev/null ; then
+if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2 /dev/null` $TMPC `$sdl_config --libs 2 /dev/null` 2 /dev/null ; then
 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
 if test $_sdlversion -lt 121 ; then
 sdl_too_old=yes
@@ -566,7 +577,7 @@
   sdl_static_libs=$sdl_static_libs `aalib-config --static-libs`
 fi
 
-if $cc -o $TMPE `$sdl_config --cflags 2 /dev/null` $TMPC $sdl_static_libs 2 /dev/null; then
+if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2 /dev/null` $TMPC $sdl_static_libs 2 /dev/null; then
   sdl_static=yes
 fi
 


[Qemu-devel] Xen 3.0.2 inside QEmu on x86_64

2007-05-18 Thread Milan Holzäpfel
Hello,

I'm trying to run Xen 3.0.2 under QEmu, running on an Linux-2.6.21
x86_64 host.  It works with -disable-kqemu, but performance is extremely
slow.  More precisely, my guest is a 64 bit Xen which should launch a
x86_64 linux-2.6.16-something.

Running it without -disable-kqemu and with -kernel-qemu crashes
immediately when Xen starts the Domain 0 (privileged) Linux kernel.
You can see the output in the attached console dumps.

Can you do something about this, do you need further information?

I've tested with kqemu-1.3.0_pre11 and QEmu-0.9.  Everything except the
stuff contained in gentoo's qemu-softmmu ebuild was compiled with
GCC-4.1.1, qemu-softmmu was compiled with GCC-3.4.6.  This works fine
with Grml-0.9 (Linux-based Live-CD).

Command lines used:

# qemu-system-x86_64 -no-kqemu -hda /dev/loop0 -hdc /dev/sysbase/gabh_hcp_test1 
-boot c -m 1024 -net nic,vlan=0 -net tap,vlan=0,ifname=t0
# qemu-system-x86_64 -kernel-kqemu -hda /dev/loop0 -m 64 -net none
# qemu-system-x86_64 -hda /dev/loop0 -m 64 -net none

The latter two don't need much memory as they crash very soon anyway,
but it happens with larger amounts of memory, too.  /dev/loop0 is a
small file containing everything usually found in /boot + Grub in the
bootsector.  /dev/sysbase/gabh_hcp_test1 contains the system which
should be launched.

Regards,
Milan Holzäpfel

--

attachment: qemu_xen-3.0.2_linux-2.6.16_kernel-kqemu.pngattachment: qemu_xen-3.0.2_linux-2.6.16_kqemu.png

pgpKfaYs8Eojm.pgp
Description: PGP signature


[Qemu-devel] [PATCH, MIPS64] Fix LDR and LDL instructions

2007-05-18 Thread Aurelien Jarno
Hi,

The trivial patch below fixes the LDR and LDL instructions. Before
modifying a register, it is better to load it :)

With this patch I am able to boot a 64-bit MIPS kernel on the emulated
Malta board up to the start of INIT. Then I get:

 Freeing unused kernel memory: 168k freed
 modprobe: FATAL: Could not load /lib/modules/2.6.21.1/modules.dep: No such 
file or directory

 INIT: version 2.86 booting
 schedule_timeout: wrong timeout value 7ffe
 Call Trace:
 [80107700] dump_stack+0x8/0x38
 [803f9ce4] schedule_timeout+0xdc/0x108
 [80194828] do_select+0x428/0x548
 [801bbbfc] compat_core_sys_select+0x1a4/0x230
 [801bdb64] compat_sys_select+0x104/0x1f0
 [80115108] handle_sys+0x108/0x124

This call trace is then printed in loop.

Note that the kernel part of the 64-bit boot log is now the same as the
32-bit one, except for the addresses. The 64-bit specific error messages
(for example the USB ones) are fixed with this patch.

Bye,
Aurelien



Index: target-mips/translate.c
===
RCS file: /sources/qemu/qemu/target-mips/translate.c,v
retrieving revision 1.80
diff -u -d -p -r1.80 translate.c
--- target-mips/translate.c 18 May 2007 11:55:54 -  1.80
+++ target-mips/translate.c 19 May 2007 00:46:59 -
@@ -761,6 +761,7 @@ static void gen_ldst (DisasContext *ctx,
 opn = scd;
 break;
 case OPC_LDL:
+GEN_LOAD_REG_TN(T1, rt);
 op_ldst(ldl);
 GEN_STORE_TN_REG(rt, T0);
 opn = ldl;
@@ -771,6 +772,7 @@ static void gen_ldst (DisasContext *ctx,
 opn = sdl;
 break;
 case OPC_LDR:
+GEN_LOAD_REG_TN(T1, rt);
 op_ldst(ldr);
 GEN_STORE_TN_REG(rt, T0);
 opn = ldr;

-- 
  .''`.  Aurelien Jarno | GPG: 1024D/F1BCDB73
 : :' :  Debian developer   | Electrical Engineer
 `. `'   [EMAIL PROTECTED] | [EMAIL PROTECTED]
   `-people.debian.org/~aurel32 | www.aurel32.net