[Qemu-devel] buildbot failure in qemu on block_i386_debian_6_0

2012-03-17 Thread qemu
The Buildbot has detected a new failure on builder block_i386_debian_6_0 while 
building qemu.
Full details are available at:
 http://buildbot.b1-systems.de/qemu/builders/block_i386_debian_6_0/builds/215

Buildbot URL: http://buildbot.b1-systems.de/qemu/

Buildslave for this Build: yuzuki

Build Reason: The Nightly scheduler named 'nightly_block' triggered this build
Build Source Stamp: [branch block] HEAD
Blamelist: 

BUILD FAILED: failed compile

sincerely,
 -The Buildbot



Re: [Qemu-devel] VDI patches (was: buildbot failure in qemu on block_i386_debian_6_0)

2012-03-17 Thread Stefan Weil

Am 17.03.2012 04:11, schrieb q...@buildbot.b1-systems.de:
The Buildbot has detected a new failure on builder 
block_i386_debian_6_0 while building qemu.

Full details are available at:
http://buildbot.b1-systems.de/qemu/builders/block_i386_debian_6_0/builds/215

Buildbot URL: http://buildbot.b1-systems.de/qemu/

Buildslave for this Build: yuzuki

Build Reason: The Nightly scheduler named 'nightly_block' triggered 
this build

Build Source Stamp: [branch block] HEAD
Blamelist:

BUILD FAILED: failed compile

sincerely,
-The Buildbot


Hi Kevin, hi Paolo,

the build failure is caused by the vdi changes: some versions of gcc
detect uninitialized local variables (my gcc 4.4.5 does not).

I don't think that it's really an error because the code is guarded
by the local variable 'block', but not all compilers are clever enough,
so it should be fixed.

It can be fixed by modifying commit af93911fd45f4de34ca2d5813905e2cf43675c98
(vdi: move aiocb fields to locals) like that:

