qemu
15 years agoFix SDL slowness.
pbrook [Wed, 21 Jan 2009 01:50:17 +0000 (01:50 +0000)]
Fix SDL slowness.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6373 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove real_screen->pixels checks
malc [Wed, 21 Jan 2009 00:34:46 +0000 (00:34 +0000)]
Remove real_screen->pixels checks

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6372 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix user emulator breakage, based on patch by Riku Voipio
blueswir1 [Tue, 20 Jan 2009 16:57:34 +0000 (16:57 +0000)]
Fix user emulator breakage, based on patch by Riku Voipio

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6371 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix NAND flash save/restore.
pbrook [Tue, 20 Jan 2009 04:15:47 +0000 (04:15 +0000)]
Fix NAND flash save/restore.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6370 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove dumb_display (Stefan Stabellini)
aliguori [Mon, 19 Jan 2009 16:34:10 +0000 (16:34 +0000)]
Remove dumb_display (Stefan Stabellini)

However I think the following fix is cleaner: we do not need a
dumb_display_init that creates an empty DisplayChangeListener any more.
We do need a dumb_display_init that allocates a zeroed DisplayState
structure if none else does it.

Tested-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6369 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUSB OHCI: add support for big endian targets
aurel32 [Sun, 18 Jan 2009 20:56:30 +0000 (20:56 +0000)]
USB OHCI: add support for big endian targets

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6368 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agomips_malta: map the CBUS UART as the third serial port
aurel32 [Sun, 18 Jan 2009 14:28:20 +0000 (14:28 +0000)]
mips_malta: map the CBUS UART as the third serial port

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6367 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoserial: open a null device if the CharDriverState argument is null
aurel32 [Sun, 18 Jan 2009 14:28:10 +0000 (14:28 +0000)]
serial: open a null device if the CharDriverState argument is null

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6366 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoadd an init function parameter to qemu_chr_open()
aurel32 [Sun, 18 Jan 2009 14:08:04 +0000 (14:08 +0000)]
add an init function parameter to qemu_chr_open()

And use it for the malta emulation. Fix segfault introduced in
revision 6352.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6365 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agocuda: fix crash on Windows
aurel32 [Sun, 18 Jan 2009 12:16:26 +0000 (12:16 +0000)]
cuda: fix crash on Windows

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6364 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUpdate openbios-ppc to revision 418
aurel32 [Sun, 18 Jan 2009 12:16:15 +0000 (12:16 +0000)]
Update openbios-ppc to revision 418

- fix milliseconds PROM call
- fix PCI I/O ports assignation
- misc fixes

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6363 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove unused info_str parameter to pcnet_common_init()
blueswir1 [Sat, 17 Jan 2009 20:47:10 +0000 (20:47 +0000)]
Remove unused info_str parameter to pcnet_common_init()

I noticed that pcnet_common_init() takes an unused 'info_str'
parameter, added in r2142.  Since then, we always pass "pcnet"
to register_savevm() (and never "lance").

Note that r6218 changed vc->info_str to "lance" for sun4m emulation.

On the assumption that it's not needed, this patch removes the
parameter.  If reverting the change in r2142, and registering with
"lance" would be preferable, I can submit a patch to do so.

Signed-off-by: Stuart Brady <stuart.brady@gmail.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6362 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSwitch to CMD646 IDE
blueswir1 [Sat, 17 Jan 2009 18:41:53 +0000 (18:41 +0000)]
Switch to CMD646 IDE

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6361 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUse kill instead of sigqueue: re-enables AIO on OpenBSD
blueswir1 [Sat, 17 Jan 2009 06:49:15 +0000 (06:49 +0000)]
Use kill instead of sigqueue: re-enables AIO on OpenBSD

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6360 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAvoid calling qemu_mallocz with zero size
malc [Fri, 16 Jan 2009 22:32:33 +0000 (22:32 +0000)]
Avoid calling qemu_mallocz with zero size

Currently qemu_mallocz calls malloc and handling of zero by malloc is
implementation defined behaviour:
http://www.opengroup.org/onlinepubs/7990989775/xsh/malloc.html

malloc(0) on AIX returns NULL[1] and qcow2 images without snapshots
are thus unusable

[1] Unless special Linux compatibility define is used when compiling

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6359 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMake sure monitor appears as a vc
aliguori [Fri, 16 Jan 2009 21:48:20 +0000 (21:48 +0000)]
Make sure monitor appears as a vc

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6358 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agohpet config mask fix
aurel32 [Fri, 16 Jan 2009 21:38:58 +0000 (21:38 +0000)]
hpet config mask fix