--- a/block/vdi.c
+++ b/block/vdi.c
@@ -519,8 +519,8 @@ static int vdi_co_write(BlockDriverState *bs,
 uint32_t block_index;
 uint32_t sector_in_block;
 uint32_t n_sectors;
-uint32_t bmap_first;
-uint32_t bmap_last;
+uint32_t bmap_first = VDI_UNALLOCATED;
+uint32_t bmap_last = VDI_UNALLOCATED;
 uint8_t *block = NULL;
 int ret = 0;

Regards,
Stefan W.




Re: [Qemu-devel] QEMU was not selected for Google Summer of Code this year

2012-03-17 Thread Chris Wright
* Natalia Portillo (clau...@claunia.com) wrote:
 QEMU hosted on Haiku would be interesting.

The fun of Haiku
especially when it is
hosting QEMU



[Qemu-devel] [Bug 957622] Re: kvm -kernel with grub multiboot kernel dumps core or exits

2012-03-17 Thread Scott Moser
I'm pretty sure this is a bug in the linked commit above, in that it
does not account for this statement in the multiboot spec:

`load_end_addr'
 Contains the physical address of the end of the data segment.
 (load_end_addr - load_addr) specifies how much data to load.  This
 implies that the text and data segments must be consecutive in the
 OS image; this is true for existing a.out executable formats.  If
 this field is zero, the boot loader assumes that the text and data
 segments occupy the whole OS image file.

Specifically, If this field is zero...

** Also affects: qemu
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/957622

Title:
  kvm -kernel with grub multiboot kernel dumps core or exits

Status in QEMU:
  New
Status in “qemu-kvm” package in Ubuntu:
  New

Bug description:
  I attempted to use kvm -kernel with a grub multiboot image,
  specifically grub-maverick-20100729.img at [1].  That file was built
  using [2]

  $ 
url=http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/automated-ec2-builds/download/head:/grubmaverick20100729-20100729071944-bevge631maio9jpl-2/grub-maverick-20100729.img;
  $ wget $url -O grub-maverick-20100729.img
  $ qemu-kvm create -f qcow2 disk.img 1G
  $ kvm -curses -kernel grub-maverick-20100729.img -drive 
file=disk.img,if=virtio

  This process works fine on oneiric and you will see a curses
  interface, and some output of grub looking for a image to boot.

  On my laptop (with kvm support), I saw:

  $ kvm -curses -kernel grub-maverick-20100729.img -drive 
file=disk.img,if=virtio;
  fread() failed
  $ echo $?
  1

  On a kvm guest (via openstack instance), it crashed differently:
  $ kvm -curses -kernel grub-maverick-20100729.img -drive 
file=disk.img,if=virtio
  Could not access KVM kernel module: No such file or directory
  failed to initialize KVM: No such file or directory
  Back to tcg accelerator.

  GLib-ERROR **: /build/buildd/glib2.0-2.31.20/./glib/gmem.c:165: failed to 
allocate 4293918720 bytes
  Trace/breakpoint trap (core dumped)

  
  Just for a test, I tried loading kvm-amd, got nested kvm virtualization, but 
the instance fails the same way.

  
  --
  [1] 
http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/automated-ec2-builds/files/head:/loaders/
  [2] 
http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/automated-ec2-builds/view/head:/mk-image-mb-loader

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: kvm (not installed)
  ProcVersionSignature: User Name 3.2.0-18.29-virtual 3.2.9
  Uname: Linux 3.2.0-18-virtual x86_64
  ApportVersion: 1.94.1-0ubuntu2
  Architecture: amd64
  CurrentDmesg:
   [27230.320857] init: qemu-kvm pre-start process (8659) terminated with 
status 1
   [27230.361904] init: qemu-kvm post-stop process (8664) terminated with 
status 1
   [27249.426836] kvm[9021] trap int3 ip:7f44c2bbc13b sp:7fff447e1120 error:0
   [27263.380598] kvm[9283] trap int3 ip:7f3fba9f713b sp:7fff8b55d1a0 error:0
  Date: Sat Mar 17 01:48:13 2012
  Ec2AMI: ami-
  Ec2AMIManifest: FIXME
  Ec2AvailabilityZone: nova
  Ec2InstanceType: m1.small
  Ec2Kernel: unavailable
  Ec2Ramdisk: unavailable
  KvmCmdLine: Error: command ['ps', '-C', 'kvm', '-F'] failed with exit code 1: 
UIDPID  PPID  CSZ   RSS PSR STIME TTY  TIME CMD
  Lsusb:
   Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
   Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
  MachineType: Bochs Bochs
  ProcEnviron:
   TERM=screen
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-18-virtual 
root=LABEL=cloudimg-rootfs ro console=ttyS0
  ProcModules:
   acpiphp 24231 0 - Live 0x
   floppy 70365 0 - Live 0x
   psmouse 87603 0 - Live 0x
   serio_raw 13211 0 - Live 0x
   virtio_balloon 13108 0 - Live 0x
  SourcePackage: qemu-kvm
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 01/01/2007
  dmi.bios.vendor: Bochs
  dmi.bios.version: Bochs
  dmi.chassis.type: 1
  dmi.chassis.vendor: Bochs
  dmi.modalias: 
dmi:bvnBochs:bvrBochs:bd01/01/2007:svnBochs:pnBochs:pvr:cvnBochs:ct1:cvr:
  dmi.product.name: Bochs
  dmi.sys.vendor: Bochs

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/957622/+subscriptions



[Qemu-devel] [Bug 957622] Re: kvm -kernel with grub multiboot kernel dumps core or exits

2012-03-17 Thread Scott Moser
I've a fix for this upstream at
http://thread.gmane.org/gmane.comp.emulators.kvm.devel/88404

** Changed in: qemu-kvm (Ubuntu)
   Status: New = In Progress

** Changed in: qemu
   Status: New = Confirmed

** Changed in: qemu-kvm (Ubuntu)
   Importance: Undecided = Medium

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/957622

Title:
  kvm -kernel with grub multiboot kernel dumps core or exits

Status in QEMU:
  Confirmed
Status in “qemu-kvm” package in Ubuntu:
  In Progress

Bug description:
  I attempted to use kvm -kernel with a grub multiboot image,
  specifically grub-maverick-20100729.img at [1].  That file was built
  using [2]

  $ 
url=http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/automated-ec2-builds/download/head:/grubmaverick20100729-20100729071944-bevge631maio9jpl-2/grub-maverick-20100729.img;
  $ wget $url -O grub-maverick-20100729.img
  $ qemu-kvm create -f qcow2 disk.img 1G
  $ kvm -curses -kernel grub-maverick-20100729.img -drive 
file=disk.img,if=virtio

  This process works fine on oneiric and you will see a curses
  interface, and some output of grub looking for a image to boot.

  On my laptop (with kvm support), I saw:

  $ kvm -curses -kernel grub-maverick-20100729.img -drive 
file=disk.img,if=virtio;
  fread() failed
  $ echo $?
  1

  On a kvm guest (via openstack instance), it crashed differently:
  $ kvm -curses -kernel grub-maverick-20100729.img -drive 
file=disk.img,if=virtio
  Could not access KVM kernel module: No such file or directory
  failed to initialize KVM: No such file or directory
  Back to tcg accelerator.

  GLib-ERROR **: /build/buildd/glib2.0-2.31.20/./glib/gmem.c:165: failed to 
allocate 4293918720 bytes
  Trace/breakpoint trap (core dumped)

  
  Just for a test, I tried loading kvm-amd, got nested kvm virtualization, but 
the instance fails the same way.

  
  --
  [1] 
http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/automated-ec2-builds/files/head:/loaders/
  [2] 
http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/automated-ec2-builds/view/head:/mk-image-mb-loader

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: kvm (not installed)
  ProcVersionSignature: User Name 3.2.0-18.29-virtual 3.2.9
  Uname: Linux 3.2.0-18-virtual x86_64
  ApportVersion: 1.94.1-0ubuntu2
  Architecture: amd64
  CurrentDmesg:
   [27230.320857] init: qemu-kvm pre-start process (8659) terminated with 
status 1
   [27230.361904] init: qemu-kvm post-stop process (8664) terminated with 
status 1
   [27249.426836] kvm[9021] trap int3 ip:7f44c2bbc13b sp:7fff447e1120 error:0
   [27263.380598] kvm[9283] trap int3 ip:7f3fba9f713b sp:7fff8b55d1a0 error:0
  Date: Sat Mar 17 01:48:13 2012
  Ec2AMI: ami-
  Ec2AMIManifest: FIXME
  Ec2AvailabilityZone: nova
  Ec2InstanceType: m1.small
  Ec2Kernel: unavailable
  Ec2Ramdisk: unavailable
  KvmCmdLine: Error: command ['ps', '-C', 'kvm', '-F'] failed with exit code 1: 
UIDPID  PPID  CSZ   RSS PSR STIME TTY  TIME CMD
  Lsusb:
   Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
   Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
  MachineType: Bochs Bochs
  ProcEnviron:
   TERM=screen
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-18-virtual 
root=LABEL=cloudimg-rootfs ro console=ttyS0
  ProcModules:
   acpiphp 24231 0 - Live 0x
   floppy 70365 0 - Live 0x
   psmouse 87603 0 - Live 0x
   serio_raw 13211 0 - Live 0x
   virtio_balloon 13108 0 - Live 0x
  SourcePackage: qemu-kvm
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 01/01/2007
  dmi.bios.vendor: Bochs
  dmi.bios.version: Bochs
  dmi.chassis.type: 1
  dmi.chassis.vendor: Bochs
  dmi.modalias: 
dmi:bvnBochs:bvrBochs:bd01/01/2007:svnBochs:pnBochs:pvr:cvnBochs:ct1:cvr:
  dmi.product.name: Bochs
  dmi.sys.vendor: Bochs

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/957622/+subscriptions



[Qemu-devel] buildbot failure in qemu on block_x86_64_debian_6_0

2012-03-17 Thread qemu
The Buildbot has detected a new failure on builder block_x86_64_debian_6_0 
while building qemu.
Full details are available at:
 http://buildbot.b1-systems.de/qemu/builders/block_x86_64_debian_6_0/builds/215

Buildbot URL: http://buildbot.b1-systems.de/qemu/

Buildslave for this Build: yuzuki

Build Reason: The Nightly scheduler named 'nightly_block' triggered this build
Build Source Stamp: [branch block] HEAD
Blamelist: 

BUILD FAILED: failed compile

sincerely,
 -The Buildbot



Re: [Qemu-devel] VDI patches

2012-03-17 Thread Paolo Bonzini
Il 17/03/2012 08:10, Stefan Weil ha scritto:
 Hi Kevin, hi Paolo,
 
 the build failure is caused by the vdi changes: some versions of gcc
 detect uninitialized local variables (my gcc 4.4.5 does not).
 
 I don't think that it's really an error because the code is guarded
 by the local variable 'block', but not all compilers are clever enough,
 so it should be fixed.
 
 It can be fixed by modifying commit
 af93911fd45f4de34ca2d5813905e2cf43675c98
 (vdi: move aiocb fields to locals) like that:
 
 --- a/block/vdi.c
 +++ b/block/vdi.c
 @@ -519,8 +519,8 @@ static int vdi_co_write(BlockDriverState *bs,
  uint32_t block_index;
  uint32_t sector_in_block;
  uint32_t n_sectors;
 -uint32_t bmap_first;
 -uint32_t bmap_last;
 +uint32_t bmap_first = VDI_UNALLOCATED;
 +uint32_t bmap_last = VDI_UNALLOCATED;
  uint8_t *block = NULL;
  int ret = 0;
 
 Regards,
 Stefan W.
 
 
 

Yes, I'll post v2.

Paolo




[Qemu-devel] [PATCH v2] Basic Illumos support

2012-03-17 Thread Lee Essen
(third email attempt, apologies if you get duplicates)

This patch adds some basic constructs to better support Illumos/Solaris.

I've kept away from kvm, configure etc. This just covers making sure the
right libs are used, and the code is Solaris/Illumos compatible.

In qemu-timer.c there are lots of __linux__ || __sun__ constructs, I wanted
to make sure I didn't alter the linux behaviour and this seemed the safest
way to do it.

Signed-off-by: Lee Essen lee.es...@nowonline.co.uk

---

configure|1 +
cpus.c   |4 +++-
qemu-timer.c |   14 +-
qga/channel-posix.c  |   16 
qga/commands-posix.c |9 +
5 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index afe7395..68cc3a7 100755
--- a/configure
+++ b/configure
@@ -471,6 +471,7 @@ SunOS)
  QEMU_CFLAGS=-D__EXTENSIONS__ $QEMU_CFLAGS
  QEMU_CFLAGS=-std=gnu99 $QEMU_CFLAGS
  LIBS=-lsocket -lnsl -lresolv $LIBS
+  libs_qga=-lsocket -lxnet $lib_qga
;;
AIX)
  aix=yes
diff --git a/cpus.c b/cpus.c
index 25ba621..6550f22 100644
--- a/cpus.c
+++ b/cpus.c
@@ -455,7 +455,7 @@ static void cpu_signal(int sig)
exit_request = 1;
}

-#ifdef CONFIG_LINUX
+#if defined(CONFIG_LINUX) || defined(CONFIG_SOLARIS)
static void sigbus_reraise(void)
{
sigset_t set;
@@ -491,7 +491,9 @@ static void qemu_init_sigbus(void)
action.sa_sigaction = (void (*)(int, siginfo_t*, void*))sigbus_handler;
sigaction(SIGBUS, action, NULL);

+#if defined(CONFIG_LINUX)
prctl(PR_MCE_KILL, PR_MCE_KILL_SET, PR_MCE_KILL_EARLY, 0, 0);
+#endif
}

static void qemu_kvm_eat_signals(CPUArchState *env)
diff --git a/qemu-timer.c b/qemu-timer.c
index d7f56e5..48817c9 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -77,7 +77,7 @@ struct qemu_alarm_timer {
int (*start)(struct qemu_alarm_timer *t);
void (*stop)(struct qemu_alarm_timer *t);
void (*rearm)(struct qemu_alarm_timer *t, int64_t nearest_delta_ns);
-#if defined(__linux__)
+#if defined(__linux__) || defined(__sun__)
int fd;
timer_t timer;
#elif defined(_WIN32)
@@ -165,7 +165,7 @@ static int unix_start_timer(struct qemu_alarm_timer *t);
static void unix_stop_timer(struct qemu_alarm_timer *t);
static void unix_rearm_timer(struct qemu_alarm_timer *t, int64_t delta);

-#ifdef __linux__
+#if defined(__linux__) || defined(__sun__)

static int dynticks_start_timer(struct qemu_alarm_timer *t);
static void dynticks_stop_timer(struct qemu_alarm_timer *t);
@@ -177,7 +177,7 @@ static void dynticks_rearm_timer(struct qemu_alarm_timer 
*t, int64_t delta

static struct qemu_alarm_timer alarm_timers[] = {
#ifndef _WIN32
-#ifdef __linux__
+#if defined(__linux__) || defined(__sun__)
{dynticks, dynticks_start_timer,
 dynticks_stop_timer, dynticks_rearm_timer},
#endif
@@ -502,7 +502,7 @@ static void host_alarm_handler(int host_signum)
}
}

-#if defined(__linux__)
+#if defined(__linux__) || defined(__sun__)

#include compatfd.h

@@ -533,7 +533,11 @@ static int dynticks_start_timer(struct qemu_alarm_timer *t)
#endif /* SIGEV_THREAD_ID */
ev.sigev_signo = SIGALRM;

+#if defined(__sun__)
+if (timer_create(CLOCK_HIGHRES, ev, host_timer)) {
+#else
if (timer_create(CLOCK_REALTIME, ev, host_timer)) {
+#endif
perror(timer_create);

/* disable dynticks */
@@ -585,7 +589,7 @@ static void dynticks_rearm_timer(struct qemu_alarm_timer *t,
}
}

-#endif /* defined(__linux__) */
+#endif /* defined(__linux__) || defined(__sun__) */

#if !defined(_WIN32)

diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index 40f7658..86245c1 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -3,6 +3,10 @@
#include qemu_socket.h
#include qga/channel.h

+#ifdef CONFIG_SOLARIS
+#include sys/stropts.h
+#endif
+
#define GA_CHANNEL_BAUDRATE_DEFAULT B38400 /* for isa-serial channels */

struct GAChannel {
@@ -123,7 +127,19 @@ static gboolean ga_channel_open(GAChannel *c, const gchar 
*path, GAChanne

switch (c-method) {
case GA_CHANNEL_VIRTIO_SERIAL: {
+#ifdef CONFIG_SOLARIS
+int fd = qemu_open(path, O_RDWR | O_NONBLOCK);
+if (fd == -1) {
+g_critical(error opening channel: %s, strerror(errno));
+exit(EXIT_FAILURE);
+}
+if (ioctl(fd, I_SETSIG, S_OUTPUT | S_INPUT | S_HIPRI)  0) {
+g_critical(error with setsig on channel: %s, strerror(errno));
+exit(EXIT_FAILURE);
+}
+#else
int fd = qemu_open(path, O_RDWR | O_NONBLOCK | O_ASYNC);
+#endif
if (fd == -1) {
g_critical(error opening channel: %s, strerror(errno));
exit(EXIT_FAILURE);
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 7b2be2f..67531aa 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -35,6 +35,11 @@
#include qemu-queue.h
#include host-utils.h

+#if defined(__sun__)
+#include sys/sockio.h
+extern char **environ;
+#endif
+
static void reopen_fd_to_null(int fd)
{
int nullfd;
@@ -807,7 +812,11 @@ 

Re: [Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-17 Thread Jan Kiszka
On 2012-03-16 03:43, Wei Yang wrote:
 All
 
 I like qemu very much and know it could debug the kernel.
 
 I tried what I searched on web but couldn't stop at the break point.
 Below is what I did.
 
 1. Both host and guest installed the same OS, Fedora16 x86_64.
 
 2. Compile the qemu with
 ./configure --target-list=x86_64-softmmu --enable-kvm
 --enable-debug-tcg --enable-debug --enable-trace-backend=simple
 
 3. With this command I can boot up my guest.
 ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m
 1024  -boot dc fedora16.img -monitor stdio
 
 4. I git clone the kernel source in the guest and make a new kernel and 
 initrd.
 I start the guest with this new kernel successfully
 
 5. I copy out the initrd.img and the .config of kernel to host.
 compile the kernel on host.
 the kernel source code is identical on host and gueset,
 
 6. I start the guest with the kernel and initrd on host
 ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m
 1024  -boot dc fedora16.img -monitor stdio -kernel
 ~/git/linux-yinghai/arch/x86_64/boot/bzImage -initrd
 ~/git/debug/initramfs-3.0.0.img -append
 root=/dev/mapper/vg_wizard-lv_root ro rd.lvm.lv=vg_wizard/lv_root
 rd.md=0 rd.lvm.lv=vg_wizard/lv_swap
 
 This works fine.
 
 7. Then I start the guest with gdbstub option
 ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m
 1024  -boot dc fedora16.img -monitor stdio -kernel
 /home/ywywyang/git/linux-yinghai/arch/x86_64/boot/bzImage -initrd
 /home/ywywyang/git/debug/initramfs-3.0.0.img -append
 root=/dev/mapper/vg_wizard-lv_root ro rd.lvm.lv=vg_wizard/lv_root
 rd.md=0 rd.lvm.lv=vg_wizard/lv_swap -S -gdb tcp::4321
 
 Then the guest stop at the beginning.
 
 8. Attach the gdb in the kernel source directory
 gdb
 file vmlinux
 target remote localhost:4321
 b start_kernel
 c
 
Then the guest will run very happily
 
 Also use the info b  could show the break point is set.
 
 Which step I made a mistake?

Two major issues with this procedure:

1. When using kvm, a soft breakpoint (as set by 'b') will inject a trap
instruction into the guest image - which is not yet loaded after the
bios ran. You need to use a hardware breakpoint in this case.

2. Due to gdb limitations, you cannot switch between 16/32-bit mode (the
CPU starts in 16 bit) and the 64-bit mode of kernel within the same gdb
session. Therefore:
 - let the target run into Linux is active
 - attach gdb
 - issue hw start_kernel
 - reboot (e.g. monitor system_reset)
 - you will hit the breakpoint, and gdb will be usable

Jan




signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] [PATCH] Initial support for Ilumos build and Illumos-kvm

2012-03-17 Thread Jan Kiszka
On 2012-03-16 14:46, Lee Essen wrote:
 
 On 16 Mar 2012, at 13:14, Jan Kiszka wrote:
 
 On 2012-03-16 10:23, Lee Essen wrote:
 +#ifdef __sun__
 +#include sys/kvm.h
 +#else
 #include linux/kvm.h
 #include linux/kvm_para.h
 +#endif

 As Paolo already said, this should somehow be centralised.
 
 Yep, fair point. I'll address this one.
 
 Also, CONFIG_SOLARIS vs. __sun__: please use a consistent pattern.
 
 Hmmm … I was trying to be consistent with the existing style :-) … see 
 __linux__ and CONFIG_LINUX as well. I'll see what I can do to make this a bit 
 tidier.

Maybe QEMU isn't consistent as well. :)

 
 +#ifdef CONFIG_SOLARIS
 +for (p = (caddr_t)mem.userspace_addr;
 +  p  (caddr_t)mem.userspace_addr + mem.memory_size;
 +  p += PAGE_SIZE)
 +c = *p;
 +#endif /* CONFIG_SOLARIS */
 +

 I bet gcc will like this write-only pattern and bark at you.

 
 It does indeed … this came from the original Joyent code, I must admit I did 
 wonder whether gcc would optimise it away. I did consider adding something to 
 stop gcc complaining, but I don't fully understand why this is necessary 
 given the mlock() bit, so I thought it best to leave it alone.
 
 Any suggestions?

First of all: understand if and why this is needed. Talk to the Joyent
people, check if it works without, comment on the why. But please do not
just dump code that may date back to early solaris-kvm days and were
possibly just hacks. This is upstream here and should ideally carry only
the cleaned up versions (we are trying to achieve this during the
qemu-kvm - qemu upstreaming as well).

 
 +#else
 ret = kvm_vm_ioctl(s, KVM_CREATE_VCPU, env-cpu_index);
 +#endif

 There is no chance to fix the Solaris KVM to do fd cloning in the kernel
 and implement the same KVM_CREATE_VCPU ABI?

 
 I will raise this with the joyent guys, but they are pretty switched on and I 
 suspect there is a reason.
 
 My concern with the fix the kernel comments is that it would exclude the 
 use of the newer qemu on existing installations, however I do understand the 
 desire to not fill the code with workarounds that live forever.
 
 How about a broken_solaris_kvm_abi option to configure with a suitable set 
 of defines wrapping the code?

Well, if there are working, considered stable versions of solaris-kvm
out there that expose this ABI, we probably want to support this anyway.
If the released stuff is experimental only anyway and can be changed
before it becomes stable, then lets go for that destination.

 

 #ifdef CONFIG_KVM
 +#ifdef __sun__
 +#include sys/kvm.h
 +/*
 + * it's a bit horrible to include these here, but the kvm_para.h include 
 file
 + * isn't public with the illumos kvm implementation

 Just provide a package of properly fixed kernel headers and let us carry
 them in solaris-headers or so, analogously to linux-headers.

 
 Interestingly this is what I did originally but then thought it best to use 
 the supplied headers, but actually thinking more about it, this does make 
 much more sense.

Pushing fixed-up headers to qemu should still be only an temporary
solution. Fixing the headers upstream so that future solaris-kvm
versions provide them properly remains a worthwhile goal nevertheless.

Jan



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-17 Thread Laurent Vivier
Le samedi 17 mars 2012 à 09:53 +0100, Jan Kiszka a écrit :
 On 2012-03-16 03:43, Wei Yang wrote:
  All
  
  I like qemu very much and know it could debug the kernel.
  
  I tried what I searched on web but couldn't stop at the break point.
  Below is what I did.
  
  1. Both host and guest installed the same OS, Fedora16 x86_64.
  
  2. Compile the qemu with
  ./configure --target-list=x86_64-softmmu --enable-kvm
  --enable-debug-tcg --enable-debug --enable-trace-backend=simple
  
  3. With this command I can boot up my guest.
  ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m
  1024  -boot dc fedora16.img -monitor stdio
  
  4. I git clone the kernel source in the guest and make a new kernel and 
  initrd.
  I start the guest with this new kernel successfully
  
  5. I copy out the initrd.img and the .config of kernel to host.
  compile the kernel on host.
  the kernel source code is identical on host and gueset,
  
  6. I start the guest with the kernel and initrd on host
  ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m
  1024  -boot dc fedora16.img -monitor stdio -kernel
  ~/git/linux-yinghai/arch/x86_64/boot/bzImage -initrd
  ~/git/debug/initramfs-3.0.0.img -append
  root=/dev/mapper/vg_wizard-lv_root ro rd.lvm.lv=vg_wizard/lv_root
  rd.md=0 rd.lvm.lv=vg_wizard/lv_swap
  
  This works fine.
  
  7. Then I start the guest with gdbstub option
  ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m
  1024  -boot dc fedora16.img -monitor stdio -kernel
  /home/ywywyang/git/linux-yinghai/arch/x86_64/boot/bzImage -initrd
  /home/ywywyang/git/debug/initramfs-3.0.0.img -append
  root=/dev/mapper/vg_wizard-lv_root ro rd.lvm.lv=vg_wizard/lv_root
  rd.md=0 rd.lvm.lv=vg_wizard/lv_swap -S -gdb tcp::4321
  
  Then the guest stop at the beginning.
  
  8. Attach the gdb in the kernel source directory
  gdb
  file vmlinux
  target remote localhost:4321
  b start_kernel
  c
  
 Then the guest will run very happily
  
  Also use the info b  could show the break point is set.
  
  Which step I made a mistake?
 
 Two major issues with this procedure:
 
 1. When using kvm, a soft breakpoint (as set by 'b') will inject a trap
 instruction into the guest image - which is not yet loaded after the
 bios ran. You need to use a hardware breakpoint in this case.
 
 2. Due to gdb limitations, you cannot switch between 16/32-bit mode (the
 CPU starts in 16 bit) and the 64-bit mode of kernel within the same gdb
 session. Therefore:
  - let the target run into Linux is active
  - attach gdb
  - issue hw start_kernel
  - reboot (e.g. monitor system_reset)
  - you will hit the breakpoint, and gdb will be usable

You can also try my patch :

http://patchwork.ozlabs.org/patch/137543/

Laurent




[Qemu-devel] [PATCH] target-mips: Remove unused inline function

2012-03-17 Thread Stefan Weil
Function set_HILO is not needed anywhere.

Signed-off-by: Stefan Weil s...@weilnetz.de
---
 target-mips/op_helper.c |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 3a20731..7b77d5a 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -193,12 +193,6 @@ static inline uint64_t get_HILO (void)
 return ((uint64_t)(env-active_tc.HI[0])  32) | 
(uint32_t)env-active_tc.LO[0];
 }
 
-static inline void set_HILO (uint64_t HILO)
-{
-env-active_tc.LO[0] = (int32_t)HILO;
-env-active_tc.HI[0] = (int32_t)(HILO  32);
-}
-
 static inline void set_HIT0_LO (target_ulong arg1, uint64_t HILO)
 {
 env-active_tc.LO[0] = (int32_t)(HILO  0x);
-- 
1.7.9




Re: [Qemu-devel] [PATCH 3/3] build: check if libm is needed in configure

2012-03-17 Thread Blue Swirl
On Wed, Feb 22, 2012 at 04:55, Roger Pau Monne roger@entel.upc.edu wrote:
 Remove the hardcoded use of libm and instead rely on configure to
 check for it. It is needed at least for qemu-ga and qemu-system.

This would break linux-user build, linker can't find 'sin' etc.


 Signed-off-by: Roger Pau Monne roger@entel.upc.edu
 ---
  Makefile.target |    4 
  configure       |   14 ++
  2 files changed, 14 insertions(+), 4 deletions(-)

 diff --git a/Makefile.target b/Makefile.target
 index 68a5641..c230aff 100644
 --- a/Makefile.target
 +++ b/Makefile.target
 @@ -42,10 +42,6 @@ PROGS+=$(QEMU_PROGW)
  endif
  STPFILES=

 -ifndef CONFIG_HAIKU
 -LIBS+=-lm
 -endif
 -
  config-target.h: config-target.h-timestamp
  config-target.h-timestamp: config-target.mak

 diff --git a/configure b/configure
 index 790d495..b0cb175 100755
 --- a/configure
 +++ b/configure
 @@ -2524,6 +2524,20 @@ elif compile_prog  -lrt ; then
   libs_qga=-lrt $libs_qga
  fi

 +##
 +# Do we need libm
 +cat  $TMPC EOF
 +#include math.h
 +int main(void) { double a, b; return modf(a, b);}
 +EOF
 +
 +if compile_prog   ; then
 +  :
 +elif compile_prog  -lm ; then
 +  LIBS=-lm $LIBS
 +  libs_qga=-lm $libs_qga
 +fi
 +
  if test $darwin != yes -a $mingw32 != yes -a $solaris != yes -a \
         $aix != yes -a $haiku != yes ; then
     libs_softmmu=-lutil $libs_softmmu
 --
 1.7.9





Re: [Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-17 Thread Jan Kiszka
[ re-added qemu-devel to CC ]

On 2012-03-17 13:10, Wei Yang wrote:
 Two major issues with this procedure:

 1. When using kvm, a soft breakpoint (as set by 'b') will inject a trap
 instruction into the guest image - which is not yet loaded after the
 bios ran. You need to use a hardware breakpoint in this case.

 2. Due to gdb limitations, you cannot switch between 16/32-bit mode (the
 CPU starts in 16 bit) and the 64-bit mode of kernel within the same gdb
 session. Therefore:
  - let the target run into Linux is active
  - attach gdb
  - issue hw start_kernel
  - reboot (e.g. monitor system_reset)
  - you will hit the breakpoint, and gdb will be usable

 Jan


 oh, so when qemu run with kvm enabled, I couldn't debug the kernel right?

That's not what I said. You need to be aware of how it works. And, in
contrast to pure emulation, kwm uses a non-transparent mechanism for
injecting software breakpoints. Consider it the price for the gained speed.

 
 I tried to run qemu with out -enable-kvm, kernel could stop at the break 
 point.
 
 BTW, I tried hw start_kernel, but it failed.
 (gdb) hw start_kernel
 Undefined command: hw.  Try help.

Sorry, typo. Must be hb.

Jan



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-17 Thread Jan Kiszka
On 2012-03-17 12:25, Laurent Vivier wrote:
 Le samedi 17 mars 2012 à 09:53 +0100, Jan Kiszka a écrit :
 On 2012-03-16 03:43, Wei Yang wrote:
 All

 I like qemu very much and know it could debug the kernel.

 I tried what I searched on web but couldn't stop at the break point.
 Below is what I did.

 1. Both host and guest installed the same OS, Fedora16 x86_64.

 2. Compile the qemu with
 ./configure --target-list=x86_64-softmmu --enable-kvm
 --enable-debug-tcg --enable-debug --enable-trace-backend=simple

 3. With this command I can boot up my guest.
 ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m
 1024  -boot dc fedora16.img -monitor stdio

 4. I git clone the kernel source in the guest and make a new kernel and 
 initrd.
 I start the guest with this new kernel successfully

 5. I copy out the initrd.img and the .config of kernel to host.
 compile the kernel on host.
 the kernel source code is identical on host and gueset,

 6. I start the guest with the kernel and initrd on host
 ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m
 1024  -boot dc fedora16.img -monitor stdio -kernel
 ~/git/linux-yinghai/arch/x86_64/boot/bzImage -initrd
 ~/git/debug/initramfs-3.0.0.img -append
 root=/dev/mapper/vg_wizard-lv_root ro rd.lvm.lv=vg_wizard/lv_root
 rd.md=0 rd.lvm.lv=vg_wizard/lv_swap

 This works fine.

 7. Then I start the guest with gdbstub option
 ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m
 1024  -boot dc fedora16.img -monitor stdio -kernel
 /home/ywywyang/git/linux-yinghai/arch/x86_64/boot/bzImage -initrd
 /home/ywywyang/git/debug/initramfs-3.0.0.img -append
 root=/dev/mapper/vg_wizard-lv_root ro rd.lvm.lv=vg_wizard/lv_root
 rd.md=0 rd.lvm.lv=vg_wizard/lv_swap -S -gdb tcp::4321

 Then the guest stop at the beginning.

 8. Attach the gdb in the kernel source directory
 gdb
 file vmlinux
 target remote localhost:4321
 b start_kernel
 c

Then the guest will run very happily

 Also use the info b  could show the break point is set.

 Which step I made a mistake?

 Two major issues with this procedure:

 1. When using kvm, a soft breakpoint (as set by 'b') will inject a trap
 instruction into the guest image - which is not yet loaded after the
 bios ran. You need to use a hardware breakpoint in this case.

 2. Due to gdb limitations, you cannot switch between 16/32-bit mode (the
 CPU starts in 16 bit) and the 64-bit mode of kernel within the same gdb
 session. Therefore:
  - let the target run into Linux is active
  - attach gdb
  - issue hw start_kernel
  - reboot (e.g. monitor system_reset)
  - you will hit the breakpoint, and gdb will be usable
 
 You can also try my patch :
 
 http://patchwork.ozlabs.org/patch/137543/

Unless there is a use case beyond this x86 band-aid, lets focus on
getting gdb right. Reminds me that gdb folks asked me to file a bug
about this - which I still need to do. :-/

Jan



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-17 Thread Wei Yang
2012/3/17 Jan Kiszka jan.kis...@web.de:
 [ re-added qemu-devel to CC ]

 On 2012-03-17 13:10, Wei Yang wrote:
 Two major issues with this procedure:

 1. When using kvm, a soft breakpoint (as set by 'b') will inject a trap
 instruction into the guest image - which is not yet loaded after the
 bios ran. You need to use a hardware breakpoint in this case.

 2. Due to gdb limitations, you cannot switch between 16/32-bit mode (the
 CPU starts in 16 bit) and the 64-bit mode of kernel within the same gdb
 session. Therefore:
  - let the target run into Linux is active
  - attach gdb
  - issue hw start_kernel
  - reboot (e.g. monitor system_reset)
  - you will hit the breakpoint, and gdb will be usable

 Jan


 oh, so when qemu run with kvm enabled, I couldn't debug the kernel right?

 That's not what I said. You need to be aware of how it works. And, in
 contrast to pure emulation, kwm uses a non-transparent mechanism for
 injecting software breakpoints. Consider it the price for the gained speed.


Thanks :)
It works.  Though I don't understand it totally, I get the rough idea of it. :)


 I tried to run qemu with out -enable-kvm, kernel could stop at the break 
 point.

 BTW, I tried hw start_kernel, but it failed.
 (gdb) hw start_kernel
 Undefined command: hw.  Try help.

 Sorry, typo. Must be hb.

 Jan




-- 
Richard Yang
Help You, Help Me



Re: [Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-17 Thread Wei Yang
 You can also try my patch :

 http://patchwork.ozlabs.org/patch/137543/

 Unless there is a use case beyond this x86 band-aid, lets focus on
 getting gdb right. Reminds me that gdb folks asked me to file a bug
 about this - which I still need to do. :-/

 Jan


Jan, I didn't try your patch yet.

You mean  this hardware assist break point is just support on x86 now?

-- 
Richard Yang
Help You, Help Me



[Qemu-devel] [PATCH 1/6] i82378/i82374: do not create DMA controller twice

2012-03-17 Thread Hervé Poussineau
This fixes a crash in PReP emulation when using DMA controller to access floppy 
drive.

Signed-off-by: Hervé Poussineau hpous...@reactos.org
---
 hw/i82374.c |5 -
 hw/i82378.c |5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/hw/i82374.c b/hw/i82374.c
index 67298a3..4a922c3 100644
--- a/hw/i82374.c
+++ b/hw/i82374.c
@@ -38,6 +38,7 @@ do { fprintf(stderr, i82374 ERROR:  fmt , ## __VA_ARGS__); 
} while (0)
 
 typedef struct I82374State {
 uint8_t commands[8];
+qemu_irq out;
 } I82374State;
 
 static const VMStateDescription vmstate_i82374 = {
@@ -99,7 +100,7 @@ static uint32_t i82374_read_descriptor(void *opaque, 
uint32_t nport)
 
 static void i82374_init(I82374State *s)
 {
-DMA_init(1, NULL);
+DMA_init(1, s-out);
 memset(s-commands, 0, sizeof(s-commands));
 }
 
@@ -132,6 +133,8 @@ static int i82374_isa_init(ISADevice *dev)
 
 i82374_init(s);
 
+qdev_init_gpio_out(dev-qdev, s-out, 1);
+
 return 0;
 }
 
diff --git a/hw/i82378.c b/hw/i82378.c
index faad1a3..9b11d90 100644
--- a/hw/i82378.c
+++ b/hw/i82378.c
@@ -170,6 +170,7 @@ static void i82378_init(DeviceState *dev, I82378State *s)
 {
 ISABus *isabus = DO_UPCAST(ISABus, qbus, qdev_get_child_bus(dev, isa.0));
 ISADevice *pit;
+ISADevice *isa;
 qemu_irq *out0_irq;
 
 /* This device has:
@@ -199,8 +200,8 @@ static void i82378_init(DeviceState *dev, I82378State *s)
 pcspk_init(isabus, pit);
 
 /* 2 82C37 (dma) */
-DMA_init(1, s-out[1]);
-isa_create_simple(isabus, i82374);
+isa = isa_create_simple(isabus, i82374);
+qdev_connect_gpio_out(isa-qdev, 0, s-out[1]);
 
 /* timer */
 isa_create_simple(isabus, mc146818rtc);
-- 
1.7.9.1




[Qemu-devel] [PATCH 2/6] prep: change default cpu to '7448'

2012-03-17 Thread Hervé Poussineau
In b37fc148bb81b5b022846156a6cba266e6c23962, PReP default cpu was changed from
'default' to '602'. However, '7448' is closer of 'default' than '602'.

This repairs following command line, which is available in some tutorials:
qemu-system-ppc -kernel zImage.prep -fda debian_install_root.bin -M prep

Cc: Gerd Hoffmann kra...@redhat.com
Signed-off-by: Hervé Poussineau hpous...@reactos.org
---
 hw/ppc_prep.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 06d589d..19a674f 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -517,7 +517,7 @@ static void ppc_prep_init (ram_addr_t ram_size,
 
 /* init CPUs */
 if (cpu_model == NULL)
-cpu_model = 602;
+cpu_model = 7448;
 for (i = 0; i  smp_cpus; i++) {
 env = cpu_init(cpu_model);
 if (!env) {
-- 
1.7.9.1




[Qemu-devel] [PATCH 3/6] isa: add isa_bus_from_device() method

2012-03-17 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau hpous...@reactos.org
---
 hw/isa.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/isa.h b/hw/isa.h
index 40373fb..f7bc4b5 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -76,6 +76,11 @@ void isa_register_portio_list(ISADevice *dev, uint16_t start,
   const MemoryRegionPortio *portio,
   void *opaque, const char *name);
 
+static inline ISABus *isa_bus_from_device(ISADevice *d)
+{
+return DO_UPCAST(ISABus, qbus, d-qdev.parent_bus);
+}
+
 extern target_phys_addr_t isa_mem_base;
 
 void isa_mmio_setup(MemoryRegion *mr, target_phys_addr_t size);
-- 
1.7.9.1




[Qemu-devel] [PATCH 0/6] prep: some fixes and Super I/O emulation

2012-03-17 Thread Hervé Poussineau
Hi,

First two patches repair some functionality broken since 2009!
Debian install root floppy can now be started again.

Patches 4 to 6 implement the pc87312 Super I/O chip.
Some versions by me or by Andreas Färber have already been sent on
mailing list. This patch has been tested on PReP emulation and on
IBM 40p (not yet committed).

Hervé Poussineau (6):
  i82378/i82374: do not create DMA controller twice
  prep: change default cpu to '7448'
  isa: add isa_bus_from_device() method
  fdc: Parametrize ISA base, IRQ and DMA
  prep: add pc87312 Super I/O emulation
  prep: use pc87312 Super I/O chip instead of collection of random ISA
devices

 Makefile.objs   |1 +
 default-configs/ppc-softmmu.mak |2 +
 hw/fdc.c|   17 +-
 hw/i82374.c |5 +-
 hw/i82378.c |5 +-
 hw/isa.h|5 +
 hw/pc87312.c|  425 +++
 hw/ppc_prep.c   |   52 ++---
 8 files changed, 469 insertions(+), 43 deletions(-)
 create mode 100644 hw/pc87312.c

-- 
1.7.9.1




Re: [Qemu-devel] Failed to set a breakpoint on start_kernel

2012-03-17 Thread Jan Kiszka
On 2012-03-17 15:16, Wei Yang wrote:
 You can also try my patch :

 http://patchwork.ozlabs.org/patch/137543/

 Unless there is a use case beyond this x86 band-aid, lets focus on
 getting gdb right. Reminds me that gdb folks asked me to file a bug
 about this - which I still need to do. :-/

 Jan

 
 Jan, I didn't try your patch yet.

Not mine, it's Laurent's patch.

 
 You mean  this hardware assist break point is just support on x86 now?
 

I mean that the workaround is only required for x86 and will no longer
be needed once gdb can follow target mode switches between 16, 32, and
64 bit without stumbling like now.

Jan



signature.asc
Description: OpenPGP digital signature


[Qemu-devel] [PATCH 4/6] fdc: Parametrize ISA base, IRQ and DMA

2012-03-17 Thread Hervé Poussineau
Keep the PC values as defaults but allow to override them for PReP.

Signed-off-by: Hervé Poussineau hpous...@reactos.org
Cc: Markus Armbruster arm...@redhat.com
Signed-off-by: Andreas Färber andreas.faer...@web.de
---
 hw/fdc.c |   17 ++---
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/hw/fdc.c b/hw/fdc.c
index a0236b7..756d4ce 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -438,6 +438,9 @@ typedef struct FDCtrlSysBus {
 
 typedef struct FDCtrlISABus {
 ISADevice busdev;
+uint32_t iobase;
+uint32_t irq;
+uint32_t dma;
 struct FDCtrl state;
 int32_t bootindexA;
 int32_t bootindexB;
@@ -1971,17 +1974,14 @@ static int isabus_fdc_init1(ISADevice *dev)
 {
 FDCtrlISABus *isa = DO_UPCAST(FDCtrlISABus, busdev, dev);
 FDCtrl *fdctrl = isa-state;
-int iobase = 0x3f0;
-int isairq = 6;
-int dma_chann = 2;
 int ret;
 
-isa_register_portio_list(dev, iobase, fdc_portio_list, fdctrl, fdc);
+isa_register_portio_list(dev, isa-iobase, fdc_portio_list, fdctrl, fdc);
 
-isa_init_irq(isa-busdev, fdctrl-irq, isairq);
-fdctrl-dma_chann = dma_chann;
+isa_init_irq(isa-busdev, fdctrl-irq, isa-irq);
+fdctrl-dma_chann = isa-dma;
 
-qdev_set_legacy_instance_id(dev-qdev, iobase, 2);
+qdev_set_legacy_instance_id(dev-qdev, isa-iobase, 2);
 ret = fdctrl_init_common(fdctrl);
 
 add_boot_device_path(isa-bootindexA, dev-qdev, /floppy@0);
@@ -2046,6 +2046,9 @@ static const VMStateDescription vmstate_isa_fdc ={
 };
 
 static Property isa_fdc_properties[] = {
+DEFINE_PROP_HEX32(iobase, FDCtrlISABus, iobase, 0x3f0),
+DEFINE_PROP_UINT32(irq, FDCtrlISABus, irq, 6),
+DEFINE_PROP_UINT32(dma, FDCtrlISABus, dma, 2),
 DEFINE_PROP_DRIVE(driveA, FDCtrlISABus, state.drives[0].bs),
 DEFINE_PROP_DRIVE(driveB, FDCtrlISABus, state.drives[1].bs),
 DEFINE_PROP_INT32(bootindexA, FDCtrlISABus, bootindexA, -1),
-- 
1.7.9.1




[Qemu-devel] [PATCH 6/6] prep: use pc87312 Super I/O chip instead of collection of random ISA devices

2012-03-17 Thread Hervé Poussineau
We can't however replace the built-in IDE controller, as the one in pc87312
is only single-channel and can use only IRQ 14.

Cc: Andreas Färber andreas.faer...@web.de
Signed-off-by: Hervé Poussineau hpous...@reactos.org
---
 default-configs/ppc-softmmu.mak |2 +
 hw/ppc_prep.c   |   50 ++-
 2 files changed, 20 insertions(+), 32 deletions(-)

diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak
index 1a768fc..14568b3 100644
--- a/default-configs/ppc-softmmu.mak
+++ b/default-configs/ppc-softmmu.mak
@@ -8,6 +8,7 @@ CONFIG_M48T59=y
 CONFIG_VGA=y
 CONFIG_VGA_PCI=y
 CONFIG_SERIAL=y
+CONFIG_PARALLEL=y
 CONFIG_I8254=y
 CONFIG_PCKBD=y
 CONFIG_FDC=y
@@ -16,6 +17,7 @@ CONFIG_I82374=y
 CONFIG_OPENPIC=y
 CONFIG_PREP_PCI=y
 CONFIG_I82378=y
+CONFIG_PC87312=y
 CONFIG_MACIO=y
 CONFIG_PCSPK=y
 CONFIG_CUDA=y
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 19a674f..acb7cc5 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -211,7 +211,6 @@ typedef struct sysctrl_t {
 M48t59State *nvram;
 uint8_t state;
 uint8_t syscontrol;
-uint8_t fake_io[2];
 int contiguous_map;
 int endian;
 } sysctrl_t;
@@ -222,24 +221,6 @@ enum {
 
 static sysctrl_t *sysctrl;
 
-static void PREP_io_write (void *opaque, uint32_t addr, uint32_t val)
-{
-sysctrl_t *sysctrl = opaque;
-
-PPC_IO_DPRINTF(0x%08 PRIx32  = 0x%02 PRIx32 \n, addr - PPC_IO_BASE,
-   val);
-sysctrl-fake_io[addr - 0x0398] = val;
-}
-
-static uint32_t PREP_io_read (void *opaque, uint32_t addr)
-{
-sysctrl_t *sysctrl = opaque;
-
-PPC_IO_DPRINTF(0x%08 PRIx32  = 0x%02 PRIx32 \n, addr - PPC_IO_BASE,
-   sysctrl-fake_io[addr - 0x0398]);
-return sysctrl-fake_io[addr - 0x0398];
-}
-
 static void PREP_io_800_writeb (void *opaque, uint32_t addr, uint32_t val)
 {
 sysctrl_t *sysctrl = opaque;
@@ -506,10 +487,11 @@ static void ppc_prep_init (ram_addr_t ram_size,
 PCIBus *pci_bus;
 PCIDevice *pci;
 ISABus *isa_bus;
+ISADevice *isa;
 qemu_irq *cpu_exit_irq;
 int ppc_boot_device;
 DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
-DriveInfo *fd[MAX_FD];
+DriveInfo *drive;
 
 sysctrl = g_malloc0(sizeof(sysctrl_t));
 
@@ -635,6 +617,22 @@ static void ppc_prep_init (ram_addr_t ram_size,
 sysbus_connect_irq(pcihost-busdev, 3, qdev_get_gpio_in(pci-qdev, 11));
 isa_bus = DO_UPCAST(ISABus, qbus, qdev_get_child_bus(pci-qdev, isa.0));
 
+/* Super I/O (parallel + serial ports) */
+isa = isa_create(isa_bus, pc87312);
+qdev_prop_set_uint8(isa-qdev, config, 13); /* fdc, ser0, ser1, par0 */
+qdev_prop_set_chr(isa-qdev, parallel, parallel_hds[0]);
+qdev_prop_set_chr(isa-qdev, uart1, serial_hds[0]);
+qdev_prop_set_chr(isa-qdev, uart2, serial_hds[1]);
+drive = drive_get(IF_FLOPPY, 0, 0);
+if (drive) {
+qdev_prop_set_drive_nofail(isa-qdev, floppyA, drive-bdrv);
+}
+drive = drive_get(IF_FLOPPY, 0, 1);
+if (drive) {
+qdev_prop_set_drive_nofail(isa-qdev, floppyB, drive-bdrv);
+}
+qdev_init_nofail(isa-qdev);
+
 /* Register 8 MB of ISA IO space (needed for non-contiguous map) */
 memory_region_init_io(PPC_io_memory, PPC_prep_io_ops, sysctrl,
   ppc-io, 0x0080);
@@ -643,8 +641,6 @@ static void ppc_prep_init (ram_addr_t ram_size,
 /* init basic PC hardware */
 pci_vga_init(pci_bus);
 
-if (serial_hds[0])
-serial_isa_init(isa_bus, 0, serial_hds[0]);
 nb_nics1 = nb_nics;
 if (nb_nics1  NE2000_NB_MAX)
 nb_nics1 = NE2000_NB_MAX;
@@ -668,17 +664,7 @@ static void ppc_prep_init (ram_addr_t ram_size,
 }
 isa_create_simple(isa_bus, i8042);
 
-//SB16_init();
-
-for(i = 0; i  MAX_FD; i++) {
-fd[i] = drive_get(IF_FLOPPY, 0, i);
-}
-fdctrl_init_isa(isa_bus, fd);
-
-/* Register fake IO ports for PREP */
 sysctrl-reset_irq = first_cpu-irq_inputs[PPC6xx_INPUT_HRESET];
-register_ioport_read(0x398, 2, 1, PREP_io_read, sysctrl);
-register_ioport_write(0x398, 2, 1, PREP_io_write, sysctrl);
 /* System control ports */
 register_ioport_read(0x0092, 0x01, 1, PREP_io_800_readb, sysctrl);
 register_ioport_write(0x0092, 0x01, 1, PREP_io_800_writeb, sysctrl);
-- 
1.7.9.1




[Qemu-devel] [PATCH 5/6] prep: add pc87312 Super I/O emulation

2012-03-17 Thread Hervé Poussineau
This provides floppy and IDE controllers as well as serial and parallel ports.
However, dynamic configuration of devices is not yet supported.

Cc: Andreas Färber andreas.faer...@web.de
Signed-off-by: Hervé Poussineau hpous...@reactos.org
---
 Makefile.objs |1 +
 hw/pc87312.c  |  425 +
 2 files changed, 426 insertions(+), 0 deletions(-)
 create mode 100644 hw/pc87312.c

diff --git a/Makefile.objs b/Makefile.objs
index 226b01d..232eed0 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -252,6 +252,7 @@ hw-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
 # PPC devices
 hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
 hw-obj-$(CONFIG_I82378) += i82378.o
+hw-obj-$(CONFIG_PC87312) += pc87312.o
 # Mac shared devices
 hw-obj-$(CONFIG_MACIO) += macio.o
 hw-obj-$(CONFIG_CUDA) += cuda.o
diff --git a/hw/pc87312.c b/hw/pc87312.c
new file mode 100644
index 000..1e28dbd
--- /dev/null
+++ b/hw/pc87312.c
@@ -0,0 +1,425 @@
+/*
+ * QEMU National Semiconductor PC87312 (Super I/O)
+ *
+ * Copyright (c) 2010-2012 Herve Poussineau
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the Software), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include isa.h
+#include fdc.h
+#include ide.h
+
+//#define DEBUG_PC87312
+
+#ifdef DEBUG_PC87312
+#define DPRINTF(fmt, ...) \
+do { fprintf(stderr, pc87312:  fmt , ## __VA_ARGS__); } while (0)
+#else
+#define DPRINTF(fmt, ...) \
+do {} while (0)
+#endif
+
+#define BADF(fmt, ...) \
+do { fprintf(stderr, pc87312 ERROR:  fmt , ## __VA_ARGS__); } while (0)
+
+#define REG_FER 0
+#define REG_FAR 1
+#define REG_PTR 2
+
+#define FER regs[REG_FER]
+#define FAR regs[REG_FAR]
+#define PTR regs[REG_PTR]
+
+#define FER_PARALLEL_EN   0x01
+#define FER_UART1_EN  0x02
+#define FER_UART2_EN  0x04
+#define FER_FDC_EN0x08
+#define FER_FDC_4 0x10
+#define FER_FDC_ADDR  0x20
+#define FER_IDE_EN0x40
+#define FER_IDE_ADDR  0x80
+
+#define FAR_PARALLEL_ADDR 0x03
+#define FAR_UART1_ADDR0x0C
+#define FAR_UART2_ADDR0x30
+#define FAR_UART_3_4  0xC0
+
+#define PTR_POWER_DOWN0x01
+#define PTR_CLOCK_DOWN0x02
+#define PTR_PWDN  0x04
+#define PTR_IRQ_5_7   0x08
+#define PTR_UART1_TEST0x10
+#define PTR_UART2_TEST0x20
+#define PTR_LOCK_CONF 0x40
+#define PTR_EPP_MODE  0x80
+
+typedef struct PC87312State {
+ISADevice dev;
+uint32_t iobase;
+
+uint8_t config; /* initial configuration */
+
+struct {
+DeviceState *dev;
+CharDriverState *chr;
+} parallel;
+
+struct {
+DeviceState *dev;
+CharDriverState *chr;
+} uart[2];
+
+struct {
+DeviceState *dev;
+BlockDriverState *drive[2];
+uint32_t base;
+} fdc;
+
+struct {
+DeviceState *dev;
+uint32_t base;
+} ide;
+
+uint8_t read_id_step;
+uint8_t selected_index;
+
+uint8_t regs[3];
+} PC87312State;
+
+
+/* Parallel port */
+
+static inline bool is_parallel_enabled(PC87312State *s)
+{
+return s-FER  FER_PARALLEL_EN;
+}
+
+static const uint32_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 };
+
+static inline uint32_t get_parallel_iobase(PC87312State *s)
+{
+return parallel_base[s-FAR  FAR_PARALLEL_ADDR];
+}
+
+static const uint32_t parallel_irq[] = { 5, 7, 5, 0 };
+
+static inline uint32_t get_parallel_irq(PC87312State *s)
+{
+int idx;
+idx = (s-FAR  FAR_PARALLEL_ADDR);
+if (idx == 0) {
+return (s-PTR  PTR_IRQ_5_7) ? 7 : 5;
+} else {
+return parallel_irq[idx];
+}
+}
+
+static inline bool is_parallel_epp(PC87312State *s)
+{
+return s-PTR  PTR_EPP_MODE;
+}
+
+
+/* UARTs */
+
+static const uint32_t uart_base[2][4] = {
+{ 0x3e8, 0x338, 0x2e8, 0x220 },
+{ 0x2e8, 0x238, 0x2e0, 0x228 }
+};
+
+static inline uint32_t get_uart_iobase(PC87312State *s, int i)
+{
+int idx;
+idx = (s-FAR  (2 * i + 2))  0x3;
+if (idx == 0) {
+return 0x3f8;
+} else if (idx == 1) {
+return 0x2f8;
+

[Qemu-devel] [PATCH] configure: Fix creation of symbolic links for MinGW toolchain

2012-03-17 Thread Stefan Weil
The MinGW toolchain on w32/w64 hosts does not create symbolic links,
but implements 'ln -s' similar to 'cp -r'.

In incremental out of tree builds, this resulted in files which
were not updated when their counterparts in the QEMU source tree
changed. Especially for Makefile* this happened very often.

With this patch, the 'symlinked' files are now always updated for
out of tree builds. Similar code was already used for the symbolic
link of libcacard/Makefile.

The symlink macro always removes the target before it is created
again, therefore the rm command for libcacard/Makefile was redundant
and is removed now.

Macro symlink is also used with directories. To remove them on w32
hosts, a recursive rm is needed.

Signed-off-by: Stefan Weil s...@weilnetz.de
---
 configure |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index afe7395..acf63a9 100755
--- a/configure
+++ b/configure
@@ -41,7 +41,7 @@ compile_prog() {
 
 # symbolically link $1 to $2.  Portable version of ln -sf.
 symlink() {
-  rm -f $2
+  rm -rf $2
   ln -s $1 $2
 }
 
@@ -3883,7 +3883,7 @@ do
 done
 mkdir -p $DIRS
 for f in $FILES ; do
-if [ -e $source_path/$f ]  ! [ -e $f ]; then
+if [ -e $source_path/$f ]  [ $source_path != `pwd` ]; then
 symlink $source_path/$f $f
 fi
 done
@@ -3914,7 +3914,6 @@ done
 if [ $source_path != `pwd` ]; then
 # out of tree build
 mkdir -p libcacard
-rm -f libcacard/Makefile
 symlink $source_path/libcacard/Makefile libcacard/Makefile
 fi
 
-- 
1.7.9




Re: [Qemu-devel] [PATCH] QEMU: Add pflash support for versatile and integrator

2012-03-17 Thread Peter Maydell
On 17 March 2012 02:43, Marek Vasut marek.va...@gmail.com wrote:
 Signed-off-by: Marek Vasut marek.va...@gmail.com

This patch breaks previously working command lines -- you can't
make providing the flash binary blob mandatory.

 ---
  hw/integratorcp.c |   26 ++
  hw/versatilepb.c  |   24 
  2 files changed, 50 insertions(+), 0 deletions(-)

 diff --git a/hw/integratorcp.c b/hw/integratorcp.c
 index 5b06c81..2703ea6 100644
 --- a/hw/integratorcp.c
 +++ b/hw/integratorcp.c
 @@ -14,6 +14,9 @@
  #include net.h
  #include exec-memory.h
  #include sysemu.h
 +#include blockdev.h
 +#include exec-memory.h
 +#include flash.h

  typedef struct {
     SysBusDevice busdev;
 @@ -451,6 +454,13 @@ static void integratorcp_init(ram_addr_t ram_size,
     qemu_irq *cpu_pic;
     DeviceState *dev;
     int i;
 +    DriveInfo *dinfo;
 +
 +#ifdef TARGET_WORDS_BIGENDIAN
 +    const int be = 1;
 +#else
 +    const int be = 0;
 +#endif

I know this is how other boards do it but it's pretty ugly. We could
do with something that defines to 0/1 rather than defined/undefined
to clean this up...

     if (!cpu_model)
         cpu_model = arm926;
 @@ -469,6 +479,22 @@ static void integratorcp_init(ram_addr_t ram_size,
     memory_region_init_alias(ram_alias, ram.alias, ram, 0, ram_size);
     memory_region_add_subregion(address_space_mem, 0x8000, ram_alias);

 +    dinfo = drive_get(IF_PFLASH, 0, 0);
 +    if (!dinfo) {
 +        fprintf(stderr, Flash image must be given with the 
 +                'pflash' parameter\n);
 +        exit(1);
 +    }
 +
 +    if (!pflash_cfi01_register(0x2400,
 +                               NULL, integrator.flash0, 0x0100,
 +                               dinfo-bdrv, 0x4,
 +                               0x0100 / 0x4, 4, 0, 0, 0, 0,
 +                               be)) {
 +        fprintf(stderr, qemu: Error registering flash memory.\n);
 +        exit(1);
 +    }
 +

This doesn't look right. You have the main flash device but none
of the boot code aliasing and you haven't correctly replaced the
current fake flash memory region (registered in integratorcm_init())
with an alias into the real flash device. See the board documentation:
http://infocenter.arm.com/help/topic/com.arm.doc.dui0159b/Chdjdabb.html
for more detail of what you should be modelling.

     dev = qdev_create(NULL, integrator_core);
     qdev_prop_set_uint32(dev, memsz, ram_size  20);
     qdev_init_nofail(dev);
 diff --git a/hw/versatilepb.c b/hw/versatilepb.c
 index b9102f4..ad8429e 100644
 --- a/hw/versatilepb.c
 +++ b/hw/versatilepb.c
 @@ -17,6 +17,7 @@
  #include boards.h
  #include blockdev.h
  #include exec-memory.h
 +#include flash.h

  /* Primary interrupt controller.  */

 @@ -181,6 +182,13 @@ static void versatile_init(ram_addr_t ram_size,
     NICInfo *nd;
     int n;
     int done_smc = 0;
 +    DriveInfo *dinfo;
 +
 +#ifdef TARGET_WORDS_BIGENDIAN
 +    const int be = 1;
 +#else
 +    const int be = 0;
 +#endif

     if (!cpu_model)
         cpu_model = arm926;
 @@ -195,6 +203,22 @@ static void versatile_init(ram_addr_t ram_size,
     /* SDRAM at address zero.  */
     memory_region_add_subregion(sysmem, 0, ram);

 +    dinfo = drive_get(IF_PFLASH, 0, 0);
 +    if (!dinfo) {
 +        fprintf(stderr, Flash image must be given with the 
 +                'pflash' parameter\n);
 +        exit(1);
 +    }
 +
 +    if (!pflash_cfi01_register(0x3400,
 +                               NULL, versatile.flash0, 0x800,
 +                               dinfo-bdrv, 0x4,
 +                               0x800 / 0x4, 4, 0, 0, 0, 0,
 +                               be)) {
 +        fprintf(stderr, qemu: Error registering flash memory.\n);
 +        exit(1);
 +    }
 +

Should we support the flash remapping to address 0 on versatilepb
as well? I want to boot from a ROM image in flash seems like the
most obvious use case for providing the flash...

-- PMM



Re: [Qemu-devel] [PATCH] configure: Fix creation of symbolic links for MinGW toolchain

2012-03-17 Thread Peter Maydell
On 17 March 2012 15:31, Stefan Weil s...@weilnetz.de wrote:
 Macro symlink is also used with directories. To remove them on w32
 hosts, a recursive rm is needed.

Where do we symlink directories? (I exclude the setting up
of the linux headers because that will only happen on Linux
hosts where we know we have working symlinks.)

-- PMM



Re: [Qemu-devel] [PATCH] configure: Fix creation of symbolic links for MinGW toolchain

2012-03-17 Thread Stefan Weil

Am 17.03.2012 16:49, schrieb Peter Maydell:

On 17 March 2012 15:31, Stefan Weils...@weilnetz.de  wrote:

Macro symlink is also used with directories. To remove them on w32
hosts, a recursive rm is needed.

Where do we symlink directories? (I exclude the setting up
of the linux headers because that will only happen on Linux
hosts where we know we have working symlinks.)

-- PMM


pc-bios/keymaps

Cheers,
Stefan W.




Re: [Qemu-devel] [PATCH 1/1] Fix large memory chunks allocation with tcg_malloc.

2012-03-17 Thread Blue Swirl
Thanks, applied.

On Fri, Mar 2, 2012 at 09:22, Kirill Batuzov batuz...@ispras.ru wrote:
 An attempt to allocate a large memory chunk after a small one resulted in
 circular links in list of pools.  It caused the same memory being
 allocated twice for different arrays.

 Now pools for large memory chunks are kept in separate list and are
 freed during pool reset because current allocator can not reuse them.

 Signed-off-by: Kirill Batuzov batuz...@ispras.ru
 ---
  tcg/tcg.c |   14 +-
  tcg/tcg.h |    2 +-
  2 files changed, 10 insertions(+), 6 deletions(-)

 diff --git a/tcg/tcg.c b/tcg/tcg.c
 index 351a0a3..7db8340 100644
 --- a/tcg/tcg.c
 +++ b/tcg/tcg.c
 @@ -173,11 +173,9 @@ void *tcg_malloc_internal(TCGContext *s, int size)
         /* big malloc: insert a new pool (XXX: could optimize) */
         p = g_malloc(sizeof(TCGPool) + size);
         p-size = size;
 -        if (s-pool_current)
 -            s-pool_current-next = p;
 -        else
 -            s-pool_first = p;
 -        p-next = s-pool_current;
 +        p-next = s-pool_first_large;
 +        s-pool_first_large = p;
 +        return p-data;
     } else {
         p = s-pool_current;
         if (!p) {
 @@ -208,6 +206,12 @@ void *tcg_malloc_internal(TCGContext *s, int size)

  void tcg_pool_reset(TCGContext *s)
  {
 +    TCGPool *p, *t;
 +    for (p = s-pool_first_large; p; p = t) {
 +        t = p-next;
 +        g_free(p);
 +    }
 +    s-pool_first_large = NULL;
     s-pool_cur = s-pool_end = NULL;
     s-pool_current = NULL;
  }
 diff --git a/tcg/tcg.h b/tcg/tcg.h
 index 5c28239..48d3f17 100644
 --- a/tcg/tcg.h
 +++ b/tcg/tcg.h
 @@ -337,7 +337,7 @@ typedef struct TCGContext TCGContext;

  struct TCGContext {
     uint8_t *pool_cur, *pool_end;
 -    TCGPool *pool_first, *pool_current;
 +    TCGPool *pool_first, *pool_current, *pool_first_large;
     TCGLabel *labels;
     int nb_labels;
     TCGTemp *temps; /* globals first, temps after */
 --
 1.7.5.4





Re: [Qemu-devel] [PATCH] Fix build on FreeBSD

2012-03-17 Thread Blue Swirl
On Sat, Mar 3, 2012 at 16:34, Nathan Whitehorn nwhiteh...@freebsd.org wrote:
 Fix a missing header required to build on recent FreeBSD.

 Signed-off-by: Nathan Whitehorn nwhiteh...@freebsd.org
 ---
  os-posix.c |    4 
  1 files changed, 4 insertions(+), 0 deletions(-)

 diff --git a/os-posix.c b/os-posix.c
 index dbf3b24..83b14a0 100644
 --- a/os-posix.c
 +++ b/os-posix.c
 @@ -45,6 +45,10 @@
  #include sys/syscall.h
  #endif

These and the below CONFIG_EVENTFD stuff does not exist in QEMU git
head. Please rebase.


 +#ifdef __FreeBSD__
 +#include sys/sysctl.h
 +#endif
 +
  #ifdef CONFIG_EVENTFD
  #include sys/eventfd.h
  #endif
 --
 1.7.9





Re: [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes

2012-03-17 Thread Blue Swirl
Thanks, applied.

On Tue, Mar 13, 2012 at 06:05, Amos Kong ak...@redhat.com wrote:
 VMSTATE_VARRAY_UINT32() is used in hw/ds1225y.c, and we checked
 VMS_VARRAY_UINT32 bit of field-flags in vmstate_load_state(),
 but we don't check this bit in vmstate_save_state().

 Signed-off-by: Amos Kong ak...@redhat.com
 ---
  savevm.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

 diff --git a/savevm.c b/savevm.c
 index 80be1ff..694eaa4 100644
 --- a/savevm.c
 +++ b/savevm.c
 @@ -1486,6 +1486,8 @@ void vmstate_save_state(QEMUFile *f, const 
 VMStateDescription *vmsd,
                 n_elems = field-num;
             } else if (field-flags  VMS_VARRAY_INT32) {
                 n_elems = *(int32_t *)(opaque+field-num_offset);
 +            } else if (field-flags  VMS_VARRAY_UINT32) {
 +                n_elems = *(uint32_t *)(opaque+field-num_offset);
             } else if (field-flags  VMS_VARRAY_UINT16) {
                 n_elems = *(uint16_t *)(opaque+field-num_offset);
             } else if (field-flags  VMS_VARRAY_UINT8) {




Re: [Qemu-devel] [PULL 00/16] ppc patch queue 2012-03-15

2012-03-17 Thread Blue Swirl
On Thu, Mar 15, 2012 at 12:14, Alexander Graf ag...@suse.de wrote:
 Hi Blue / Aurelien,

 This is my current patch queue for ppc. Please pull.

Thanks, pulled.

 Alex


 The following changes since commit ae7d54d489540b49b7c13a7df7ddc220588a2ced:
  Andreas Färber (1):
        target-lm32/microblaze: Drop second CPU{LM32, MB}State typedef

 are available in the git repository at:

  git://repo.or.cz/qemu/agraf.git ppc-for-upstream

 Alex Barcelo (1):
      Bad zero comparison for sas_ss_flags on powerpc

 Alexander Graf (3):
      PPC: 405: Fix ppc405ep initialization
      PPC: KVM: Synchronize regs on CPU dump
      PPC: Fix openpic with relative memregions

 Alexey Kardashevskiy (1):
      pseries: Remove PCI device from PCI host bridge code

 David Gibson (6):
      pseries: Don't try to munmap() a malloc()ed TCE table
      pseries: Update SLOF firmware image
      pseries: Remove unused constant from PCI code
      pseries: Add support for level interrupts to XICS
      kvm: Comparison with ioctl number macros needs to be unsigned
      pseries: Configure PCI bridge using properties

 Meador Inge (1):
      ppc: Correctly define POWERPC_INSNS2_DEFAULT

 Nathan Whitehorn (2):
      PPC: Add PIR register to POWER7 CPU
      PPC: Fix large page support in TCG

 Stefan Weil (1):
      ppc: Add missing 'static' to spin_rw_ops

 Thomas Huth (1):
      PPC64: Add support for ldbrx and stdbrx instructions

  hw/openpic.c                |   12 +--
  hw/ppc405_uc.c              |    2 +
  hw/ppce500_spin.c           |    2 +-
  hw/spapr.c                  |    5 +-
  hw/spapr.h                  |   13 +++-
  hw/spapr_pci.c              |  193 
 ---
  hw/spapr_pci.h              |    4 +-
  hw/spapr_vio.c              |    2 +-
  hw/xics.c                   |  125 +---
  hw/xics.h                   |    8 ++-
  kvm-all.c                   |    5 +-
  linux-user/signal.c         |    2 +-
  pc-bios/README              |    2 +-
  pc-bios/slof.bin            |  Bin 869584 - 880496 bytes
  roms/SLOF                   |    2 +-
  target-ppc/cpu.h            |    4 +-
  target-ppc/helper.c         |   12 ++--
  target-ppc/kvm.c            |   12 ++-
  target-ppc/translate.c      |   54 ++--
  target-ppc/translate_init.c |   11 ++-
  20 files changed, 294 insertions(+), 176 deletions(-)



Re: [Qemu-devel] [PULL] Malta patches

2012-03-17 Thread Blue Swirl
On Thu, Mar 15, 2012 at 20:16, Stefan Weil s...@weilnetz.de wrote:
 Am 25.02.2012 15:43, schrieb Stefan Weil:

 Hi Aurelien,

 could you please pull some Malta patches which I had sent in January?

 http://patchwork.ozlabs.org/patch/138394/
 http://patchwork.ozlabs.org/patch/138392/
 http://patchwork.ozlabs.org/patch/138393/
 http://patchwork.ozlabs.org/patch/138391/

 Thanks,

 Stefan



 The following changes since commit
 b4bd0b168e9f4898b98308f4a8a089f647a86d16:

  audio: Add some fall through comments (2012-02-25 18:16:11 +0400)

 are available in the git repository at:

  git://qemu.weilnetz.de/qemu.git malta

 for you to fetch changes up to 10b7c0f6b6618086d54a4636e67a3e83c2bf4d5d:

  malta: Fix display for LED array (2012-02-25 15:28:38 +0100)

 
 Stefan Weil (4):
      malta: Clean allocation of bios region alias
      malta: Always allocate flash memory
      malta: Use symbolic hardware addresses
      malta: Fix display for LED array

  hw/mips_malta.c |   84
 +++---
  1 files changed, 36 insertions(+), 48 deletions(-)



 I had to rebase the patches for latest QEMU. Maybe someone wants to pull
 them.

Thanks, pulled.

 Thanks,

 Stefan Weil



 The following changes since commit ae7d54d489540b49b7c13a7df7ddc220588a2ced:

  target-lm32/microblaze: Drop second CPU{LM32, MB}State typedef (2012-03-14
 19:48:37 -0500)

 are available in the git repository at:

  git://qemu.weilnetz.de/qemu.git malta

 for you to fetch changes up to 1d7a1197068da26813e2a4706b4573143db166f5:

  malta: Fix display for LED array (2012-03-15 20:55:45 +0100)

 
 Stefan Weil (4):
      malta: Clean allocation of bios region alias
      malta: Always allocate flash memory
      malta: Use symbolic hardware addresses
      malta: Fix display for LED array

  hw/mips_malta.c |   84
 +++---
  1 files changed, 36 insertions(+), 48 deletions(-)




Re: [Qemu-devel] [PULL 0/4] arm-devs queue

2012-03-17 Thread Blue Swirl
On Fri, Mar 16, 2012 at 18:12, Peter Maydell peter.mayd...@linaro.org wrote:
 Hi; this is a pullreq for the arm-devs queue; nothing hugely exciting
 here unless you count the final part of the -dtb support. Please pull.

Thanks, pulled.

 thanks
 -- PMM

 The following changes since commit 7c51c1aa03a52b9fd75ed1ade2e65d079ae4d50e:

  Merge remote-tracking branch 'kwolf/for-anthony' into staging (2012-02-29 
 12:57:28 -0600)

 are available in the git repository at:

  git://git.linaro.org/people/pmaydell/qemu-arm.git arm-devs.for-upstream

 Grant Likely (1):
      arm: add device tree support

 Peter Maydell (1):
      hw/arm11mpcore: Fix broken realview_mpcore/arm11mpcore_priv properties

 Rusty Russell (2):
      arm: clean up GIC constants
      arm: make sure that number of irqs can be represented in GICD_TYPER.

  Makefile.target  |    1 +
  configure        |    1 +
  hw/arm-misc.h    |    1 +
  hw/arm11mpcore.c |   20 +-
  hw/arm_boot.c    |  102 ++---
  hw/arm_gic.c     |   50 --
  qemu-config.c    |    4 ++
  qemu-options.hx  |    9 +
  vl.c             |    8 
  9 files changed, 161 insertions(+), 35 deletions(-)




Re: [Qemu-devel] [PULL 0/3] target-arm queue

2012-03-17 Thread Blue Swirl
On Fri, Mar 16, 2012 at 18:21, Peter Maydell peter.mayd...@linaro.org wrote:
 Hi; this is a pullreq for my target-arm queue. Just three fairly
 minor bug fixes this time. Please pull.

Thanks, pulled.

 Thanks
 -- PMM

 The following changes since commit ae7d54d489540b49b7c13a7df7ddc220588a2ced:

  target-lm32/microblaze: Drop second CPU{LM32, MB}State typedef (2012-03-14 
 19:48:37 -0500)

 are available in the git repository at:
  git://git.linaro.org/people/pmaydell/qemu-arm.git target-arm.for-upstream

 Peter Maydell (3):
      target-arm: Fix typo in ARM946 cp15 c5 handling
      target-arm: Clear IT bits when taking exceptions in v7M
      target-arm: Decode SETEND correctly in Thumb

  target-arm/helper.c    |    5 ++-
  target-arm/translate.c |   63 ++-
  2 files changed, 43 insertions(+), 25 deletions(-)



Re: [Qemu-devel] [PATCH] softfloat: fix for C99

2012-03-17 Thread Blue Swirl
Thanks, applied.

On Tue, Dec 27, 2011 at 15:11, Avi Kivity a...@redhat.com wrote:
 C99 appears to consider compound literals as non-constants, and complains
 when they are used in static initializers.  Switch to ordinary initializer
 syntax.

 Signed-off-by: Avi Kivity a...@redhat.com
 ---
  fpu/softfloat-specialize.h |    8 
  fpu/softfloat.h            |    2 ++
  2 files changed, 6 insertions(+), 4 deletions(-)

 diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h
 index c5e2dab..4902450 100644
 --- a/fpu/softfloat-specialize.h
 +++ b/fpu/softfloat-specialize.h
 @@ -89,8 +89,8 @@ const float64 float64_default_nan = const_float64(LIT64( 
 0xFFF8 ));
  #define floatx80_default_nan_low  LIT64( 0xC000 )
  #endif

 -const floatx80 floatx80_default_nan = 
 make_floatx80(floatx80_default_nan_high,
 -                                                    
 floatx80_default_nan_low);
 +const floatx80 floatx80_default_nan
 +    = make_floatx80_init(floatx80_default_nan_high, 
 floatx80_default_nan_low);

  /*
  | The pattern for a default generated quadruple-precision NaN.  The `high' 
 and
 @@ -104,8 +104,8 @@ const floatx80 floatx80_default_nan = 
 make_floatx80(floatx80_default_nan_high,
  #define float128_default_nan_low  LIT64( 0x )
  #endif

 -const float128 float128_default_nan = 
 make_float128(float128_default_nan_high,
 -                                                    
 float128_default_nan_low);
 +const float128 float128_default_nan
 +    = make_float128_init(float128_default_nan_high, 
 float128_default_nan_low);

  /*
  | Raises the exceptions specified by `flags'.  Floating-point traps can be
 diff --git a/fpu/softfloat.h b/fpu/softfloat.h
 index 07c2929..2ce4110 100644
 --- a/fpu/softfloat.h
 +++ b/fpu/softfloat.h
 @@ -129,6 +129,7 @@ typedef struct {
     uint16_t high;
  } floatx80;
  #define make_floatx80(exp, mant) ((floatx80) { mant, exp })
 +#define make_floatx80_init(exp, mant) { .low = mant, .high = exp }
  typedef struct {
  #ifdef HOST_WORDS_BIGENDIAN
     uint64_t high, low;
 @@ -137,6 +138,7 @@ typedef struct {
  #endif
  } float128;
  #define make_float128(high_, low_) ((float128) { .high = high_, .low = low_ 
 })
 +#define make_float128_init(high_, low_) { .high = high_, .low = low_ }

  /*
  | Software IEC/IEEE floating-point underflow tininess-detection mode.
 --
 1.7.7.1





Re: [Qemu-devel] [PATCH] w64: Fix data type of next_tb and tcg_qemu_tb_exec

2012-03-17 Thread Blue Swirl
Thanks, applied.

On Fri, Mar 16, 2012 at 22:50, Stefan Weil s...@weilnetz.de wrote:
 next_tb is the numeric value of a tcg target (= QEMU host) address.

 Using tcg_target_ulong instead of unsigned long shows this and makes
 the code portable for hosts with an unusual size of long (w64).

 The type cast '(long)(next_tb  ~3)' was not needed (casting
 unsigned long to long does not change the bits, and nor does
 casting long to pointer for most (= all non w64) hosts.
 It is removed here.

 Macro or function tcg_qemu_tb_exec is used to set next_tb.
 The function also returns next_tb. Therefore tcg_qemu_tb_exec
 must return a tcg_target_ulong.

 Signed-off-by: Stefan Weil s...@weilnetz.de
 ---
  cpu-exec.c           |    6 +++---
  tcg/tcg.h            |    2 +-
  tcg/tci/tcg-target.h |    2 +-
  tci.c                |    4 ++--
  4 files changed, 7 insertions(+), 7 deletions(-)

 diff --git a/cpu-exec.c b/cpu-exec.c
 index bd5791f..0fa8325 100644
 --- a/cpu-exec.c
 +++ b/cpu-exec.c
 @@ -55,7 +55,7 @@ void cpu_resume_from_signal(CPUArchState *env, void *puc)
  static void cpu_exec_nocache(CPUArchState *env, int max_cycles,
                              TranslationBlock *orig_tb)
  {
 -    unsigned long next_tb;
 +    tcg_target_ulong next_tb;
     TranslationBlock *tb;

     /* Should never happen.
 @@ -186,7 +186,7 @@ int cpu_exec(CPUArchState *env)
     int ret, interrupt_request;
     TranslationBlock *tb;
     uint8_t *tc_ptr;
 -    unsigned long next_tb;
 +    tcg_target_ulong next_tb;

     if (env-halted) {
         if (!cpu_has_work(env)) {
 @@ -565,7 +565,7 @@ int cpu_exec(CPUArchState *env)
                     if ((next_tb  3) == 2) {
                         /* Instruction counter expired.  */
                         int insns_left;
 -                        tb = (TranslationBlock *)(long)(next_tb  ~3);
 +                        tb = (TranslationBlock *)(next_tb  ~3);
                         /* Restore PC.  */
                         cpu_pc_from_tb(env, tb);
                         insns_left = env-icount_decr.u32;
 diff --git a/tcg/tcg.h b/tcg/tcg.h
 index cc223ea..1d23d40 100644
 --- a/tcg/tcg.h
 +++ b/tcg/tcg.h
 @@ -589,5 +589,5 @@ extern uint8_t code_gen_prologue[];
  /* TCG targets may use a different definition of tcg_qemu_tb_exec. */
  #if !defined(tcg_qemu_tb_exec)
  # define tcg_qemu_tb_exec(env, tb_ptr) \
 -    ((long REGPARM (*)(void *, void *))code_gen_prologue)(env, tb_ptr)
 +    ((tcg_target_ulong REGPARM (*)(void *, void *))code_gen_prologue)(env, 
 tb_ptr)
  #endif
 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h
 index b61e99a..30a0f21 100644
 --- a/tcg/tci/tcg-target.h
 +++ b/tcg/tci/tcg-target.h
 @@ -154,7 +154,7 @@ typedef enum {

  void tci_disas(uint8_t opc);

 -unsigned long tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr);
 +tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr);
  #define tcg_qemu_tb_exec tcg_qemu_tb_exec

  static inline void flush_icache_range(tcg_target_ulong start,
 diff --git a/tci.c b/tci.c
 index fb9ebef..70e7bfb 100644
 --- a/tci.c
 +++ b/tci.c
 @@ -429,9 +429,9 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, 
 TCGCond condition)
  }

  /* Interpret pseudo code in tb. */
 -unsigned long tcg_qemu_tb_exec(CPUArchState *cpustate, uint8_t *tb_ptr)
 +tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *cpustate, uint8_t *tb_ptr)
  {
 -    unsigned long next_tb = 0;
 +    tcg_target_ulong next_tb = 0;

     env = cpustate;
     tci_reg[TCG_AREG0] = (tcg_target_ulong)env;
 --
 1.7.9





Re: [Qemu-devel] [PATCH] configure: Fix creation of symbolic links for MinGW toolchain

2012-03-17 Thread Peter Maydell
On 17 March 2012 15:59, Stefan Weil s...@weilnetz.de wrote:
 Am 17.03.2012 16:49, schrieb Peter Maydell:
 Where do we symlink directories? (I exclude the setting up
 of the linux headers because that will only happen on Linux
 hosts where we know we have working symlinks.)

 pc-bios/keymaps

Oh yes, missed that one (since it's a directory name cunningly
hidden in a variable named FILES :-)).