I discovered a bug in the hpet code that caused Windows to boot without
hpet. The config mask I was using was preventing the guest from placing
the hpet into 32 bit mode.

(Beth Kon)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6357 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoG364 video adapter enhancement
aurel32 [Fri, 16 Jan 2009 21:13:58 +0000 (21:13 +0000)]
G364 video adapter enhancement

This patch improves G364 video card emulation (used in MIPS Magnum machine):
- Use memory dirty tracking to not refresh whole screen each time
- Use macros for debugging messages
- Add support for hardware cursor
- Handle Y-panning
- Raise irq at each screen redraw
- Support retrieving of some registers
- Add load/save support

The emulation has been tested in Linux 2.1 and Windows NT 3.5, in
640x480, 800x600, 1024x768 and 1280x1024 resolutions.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6356 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoconsole: remove trailing spaces
aurel32 [Fri, 16 Jan 2009 21:13:49 +0000 (21:13 +0000)]
console: remove trailing spaces

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6355 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSquash warnings in console.c
aliguori [Fri, 16 Jan 2009 21:06:20 +0000 (21:06 +0000)]
Squash warnings in console.c

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6354 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove assumption about a single graphic console.
aliguori [Fri, 16 Jan 2009 21:01:48 +0000 (21:01 +0000)]
Remove assumption about a single graphic console.

This fixes a fault with the jazz_led since it has two graphic consoles.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6353 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix character devices after DisplayState refactoring
aliguori [Fri, 16 Jan 2009 20:23:27 +0000 (20:23 +0000)]
Fix character devices after DisplayState refactoring

The DisplayState refactoring changed the machine init function to create a
DisplayState for each VGA device instead of being passed an existing
DisplayState.  This change is critical to enable multiple graphics device
support.

Unfortunately, the serial/parallel/console code is structured today to run
before machine init to fill out the CharDriverState table which the machine
init function uses to determine whether to create the required devices.

Since a 'vc' is a type of CharDriverState, the CharDriverState code requires
that a DisplayState exist before it runs creating a circular dependency.

To fix this, this splits the creation of the initial CharDriverState from
the initialization of the text console.  We can then in a second step associate
a DisplayState with all TextConsoles.  This allows us to create the
CharDriverState's first, machine init, then associate the TextConsoles with
a DisplayState.

This code screams for more cleanup.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6352 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix a warning in hw/blizzard.c
aurel32 [Fri, 16 Jan 2009 20:07:19 +0000 (20:07 +0000)]
Fix a warning in hw/blizzard.c

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6351 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix compilation of blizzard.c
aliguori [Fri, 16 Jan 2009 19:51:14 +0000 (19:51 +0000)]
Fix compilation of blizzard.c

ppm_save's signature changed so it needs updating.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6350 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix vga on PPC
aurel32 [Fri, 16 Jan 2009 19:45:28 +0000 (19:45 +0000)]
Fix vga on PPC

Fix crash introduced in revision 6336.

(Stefano Stabellini)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6349 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoppc_oldworld: remove i8259
aurel32 [Fri, 16 Jan 2009 19:45:19 +0000 (19:45 +0000)]
ppc_oldworld: remove i8259

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6348 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoppc_oldworld: remove debug I/O port
aurel32 [Fri, 16 Jan 2009 19:43:46 +0000 (19:43 +0000)]
ppc_oldworld: remove debug I/O port

This is specific to OpenHackware, and not used by OpenBIOS.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6347 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix warnings
blueswir1 [Fri, 16 Jan 2009 19:41:04 +0000 (19:41 +0000)]
Fix warnings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6346 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agofix screendump (Stefano Stabellini)
aliguori [Fri, 16 Jan 2009 19:07:10 +0000 (19:07 +0000)]
fix screendump (Stefano Stabellini)

this patch fixes the screendump functionality that was recently broken;
it must be applied *after* PATCH 5, 6 and 7 of the original displaystate
change patch series.
In fact the other patches make much easier to solve the screendump
problem because they make the console switching mechanism more robust.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6345 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agographical_console_init change (Stefano Stabellini)
aliguori [Fri, 16 Jan 2009 19:04:14 +0000 (19:04 +0000)]
graphical_console_init change (Stefano Stabellini)

Patch 5/7

This patch changes the graphical_console_init function to return an
allocated DisplayState instead of a QEMUConsole.

This patch contains just the graphical_console_init change and few other
modifications mainly in console.c and vl.c.
It was necessary to move the display frontends (e.g. sdl and vnc)
initialization after machine->init in vl.c.

This patch does *not* include any required changes to any device, these
changes come with the following patches.

Patch 6/7

This patch changes the QEMUMachine init functions not to take a
DisplayState as an argument because is not needed any more;

In few places the graphic hardware initialization function was called
only if DisplayState was not NULL, now they are always called.
Apart from these cases, the rest are all mechanical substitutions.

Patch 7/7

This patch updates the graphic device code to use the new
graphical_console_init function.

As for the previous patch, in few places graphical_console_init was called
only if DisplayState was not NULL, now it is always called.
Apart from these cases, the rest are all mechanical substitutions.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6344 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix false positive for AIO on OpenBSD
blueswir1 [Fri, 16 Jan 2009 18:13:32 +0000 (18:13 +0000)]
Fix false positive for AIO on OpenBSD

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6343 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix uninitialized variable warning
aliguori [Fri, 16 Jan 2009 14:27:37 +0000 (14:27 +0000)]
Fix uninitialized variable warning

r6322 introduced a warning pointed out by Jan Kiszka.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6342 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agohw/omap_sx1.c: fix build
aurel32 [Fri, 16 Jan 2009 07:31:51 +0000 (07:31 +0000)]
hw/omap_sx1.c: fix build

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6341 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoglobal s/loglevel & X/qemu_loglevel_mask(X)/ (Eduardo Habkost)
aliguori [Thu, 15 Jan 2009 22:36:53 +0000 (22:36 +0000)]
global s/loglevel & X/qemu_loglevel_mask(X)/ (Eduardo Habkost)

These are references to 'loglevel' that aren't on a simple 'if (loglevel &
X) qemu_log()' statement.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6340 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoglobal s/fflush(logfile)/qemu_log_flush()/ (Eduardo Habkost)
aliguori [Thu, 15 Jan 2009 22:35:09 +0000 (22:35 +0000)]
global s/fflush(logfile)/qemu_log_flush()/ (Eduardo Habkost)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6339 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoConvert references to logfile/loglevel to use qemu_log*() macros
aliguori [Thu, 15 Jan 2009 22:34:14 +0000 (22:34 +0000)]
Convert references to logfile/loglevel to use qemu_log*() macros

This is a large patch that changes all occurrences of logfile/loglevel
global variables to use the new qemu_log*() macros.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6338 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoexploiting the new interface in vnc.c (Stefano Stabellini)
aliguori [Thu, 15 Jan 2009 22:17:38 +0000 (22:17 +0000)]
exploiting the new interface in vnc.c (Stefano Stabellini)

This patch exploits the new DisplaySurface and PixelFormat structures in
vnc, making the code easier to read allowing further improvements.

Compared to the last version I fixed a bug that prevented the hextile
encoding from working properly.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6337 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoDisplayState interface change (Stefano Stabellini)
aliguori [Thu, 15 Jan 2009 22:14:11 +0000 (22:14 +0000)]
DisplayState interface change (Stefano Stabellini)

This patch changes the DisplayState interface adding support for
multiple frontends at the same time (sdl and vnc) and implements most
of the benefit of the shared_buf patch without the added complexity.

Currently DisplayState is managed by sdl (or vnc) and sdl (or vnc) is
also responsible for allocating the data and setting the depth.
Vga.c (or another backend) will do any necessary conversion.

The idea is to change it so that is vga.c (or another backend) together
with console.c that fully manage the DisplayState interface allocating
data and setting the depth (either 16 or 32 bit, if the guest uses a
different resolution or is in text mode, vga.c (or another backend) is
in charge of doing the conversion seamlessly).

The other idea is that DisplayState supports *multiple* frontends
like sdl and vnc; each of them can register some callbacks to be called
when a display event occurs.

The interesting changes are:

- the new structures and related functions in console.h and console.c

in particular the following functions are very helpful to manage a
DisplaySurface:

qemu_create_displaysurface
qemu_resize_displaysurface
qemu_create_displaysurface_from
qemu_free_displaysurface

- console_select and qemu_console_resize in console.c
this two functions manage multiple consoles on a single host display

- moving code around in hw/vga.c
as for the shared_buf patch this is necessary to be able to handle a dynamic
DisplaySurface bpp

- changes to vga_draw_graphic in hw/vga.c
this is the place where the DisplaySurface buffer is shared with the
videoram, when possible;

Compared to the last version the only changes are:

- do not remove support to dpy_copy in cirrus_vga
- change the name of the displaysurface handling functions

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6336 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoremove bgr (Stefano Stabellini)
aliguori [Thu, 15 Jan 2009 22:07:16 +0000 (22:07 +0000)]
remove bgr (Stefano Stabellini)