I'm just a little wary of 'rm -rf', especially here where
we're nuking whatever was passed as an argument and we
aren't getting the shell quoting right. In theory we could
use a wildcard for the keymaps the same way we do for a
bunch of the other pc-bios files; I'm not sure if it's worth
the effort, though.

-- PMM



Re: [Qemu-devel] [PULL 0/4] arm-devs queue

2012-03-17 Thread Peter Maydell
On 17 March 2012 16:22, Blue Swirl blauwir...@gmail.com wrote:
 On Fri, Mar 16, 2012 at 18:12, Peter Maydell peter.mayd...@linaro.org wrote:
 Hi; this is a pullreq for the arm-devs queue; nothing hugely exciting
 here unless you count the final part of the -dtb support. Please pull.

 Thanks, pulled.

Thanks. I see that I somehow managed to screw up and send the wrong
set of emails for this pullreq (resent the ones for the previous arm-devs
tree). Since the git tree url is the same you pulled the right patches,
but for the record, here's the summary and diffstat of what was actually
applied:

Juha Riihimäki (1):
  hw/omap_i2c: Convert to qdev

Mitsyanko Igor (2):
  hw/pxa2xx_dma.c: drop target_phys_addr_t usage in device state
  hw/pxa2xx_lcd.c: drop target_phys_addr_t usage in device state