Do not handle bgr host displays in the backends.

Right now a bgr flag exists so that sdl can set it, if the SDL_Surface
is bgr.
Afterwards the graphic device (e.g. vga.c) does the needed conversion.

With this patch series is sdl that is responsible for rendering the format
provided by the graphic device that must provide a DisplaySurface
(ds->surface) in 16 or 32 bpp, rgb.
Afterwards sdl creates a SDL_Surface from the given DisplaySurface and
blits it into the main SDL_Surface using SDL_BlitSurface.

Everything is handled by sdl transparently, because SDL_BlitSurface is
perfectly capable of handling bgr displays by itself.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6335 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoreport issues causing the kvm probe to fail (Christian Ehrhardt)
aliguori [Thu, 15 Jan 2009 21:57:30 +0000 (21:57 +0000)]
report issues causing the kvm probe to fail (Christian Ehrhardt)

The patch applies to upstream qemu as well as kvm-userspace, but since it is
the qemu configure script I think it should go to upstream qemu (Anthony)
first and with the next merge to kvm-userspace. On the other hand it is the kvm
probe so an ack from Avi in case v3 is ok would be reasonable.

*updates*
v2 - it also reports other errors than just #error preprocessor statements
     (requested by Avi)
v3 - In case awk or grep is not installed it now gracfully (silently)
     fails still disabling kvm (requested by Anthony)

This patch is about reporting more details of the issue if configuring kvm
fails. Therefore this patch keeps the qemu style configure output which is a
list of "$Feature $Status", but extend the "no" result like "KVM Support no"
with some more information.

There might be a lot of things going wrong with that probe and I don't want
to handle all of them, but if it is one of the known checks e.g. for
KVM_API_VERSION then we could grep/awk that out and report it. The patch
reports in case of a known case in the style
"KVM support no - (Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS)"

In case more than one #error is triggered it creates a comma separated list in
those brackets and in case it is something else than an #error it just reports
plain old "no".

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6334 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoDefine macros that will become the new logging API (Eduardo Habkost)
aliguori [Thu, 15 Jan 2009 21:52:11 +0000 (21:52 +0000)]
Define macros that will become the new logging API (Eduardo Habkost)

These macros are NOT a proposal for a definitive new logging API. They
are just a step for it: a way to mark all usage patterns of the
logfile/loglevel variables on a single place.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6333 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoClean up debugging code #ifdefs (Eduardo Habkost)
aliguori [Thu, 15 Jan 2009 21:48:06 +0000 (21:48 +0000)]
Clean up debugging code #ifdefs (Eduardo Habkost)

Use macros to avoid #ifdefs on debugging code.

This patch doesn't try to merge logging macros from different files,
but just unify the debugging code #ifdefs onto a macro on each file. A
further cleanup can unify the debugging macros on a common header, later

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6332 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu-img: Fix type of getopt return value (Kevin Wolf)
aliguori [Thu, 15 Jan 2009 21:42:12 +0000 (21:42 +0000)]
qemu-img: Fix type of getopt return value (Kevin Wolf)

getopt doesn't return a char but an int.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6331 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix Windows build (Hervé Poussineau)
aliguori [Thu, 15 Jan 2009 21:39:41 +0000 (21:39 +0000)]
Fix Windows build (HervĂ© Poussineau)

r6303 broke Windows build, where "noreturn" is a keyword used with __declspec.
Attached patch fixes Windows build, by moving windows.h header inclusion before Qemu noreturn define.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6330 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agopowerpc/kvm: enable POWERPC_MMU_BOOKE_FSL when kvm is enabled (Liu Yu)
aliguori [Thu, 15 Jan 2009 21:24:24 +0000 (21:24 +0000)]
powerpc/kvm: enable POWERPC_MMU_BOOKE_FSL when kvm is enabled (Liu Yu)

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6329 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agopowerpc/kvm: fix a openpic bug (Liu Yu)
aliguori [Thu, 15 Jan 2009 21:19:54 +0000 (21:19 +0000)]
powerpc/kvm: fix a openpic bug (Liu Yu)

An external interrupt should not interrupted in-servicing interrupt with equal priority.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6328 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agopowerpc/kvm: Fix a uninitialized bug (Liu Yu)
aliguori [Thu, 15 Jan 2009 21:18:42 +0000 (21:18 +0000)]
powerpc/kvm: Fix a uninitialized bug (Liu Yu)

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6327 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix kvm configure test for PPC
aliguori [Thu, 15 Jan 2009 21:13:33 +0000 (21:13 +0000)]
Fix kvm configure test for PPC

QEMU uses "ppc" whereas Linux uses "powerpc".

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6326 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoHandle SDL grabs failing (Mark McLoughlin)
aliguori [Thu, 15 Jan 2009 20:47:45 +0000 (20:47 +0000)]
Handle SDL grabs failing (Mark McLoughlin)

If a X window is not viewable, XGrabPointer() fails and
returns GrabNotViewable. SDL's X backend currently handles
this by retrying the grab until the window becomes viewable
again.

This means e.g. if you Ctrl-Alt-RightArrow to switch
workspaces, QEMU tries to grab, SDL blocks because the
window isn't viewable and your guest stops executing until
you switch back to that workspace again.

See this Fedora bug for the gory details:

  https://bugzilla.redhat.com/480065

Some SDL backends will return SDL_GRAB_OFF from
SDL_WM_GrabInput(), so the fix is to make the X backend do
this if the grab fails.

The only side-effect in QEMU is that if SDL_WM_GrabInput()
fails we still change the window title to indicate that it's
grabbed, when in fact it's not. This patch fixes that minor
issue.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6325 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoReturn -errno on write failure (Gleb Natapov)
aliguori [Thu, 15 Jan 2009 20:44:26 +0000 (20:44 +0000)]
Return -errno on write failure (Gleb Natapov)

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6324 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agobdrv_write should not stop on partial write (Gleb Natapov)
aliguori [Thu, 15 Jan 2009 20:43:39 +0000 (20:43 +0000)]
bdrv_write should not stop on partial write (Gleb Natapov)

Should return real error instead.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6323 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoadd a -vga none cli option (Stefano Stabellini)
aliguori [Thu, 15 Jan 2009 20:37:28 +0000 (20:37 +0000)]
add a -vga none cli option (Stefano Stabellini)

currently there is no way to fully disable any graphic card device for
the PC architecture.
You can have no graphical output, thanks to -nographic, but you would
have the VGA device connected to your PCI bus anyway.
There is already a convenient -vga option to choose between std, cirrus
and vmware; this patch add the new option "none" to select no graphic
card at all.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6322 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdopt cpu_copy to new breakpoint API (Jan Kaszka)
aliguori [Thu, 15 Jan 2009 20:16:51 +0000 (20:16 +0000)]
Adopt cpu_copy to new breakpoint API (Jan Kaszka)

Latest changes to the cpu_breakpoint/watchpoint API broke cpu_copy. This
patch fixes it by cloning the breakpoint and watchpoint lists
appropriately.

Thanks to Lionel Landwerlin for pointing out.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6321 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd -rtc-td-hack option to fix time drift with RTC on Windows (Gleb Natapov)
aliguori [Thu, 15 Jan 2009 20:11:34 +0000 (20:11 +0000)]
Add -rtc-td-hack option to fix time drift with RTC on Windows (Gleb Natapov)

After my last patch to fix interrupt coalescing was rejected
on the basis that it is too intrusive we decided to make the
fix much more localized and only fix the problem for RTC time
source. Unfortunately it is impossible to fix the problem entirely
inside RTC code like Andrzej proposed since Windows reads RTC
register C more then once on each time interrupt so it is impossible
to count reliably how many interrupt windows actually handled.
Proposed solution is localized to I386 target and is disabled by
default. To enable it "-rtc-td-hack" flag should be used.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6320 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoadd virtio-console initializer for powerpc (Christian Ehrhardt)
aliguori [Thu, 15 Jan 2009 20:08:19 +0000 (20:08 +0000)]
add virtio-console initializer for powerpc (Christian Ehrhardt)

This adds an intialization of virtio console for powerpc.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6319 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoadd virtio-console initializer for x86 (Christian Ehrhardt)
aliguori [Thu, 15 Jan 2009 20:07:22 +0000 (20:07 +0000)]
add virtio-console initializer for x86 (Christian Ehrhardt)

This adds an intialization of virtio console for pc style hardware.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6318 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoadd virtio-console cmdline option (Christian Ehrhardt)
aliguori [Thu, 15 Jan 2009 20:06:40 +0000 (20:06 +0000)]
add virtio-console cmdline option (Christian Ehrhardt)

This patch adds the typical qemu console command line switch to the virtio
console. using -virtioconsole ARG it can now be specified what output a guest
hvc should be redirected to.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6317 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd missing files from last commit.
aliguori [Thu, 15 Jan 2009 20:05:50 +0000 (20:05 +0000)]
Add missing files from last commit.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6316 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoadd virtio-console support (Christian Ehrhardt)
aliguori [Thu, 15 Jan 2009 20:05:25 +0000 (20:05 +0000)]
add virtio-console support (Christian Ehrhardt)