Peter Maydell (2):
  ARM: Remove unnecessary subpage workarounds
  hw/pxa2xx.c: Fix handling of pxa2xx_i2c variable offset within region

 hw/arm11mpcore.c |2 -
 hw/arm_gic.c |8 ++--
 hw/arm_mptimer.c |2 -
 hw/nseries.c |   12 +++
 hw/omap.h|   13 +--
 hw/omap1.c   |   13 +--
 hw/omap2.c   |   35 --
 hw/omap_i2c.c|  107 +++---
 hw/pxa2xx.c  |3 +-
 hw/pxa2xx_dma.c  |   12 +++---
 hw/pxa2xx_lcd.c  |   12 +++---
 11 files changed, 118 insertions(+), 101 deletions(-)

Sorry for the mixup; I'll check more carefully next time...

-- PMM



Re: [Qemu-devel] [PATCH 6/6] prep: use pc87312 Super I/O chip instead of collection of random ISA devices

2012-03-17 Thread Paolo Bonzini
Il 17/03/2012 15:39, Hervé Poussineau ha scritto:
 +qdev_prop_set_chr(isa-qdev, parallel, parallel_hds[0]);
 +qdev_prop_set_chr(isa-qdev, uart1, serial_hds[0]);
 +qdev_prop_set_chr(isa-qdev, uart2, serial_hds[1]);