This patch adds the virtio console to qemu. This console can be found after the
serial and parallel outputs as another virtual console. In the -nographic case
it is redirected to the null output by default.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6315 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agocuda: fix indentation
aurel32 [Thu, 15 Jan 2009 18:57:25 +0000 (18:57 +0000)]
cuda: fix indentation

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6314 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agocuda: improve date/time read/write
aurel32 [Thu, 15 Jan 2009 18:57:15 +0000 (18:57 +0000)]
cuda: improve date/time read/write

- Allow date/time to be written
- Use qemu_get_timedate() to initialize the clock

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6313 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix bsd-user build
blueswir1 [Thu, 15 Jan 2009 17:27:45 +0000 (17:27 +0000)]
Fix bsd-user build

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6312 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoLSI53C895A: Introduce CASE_GET_REG24
aurel32 [Wed, 14 Jan 2009 21:42:48 +0000 (21:42 +0000)]
LSI53C895A: Introduce CASE_GET_REG24

CASE_GET_REG32 is already defined in lsi53c895a.c; introduce CASE_GET_REG24.

(Sebastian Herbszt)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6311 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix day of week in mc146818
aurel32 [Wed, 14 Jan 2009 21:09:07 +0000 (21:09 +0000)]
Fix day of week in mc146818

According to mc146818 specification, Day of Week register (#6) is between 1
and 7, 1 representing Sunday. According C specification, tm_wday field in
struct tm is between 0 and 6, 0 representing Sunday.

Bit 2 of register B (#11) is named DM (data mode) and specifies if RTC
stores values in BCD or in binary form.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6310 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agosh4: Add FMAC instruction support
aurel32 [Wed, 14 Jan 2009 21:02:59 +0000 (21:02 +0000)]
sh4: Add FMAC instruction support

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Lionel Landwerlin <lionel.landwerlin@openwide.fr>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6309 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: fix wrteei instruction
aurel32 [Wed, 14 Jan 2009 19:40:54 +0000 (19:40 +0000)]
target-ppc: fix wrteei instruction

Patch by Andrew May

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6308 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: optimize some gpr accesses
aurel32 [Wed, 14 Jan 2009 19:40:46 +0000 (19:40 +0000)]
target-mips: optimize some gpr accesses

Optimize gpr accesses when it is known at translation time that gpr != 0.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6307 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: fix indentation
aurel32 [Wed, 14 Jan 2009 19:40:36 +0000 (19:40 +0000)]
target-mips: fix indentation

Remove all tabs from target-mips/*

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6306 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoGet rid of user_mode_only
aurel32 [Wed, 14 Jan 2009 19:40:27 +0000 (19:40 +0000)]
Get rid of user_mode_only

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6305 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSuppress i386 warnings
blueswir1 [Wed, 14 Jan 2009 19:27:02 +0000 (19:27 +0000)]
Suppress i386 warnings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6304 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd noreturn function attribute
blueswir1 [Wed, 14 Jan 2009 19:00:36 +0000 (19:00 +0000)]
Add noreturn function attribute

Introduce noreturn attribute and attach it to cpu_loop_exit as well as
interrupt/exception helpers for i386. This avoids a bunch of gcc4
warnings.

[ Note that this patch comes with a workaround to include qemu-common.h
even in cases where is currently causes conflicts with dyngen-exec.h.
I've been told that these conflicts will get resolved in the future
(/me will try to have a look as well - as time permits). ]

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6303 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMigrate to check_define
malc [Wed, 14 Jan 2009 18:39:52 +0000 (18:39 +0000)]
Migrate to check_define

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6302 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove all traces of __powerpc__
malc [Wed, 14 Jan 2009 18:39:49 +0000 (18:39 +0000)]
Remove all traces of __powerpc__

According to $GCC/gcc/config/rs6000/rs6000-c.c _ARCH_PPC is the
ubiquitous define which should be used to test whether gcc targets
PowerPC, on 64bit platforms _ARCH_PPC64 will be also defined.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6301 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix some more warnings
blueswir1 [Wed, 14 Jan 2009 18:34:22 +0000 (18:34 +0000)]
Fix some more warnings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6300 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMake OpenBSD sparc-softmmu compile warning free
blueswir1 [Wed, 14 Jan 2009 18:08:08 +0000 (18:08 +0000)]
Make OpenBSD sparc-softmmu compile warning free

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6299 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix _P use on OpenBSD
blueswir1 [Wed, 14 Jan 2009 18:04:52 +0000 (18:04 +0000)]
Fix _P use on OpenBSD

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6298 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix iovec probe on OpenBSD
blueswir1 [Wed, 14 Jan 2009 18:03:53 +0000 (18:03 +0000)]
Fix iovec probe on OpenBSD

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6297 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoPPC OldWorld: use a more realistic timer frequency
aurel32 [Wed, 14 Jan 2009 14:48:04 +0000 (14:48 +0000)]
PPC OldWorld: use a more realistic timer frequency

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6296 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoescc: allow one IRQ per serial channel
aurel32 [Wed, 14 Jan 2009 14:47:56 +0000 (14:47 +0000)]
escc: allow one IRQ per serial channel

The Z85C30 on the PowerMAC machines have one interrupt per serial
channel, while the Sparc machines have only one for both. Allow the
emulated device to use one IRQ per channel.

Patch by Laurent Vivier.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6295 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUpdate OpenBIOS PowerPC image to revision 406
aurel32 [Wed, 14 Jan 2009 14:47:46 +0000 (14:47 +0000)]
Update OpenBIOS PowerPC image to revision 406

- Support kernel arguments through -append
- Quik support
- PowerMac serial ports supports

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6294 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix building on PPC64
malc [Wed, 14 Jan 2009 10:14:31 +0000 (10:14 +0000)]
Fix building on PPC64

HOST_PPC alone can't be a substitute for __powerpc__ which is defined
for both 32 and 64bit PPCs, so go with HOST_PPC || HOST_PPC64 instead.

Reported by C. W. Betts

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6293 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoDo not rely on __powerpc__ being defined as a feature test macro
malc [Tue, 13 Jan 2009 23:12:34 +0000 (23:12 +0000)]
Do not rely on __powerpc__ being defined as a feature test macro

__powerpc__ is not defined on AIX and Darwin, Makefile.target adds
it to CPPFLAGS for target specific code which cache-utils are not.

Since there's not common definition which can safely be used on all
platforms use HOST_PPC provided by config-host.h

The problem was originally reported by C. W. Betts

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6292 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMake virtio_net_init() return void (Mark McLoughlin)
aliguori [Tue, 13 Jan 2009 21:09:18 +0000 (21:09 +0000)]
Make virtio_net_init() return void (Mark McLoughlin)

All PCI NIC init functions return void and nothing uses the
return value from virtio_net_init().

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6291 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agosun4c/sun4d: also swap the CharDriverState of escc_init()
aurel32 [Tue, 13 Jan 2009 20:08:43 +0000 (20:08 +0000)]
sun4c/sun4d: also swap the CharDriverState of escc_init()

Forgotten in r6284

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6290 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUpdate bochs bios
aliguori [Tue, 13 Jan 2009 20:06:26 +0000 (20:06 +0000)]
Update bochs bios

They have applied all of our patches and they have an additional HPET fix.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6289 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix 64 bit issue in slirp
blueswir1 [Tue, 13 Jan 2009 19:48:42 +0000 (19:48 +0000)]
Fix 64 bit issue in slirp

Signed-off-by: Gleb Natapov <gleb@redhat.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6288 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMake pci_nic_init() use qemu_setup_nic_model() (Mark McLoughlin)
aliguori [Tue, 13 Jan 2009 19:47:10 +0000 (19:47 +0000)]
Make pci_nic_init() use qemu_setup_nic_model() (Mark McLoughlin)

Add a table of PCI NIC models to pass to qemu_setup_nic_model().

While we're at it, also add a corresponding table of NIC init
functions.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6287 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoCheck NIC model in some NIC init functions (Mark McLoughlin)
aliguori [Tue, 13 Jan 2009 19:39:36 +0000 (19:39 +0000)]
Check NIC model in some NIC init functions (Mark McLoughlin)

Some NIC init functions are only called when that model is
the only valid model. In that case, it makes sense to use
qemu_check_nic_model() from the NIC init function itself.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6286 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix tap downscript argument (Mark McLoughlin)
aliguori [Tue, 13 Jan 2009 19:15:55 +0000 (19:15 +0000)]
Fix tap downscript argument (Mark McLoughlin)

Kill off the hack that parses info_str for the tap interface
name to pass as the argument to the downscript and, instead,
just explicitly keep a copy of the string for later.

As reported by John Wong, this commit:

  Add qemu_format_nic_info_str()

changed the invocation of downscript from e.g.

  /path/kvm-ifdown "tap0"

to:

  /path/kvm-ifdown "tap0,script=/path/kvm-ifup,downscript=/path/kvm-ifdown"

This fix restores the original behavior.

Reported-by: John Wong <johnw@wonghome.net>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6285 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoESCC: swap the two CharDriverState arguments
aurel32 [Tue, 13 Jan 2009 19:08:18 +0000 (19:08 +0000)]
ESCC: swap the two CharDriverState arguments

Swap the two CharDriverState arguments so that the first argument
corresponds to the channel A and the second argument to the channel B.

Modify hw/sun4m.c accordingly.

This fixes the order of the serial ports on the PPC machines.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6284 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: define max amount of memory for G3 beige
aurel32 [Tue, 13 Jan 2009 19:08:10 +0000 (19:08 +0000)]
target-ppc: define max amount of memory for G3 beige

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6283 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: fix comment about boot device in ppc_oldworld.c
aurel32 [Tue, 13 Jan 2009 19:07:59 +0000 (19:07 +0000)]
target-ppc: fix comment about boot device in ppc_oldworld.c

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6282 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd qemu_check_nic_model() and qemu_check_nic_model_list() (Mark McLoughlin)
aliguori [Tue, 13 Jan 2009 19:03:57 +0000 (19:03 +0000)]
Add qemu_check_nic_model() and qemu_check_nic_model_list() (Mark McLoughlin)

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6281 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix gdbserver number of registers (Tristan Gingold)
blueswir1 [Tue, 13 Jan 2009 16:28:01 +0000 (16:28 +0000)]
Fix gdbserver number of registers (Tristan Gingold)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6280 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRTL8139: Latch C+ mode state instead of inferring it from C+ Command register (Avi...
aliguori [Tue, 13 Jan 2009 15:20:14 +0000 (15:20 +0000)]
RTL8139: Latch C+ mode state instead of inferring it from C+ Command register (Avi Kivity)

It was observed that Windows 2003 x64 hangs when shutting down if an
RTL8139 NIC and a USB device tablet are both present.  What seems to be
happening is:

- the guest shuts down the transmitter and receiver
- time passes
- the guest requests a tally counter dump

As it happens, the tally counter command register overlaps the transmit
status register in C mode.  Qemu determines whether the chip is in C or C+
mode by looking at the C+ transmit enable bit; as this is now unset, the
dump tally counter command is interpreted as a C mode transmit command.  The
guest doesn't think so, however, and continues to poll for completion of the
tally counter dump command.  This never occurs, so the guest hangs.

Fix by redefining C+ mode as "a write to the C+ command register has occurred
since the last reset".  The data sheet is silent on the matter.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6279 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix race in POSIX AIO emulation (Jan Kiszka)
aliguori [Tue, 13 Jan 2009 15:13:53 +0000 (15:13 +0000)]
Fix race in POSIX AIO emulation (Jan Kiszka)

When we cancel an AIO request that is already being processed by
aio_thread, qemu_paio_cancel should return QEMU_PAIO_NOTCANCELED as long
as aio_thread isn't done with this request. But as the latter currently
updates aiocb->ret after every block of the request, we may report
QEMU_PAIO_ALLDONE too early.

Futhermore, in case some zero-length request should have been queued,
aiocb->ret is never set to != -EINPROGRESS and callers like
raw_aio_cancel could get stuck in an endless loop.

Fix those issues by updating aiocb->ret _after_ the request has been
fully processed. This also simplifies the locking.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6278 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-alpha: get rid of tests on env->user_mode_only
aurel32 [Mon, 12 Jan 2009 21:33:22 +0000 (21:33 +0000)]
target-alpha: get rid of tests on env->user_mode_only

Replace runtime checks on env->user_mode_only by compile time
checks on CONFIG_USER_ONLY.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6277 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: get rid of tests on env->user_mode_only
aurel32 [Mon, 12 Jan 2009 21:33:13 +0000 (21:33 +0000)]
target-mips: get rid of tests on env->user_mode_only

Replace runtime checks on env->user_mode_only by compile time
checks on CONFIG_USER_ONLY.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6276 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: add altivec cache instructions
aurel32 [Mon, 12 Jan 2009 21:33:02 +0000 (21:33 +0000)]
target-ppc: add altivec cache instructions

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6275 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix TLB access (Jakub Jermar)
blueswir1 [Mon, 12 Jan 2009 21:12:22 +0000 (21:12 +0000)]
Fix TLB access (Jakub Jermar)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6274 c046a42c-6fe2-441c-8c8c-71466251a162