Set these conditionally on *_hds[] being non-NULL, so that you can use
-chardev/-global on the command-line as an alternative to -serial/-parallel.

Paolo



[Qemu-devel] Build broken -- qemu-ga: add guest-network-get-interfaces command

2012-03-17 Thread Brad Smith

Michal,

http://git.qemu.org/?p=qemu.git;a=commit;h=3424fc9f16a1e7d1c48eb6d605eb0ca63e199ec2

This broke the build. Un-break the tree.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




[Qemu-devel] SPARC64: immediate segfault on startup with git mastervery

2012-03-17 Thread Mark Cave-Ayland

Hi Avi/Blue,

I've just updated to git master and found that SPARC64 is broken again; 
a git bisect shows the following commit causes this:



commit f3705d53296d78b14f5823472ae2add16a25a0a5
Author: Avi Kivity a...@redhat.com
Date:   Thu Mar 8 16:16:34 2012 +0200

memory: make phys_page_find() return an unadjusted section

We'd like to store the section index in the iotlb, so we can't
adjust it before returning.  Return an unadjusted section and
instead introduce section_addr(), which does the adjustment later.

Signed-off-by: Avi Kivity a...@redhat.com


The symptom is that qemu-system-sparc64 segfaults immediately on startup 
(note this is with an OpenBIOS image built from SVN r1048). I've 
included a couple of backtraces below:



From commit f3705d53296d78b14f5823472ae2add16a25a0a5 (first bad commit 
above):



build@kentang:~/rel-qemu-git/bin$ gdb --args ./qemu-system-sparc64 
-cdrom /home/build/src/qemu/sparcimage/milax032sparc.iso -bios 
/home/build/src/openbios/openbios-git/openbios-devel/obj-sparc64/openbios-builtin.elf.nostrip 
-nographic -boot d

GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from 
/home/build/rel-qemu-git/bin/qemu-system-sparc64...done.

(gdb) run
Starting program: /home/build/rel-qemu-git/bin/qemu-system-sparc64 
-cdrom /home/build/src/qemu/sparcimage/milax032sparc.iso -bios 
/home/build/src/openbios/openbios-git/openbios-devel/obj-sparc64/openbios-builtin.elf.nostrip 
-nographic -boot d

[Thread debugging using libthread_db enabled]
[New Thread 0x74aab700 (LWP 17836)]
[New Thread 0x742aa700 (LWP 17837)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x742aa700 (LWP 17837)]
0x005e2d3a in memory_region_access_valid (mr=0x0, 
addr=134217936, size=4, is_write=true) at 
/home/build/src/qemu/git/qemu/memory.c:838

838 if (mr-ops-valid.accepts
(gdb) bt
#0  0x005e2d3a in memory_region_access_valid (mr=0x0, 
addr=134217936, size=4, is_write=true) at 
/home/build/src/qemu/git/qemu/memory.c:838
#1  0x005e3039 in memory_region_dispatch_write (mr=0x0, 
addr=134217936, data=0, size=4) at 
/home/build/src/qemu/git/qemu/memory.c:916
#2  0x005e5bdb in io_mem_write (io_index=210, addr=134217936, 
val=0, size=4) at /home/build/src/qemu/git/qemu/memory.c:1512
#3  0x005f22fa in io_writeq (physaddr=134217936, val=0, 
addr=134217936, retaddr=0x40001750)

at /home/build/src/qemu/git/qemu/softmmu_template.h:226
#4  0x005f241c in __stq_mmu (addr=134217936, val=0, mmu_idx=2) 
at /home/build/src/qemu/git/qemu/softmmu_template.h:255

#5  0x40001751 in ?? ()
#6  0xf42a9960 in ?? ()
#7  0x932e4434f5713900 in ?? ()
#8  0x742a9980 in ?? ()
#9  0x005fe62e in tcg_out_branch (s=Cannot access memory at 
address 0x7d8

) at /home/build/src/qemu/git/qemu/tcg/i386/tcg-target.c:948
Backtrace stopped: previous frame inner to this frame (corrupt stack?)


Interestingly enough, git master 
(361dea401f529fc136aaeb49c82b2a5bb7faa316) now gives a different backtrace:



build@kentang:~/rel-qemu-git/bin$ gdb --args ./qemu-system-sparc64 
-cdrom /home/build/src/qemu/sparcimage/milax032sparc.iso -bios 
/home/build/src/openbios/openbios-git/openbios-devel/obj-sparc64/openbios-builtin.elf.nostrip 
-nographic -boot d

GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from 
/home/build/rel-qemu-git/bin/qemu-system-sparc64...done.

(gdb) run
Starting program: /home/build/rel-qemu-git/bin/qemu-system-sparc64 
-cdrom /home/build/src/qemu/sparcimage/milax032sparc.iso -bios 
/home/build/src/openbios/openbios-git/openbios-devel/obj-sparc64/openbios-builtin.elf.nostrip 
-nographic -boot d

[Thread debugging using libthread_db enabled]
[New Thread 0x74aab700 (LWP 32400)]
[New Thread 0x742aa700 (LWP 32401)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x742aa700 (LWP 32401)]
0x005b7173 in get_page_addr_code (env1=0x11f0730, 
addr=2198754820128) at /home/build/src/qemu/git/qemu/exec.c:4602

4602if (mr != io_mem_ram  mr != io_mem_rom
(gdb) bt
#0  0x005b7173 in get_page_addr_code