For Non-MAPCACHE case, to get the virtual address corresponding to
guest physical address, only an offset value is added to guest
physical address. With this patch, ia64 HVM boot failure bug can be
fixed.
[ This reverts part of 2ed2ee1704a4ef956ecc61848c84d12aaa4419d5,
once again removing the bounce buffer in the non-MAPCACHE
version of cpu_physical_memory_map. -iwj ]
Ian Jackson [Wed, 8 Apr 2009 16:32:57 +0000 (17:32 +0100)]
sync DisplayAllocator interface
this simple patch sync's the DisplayAllocator interface with upstream
qemu. The only non trivial change, is the new ability for sdl to support
the DisplayAllocator interface, hence improving performances (avoid a
memcpy) when the guest is in text mode or uses a color depth of 8bpp or
24bpp (no DisplayState surface sharing allowed).
Ian Jackson [Fri, 3 Apr 2009 15:17:22 +0000 (16:17 +0100)]
Reinstate bounce-buffer-based cpu_physical_memory_[un]map for ia64
This patch fixes the compilation error caused by the change set
of 191158d4c289d1bf7c154ad6b51f776f680982d5.
ia64 doesn't support mapcache yet, so not-mapcache version
of cpu_physical_memory_map/unmap are still necessary.
Ian Jackson [Tue, 31 Mar 2009 16:19:49 +0000 (17:19 +0100)]
block-vbd: implement support for splitting requests
the main issue with stubdoms at the moment is that the new dma api does
not support an upper limit for the number of sectors in a single dma
transfer.
This means that block-vbd can issue blkfront_aio transfers that exceed
the blktap limit BLKIF_MAX_SEGMENTS_PER_REQUEST.
The attached qemu patch makes block-vbd split any request bigger than
the limit above.
The small xen patch is also needed to change struct blkfront_aiocb.
[ The corresponding changeset in xen-unstable is 19463:f2cf89a4e762 -iwj ]
Ian Jackson [Tue, 31 Mar 2009 15:54:56 +0000 (16:54 +0100)]
xen: use mapcache for cpu_physical_memory_map
this patch improves qemu-xen's mapcache to be able to guarantee that
certain mappings are going to last until explicitly unmapped.
This capability is necessary to implement cpu_physical_memory_map and
cpu_physical_memory_unmap that are part of the new dma api.
This patch also provides the implementation of these two functions,
removing the one based on bounce buffers that we are currently using.
Current DMA throughput: ~10MB/s
DMA throughput with this patch: ~27MB/s
Ian Jackson [Tue, 31 Mar 2009 15:52:24 +0000 (16:52 +0100)]
passthrough: Allow slots 1e and 1f to be used
This fixes an oversight in my recent patch "Allow any unused PCI device to
be used for pass-through" whereby attempts to use slots 1e and 1f for
pass-through would silently fail.
* This affects both static and manual selection of slots
* This affects both hot-plug and static pass-through
Ian Jackson [Tue, 31 Mar 2009 14:37:58 +0000 (15:37 +0100)]
Fixes from Christoph Egger
- xen-vl-exra.c: Only compile pci_emulation_add() w/ CONFIG_PASSTHROUGH
- Fix compiler confusion with tokens after #endif
- qemu-common.h: Fix merge botch with upstream
- qemu-xen.h: remove redundant declaration of pci_xen_platform_init
- xen_platform.c: take declaration of pci_xen_platform_init from
xen_platform.h
- xen_platform.c: Make platform_fixed_ioport_save and
platform_fixed_ioport_load static. They have no prototypes and aren't
used elsewhere
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Ian Jackson [Tue, 31 Mar 2009 10:45:38 +0000 (11:45 +0100)]
passthrough: Fix duplicated MAC addr when multi-port NIC assigned to HVM domain
This patch fixes duplicated MAC address when multi-port NIC is
assigned to HVM domain.
Currently multi-function device is shown as two single function
devices. e1000e driver and igb driver for linux add 1 to MAC address of
second port of multi-port NIC. But they don't add 1 to MAC address of
second port if NIC is single-function device. Because of this, the MAC
addresses of the first port and the second port are duplicated.
The patch make Header Type register passthrough-type. This means a
multi-function device is shown as two multi-function devices which
implement only one function. So e1000e driver and igb driver add 1 to
MAC address of second port.
When we use windows guest, the same issue occurs, the patch fix it.
Ian Jackson [Tue, 31 Mar 2009 10:40:30 +0000 (11:40 +0100)]
ioemu: allow xend to specify the slot for pass-through devices
Currently a slot may be specified for a hot-plug device,
but not for a pass-through device that is inserted at boot time.
This patch adds support for the latter.
The syntax is:
BUS:DEV.FUNC[@VSLOT]
e.g: 0000:00:1d:0@7
This may be important as recent changes that allow any free PCI
slot to be used for pass-through (and hotplug) may case pass-through
devices to be assigned in different locations to before. Amongst
other things, specifying the slot will allow users to move them
back, if there is a need.
There is also a xend portion of this patch, which will be posted separately.
Ian Jackson [Tue, 31 Mar 2009 10:38:55 +0000 (11:38 +0100)]
ioemu: Do slot parsing inside of next_bdf
Currently only hotplug provides vslot information from xend.
A subsequent patch will have xend provide this information
for boot-time inserted pass-through devices too.
With this in mind, this patch makes some infrastructure
to parse bdf + slot information.
Ian Jackson [Wed, 25 Mar 2009 11:38:29 +0000 (11:38 +0000)]
passthrough: fix buffer overflow of vslots
Assuming we assign n devices, strlen(direct_pci) can be 13n and the
length of the old 'vslots' is 13n/3 which is smaller than 5n+1 (1
slot_str takes 5 bytes). So we have to malloc a bigger buffer for
vslots.
Ian Jackson [Wed, 25 Mar 2009 11:35:42 +0000 (11:35 +0000)]
passthrough: Register dpci_infos.php_devs.pt_dev in a common location
Currently power_on_php_slot() sets dpci_infos.php_devs[i].pt_dev itself
after the call to register_real_device(). While pt_init relies on
power_on_php_slot() to set this pointer.
It seems sensible to use the same behaviour for both callers.
There are no other callers of register_real_device()
Ian Jackson [Tue, 24 Mar 2009 18:23:29 +0000 (18:23 +0000)]
passthrough: fix pt_chk_bar_overlap
This patch fixes pt_chk_bar_overlap.
Current pt_chk_bar_overlap does not distinguish memory resources and
io resources. They are placed in different address space. So
pt_chk_bar_overlap should distinguish them.
This patch fixes MSI/MSI-X capability structure virtualization code.
Currently, xen does not support multiple message (multiple vector).
So multiple message capable field should be emulated and fixed to 0
(single vector).
With the patch, my FC-HBA works when I assign it to guest domain where
windows 2008 runs.
In addition to this, initial values of emulated registers should be
the same with initial values defined in PCI spec. If initial values
are not defined, they should be 0. The emulated field mask and
read-only field mask are also fixed.
Ian Jackson [Tue, 24 Mar 2009 18:12:39 +0000 (18:12 +0000)]
cirrus: Do not clear vram area to 0xff when not yet allocated.
When restoring, the vram data pointer is not valid until (depending on
the version of the savefile) the guest has informed us what memory to
use. Thus vram_ptr may be NULL. In this patch we avoid attempting to
clear the video ram in this case.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 24 Mar 2009 13:30:10 +0000 (13:30 +0000)]
ioemu: emulate No_Soft_Reset in PMCSR
When pci_power_mgmt=0, the No_Soft_Reset field in power
management control/status register of a PCI device needs to be
emulated and fixed to 1. This bit indicates that devices
transitioning from D3 to D0 because of PowerState commands do not
perform an internal reset.
Ian Jackson [Mon, 23 Mar 2009 17:15:12 +0000 (17:15 +0000)]
fix stubdomain after DisplayState changes
this patch fixes few stubdom issues arised after the recent DisplayState
changes (not yet pushed to qemu-xen-unstable).
The main problem is that we need to touch the newly allocated pages
before sharing them, because minios allocates on first write.
Ian Jackson [Mon, 23 Mar 2009 17:00:50 +0000 (17:00 +0000)]
Fix passthrough regression
pt_init() iterates through the PHP slots independantly of
the assignment that occurs inside __insert_to_pci_slot
which is called by register_real_device(). It assumes
that vslots are assigned in order sarting at PHP_SLOT_START.
This was valid before my change, although why it didn't take the
simpler option of just checking what value had been assigned to
pt_dev->dev.devfn in register_real_device() is a mystery to
me [Simon]. Its also a mystery to what valid circumstance could lead
to pt_init() using 0 (a.k.a. unknown?) as the vslot.
My patch made one the assumptions that pt_init() made about slot numbers
invalid. That is, they don't start at PHP_SLOT_START, they start
wherever there is a free device.
A simple solution seems to be to use the value assigned to
pt_dev->dev.devfn in register_real_device().
Ian Jackson [Mon, 23 Mar 2009 16:47:35 +0000 (16:47 +0000)]
Fixes for git ioemu tree from Christoph Egger
Make ioemu build w/o CONFIG_PASSTHROUGH
- Make ioemu build w/ TAPGIFNAME defined
- Make pci_emulation_add non-static as it is used in different files
- remove redundant variable re-declarations/re-definitions
- Make xenstore functions static. They have no prototypes and aren't used
elsewhere
- Initialize xenpv_machine correctly (xen_init_pv didn't match what
QEMUmachine expected)
- Misc compiler warning fixes
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Ian Jackson [Mon, 23 Mar 2009 16:35:27 +0000 (16:35 +0000)]
Correct compilation error in bdf_to_slow
This commit:
commit 3fcc8c62058a60a31d762da627d4325137eea813
make __insert_to_pci_slot idempotent Signed-off-by: Simon Horman <horms@verge.net.au>
has a trivial compilation error which I now fix.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Mon, 23 Mar 2009 15:58:28 +0000 (15:58 +0000)]
More stubdom build fixes.
* Do not fail to build stubdom if the compiler fails to optimise out
never-called static functions containing undefined references.
* Properly disable stubdom ioemu docs build.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 18 Mar 2009 16:32:53 +0000 (16:32 +0000)]
Post-merge compilation fixes for stubdom
Much of this is very ugly. Sadly that's a consequence of the stubdom
and upstream build systems and nothing much can be done about it.
However on the upside with this change we discontinue use of the
upstream `configure' script for stubdom (as it gives wrong answers),
in favour of a new xen-setup-stubdom script.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Before pt_config_delete() ->
qemu_free_timer(ptdev->pm_state->pm_timer), we should invoke
qemu_del_timer(), otherwise, qemu_run_timers() would access a
qemu_free_timer()-ed timer. The below patch fixes the issue.
Ian Jackson [Mon, 16 Mar 2009 18:03:23 +0000 (18:03 +0000)]
passthrough: make management of PCI D-states by guest optional
Commit 8c771eb6294afc5b3754a9e3de51568d4e5986c2 enables the guest OS
to program D0-D3hot states of the assigned device, however,
D3hot state in some PCI devices causes the failure of domain
creation/destruction.
Ian Jackson [Mon, 16 Mar 2009 17:25:35 +0000 (17:25 +0000)]
xenfb shared buffer
After the recent DisplayState changes is now possible to share the xenfb
backend buffer with the display frontend (sdl, vnc), avoid a memcpy for
each screen update.
Ian Jackson [Mon, 16 Mar 2009 16:52:21 +0000 (16:52 +0000)]
qemu-dm: Provide bounce-buffer based cpu_physical_memory_map
The xc_map_foreign_batch version was slow (and also apparently buggy).
The bounce buffer version works nicely, although we have to
clone-and-hack a bunch of stuff from exec.c.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Mon, 16 Mar 2009 16:50:49 +0000 (16:50 +0000)]
Fix option parsing; override upstream `-d' option for `domain'.
Pending change to xend to pass arguments differently, we need to
suppress the -d logfile parameter. Also we accidentally dropped
HAS_ARG from -vcpus during the merge.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 10 Mar 2009 18:17:31 +0000 (18:17 +0000)]
introducing a DisplayAllocator interface
This patch introduces a new DisplayAllocator interface to allow
frontends to allocate the DisplaySurface for the graphic device to use.
At the moment it is used only by xenfbfront, to be able to page align
the displaysurface and also keep the same backing data across multiple
DisplaySurface resize.
Howeveri in the near future it is going to be a useful improvement for
SDL as well.
Ian Jackson [Tue, 10 Mar 2009 18:16:52 +0000 (18:16 +0000)]
fix xenfb frontend and backend
Due to the DisplayState changes the initialization order is changed
as well.
Now graphic devices are the first to be initialized and only after them
any display frontend is initialized.
Obviously this change has a direct consequence on the xenfb backend and
frontend and this patch takes care of adapting them to the new
initialization order.
Ian Jackson [Tue, 10 Mar 2009 18:13:07 +0000 (18:13 +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.
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>
As adapted by Stefano to qemu-xen-unstable in his posting:
[Xen-devel] [PATCH 6 of 13] graphical_console_init change
which also contains several following fixes.
Ian Jackson [Tue, 10 Mar 2009 18:04:43 +0000 (18:04 +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>
As adapted by Stefano to qemu-xen-unstable in his posting:
[Xen-devel] [PATCH 5 of 13] exploiting the new interface in vnc.c
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:
- 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>
As adapted by Stefano to qemu-xen-unstable in his posting:
[Xen-devel] [PATCH 4 of 13] DisplayState interface change
Ian Jackson [Tue, 10 Mar 2009 17:59:47 +0000 (17:59 +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>
Patch adapted for qemu-xen-unstable by Stefano Stabellini. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Patch adapted for qemu-xen-unstable by Stefano Stabellini. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Also additional fixes supplied by Stefano in his message
[Xen-devel] [PATCH 2 of 13] Introduce accessors for DisplayState Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Jackson [Tue, 10 Mar 2009 17:56:42 +0000 (17:56 +0000)]
Implement "info chardev" command. (Gerd Hoffmann)
This patch makes qemu keep track of the character devices in use and
implements a "info chardev" monitor command to print a list.
qemu_chr_open() sticks the devices into a linked list now. It got a new
argument (label), so there is a name for each device. It also assigns a
filename to each character device. By default it just copyes the
filename passed in. Individual drivers can fill in something else
though. qemu_chr_open_pty() sets the filename to name of the pseudo tty
allocated.
aliguori [Wed, 4 Mar 2009 19:25:22 +0000 (19:25 +0000)]
Update cocoa.m to match new DisplayState code (Samuel Benson)
Version 2 does as follows:
[1]: Corrects endianness on issues by using native BGR to RGB conversion
[2]: Uses DisplayState accessors for obtaining graphics context information,
which
[3]: Removes now unused variables, and
[4]: Allows reading of varying color modes (32bit/24/16), and converting to
native colorspace
[5]: Attempts to keep itself centered on screen (as opposed to bottom right,
which immediately goes off screen after bios load) on context changes
(window resizes)
Testing working on i386 (gentoo, Windows 2000) and PPC (debian) guests on PPC
and x86 Macs.
In regards to [4], Windows 2000 displays fine on quick tests, but on the lowest
setting I could test, 16bit color depth at 4bpp, colors are slightly off. I
used gentoo install-x86-minimal-2008.0 in framebuffer mode to test above
setting; the usual grey text is now blue, and Tux appears to be BGR shifted. I
do not know if previous code worked at such a low color setting.
Signed-off-by: Samuel Benson <qemu_ml@digitalescape.info>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6683 c046a42c-6fe2-441c-8c8c-71466251a162
pbrook [Wed, 4 Mar 2009 12:18:15 +0000 (12:18 +0000)]
The different VFP variants will never occur at the same time, and giving them
different names confuses GDB, so use org.gnu.gdb.arm.vfp for all of them.
Signed-off-by: Paul Brook <paul@codesourcery.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6682 c046a42c-6fe2-441c-8c8c-71466251a162
edgar_igl [Tue, 3 Mar 2009 18:07:11 +0000 (18:07 +0000)]
CRIS: Avoid endless loops for unstested CRIS cpu-state load/save.
Fix several endless loops.
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6679 c046a42c-6fe2-441c-8c8c-71466251a162
aliguori [Tue, 3 Mar 2009 17:37:21 +0000 (17:37 +0000)]
Fix SDL on evdev hosts (Anthony Liguori)
This patch corrects SDL support on X11 hosts using evdev. It's losely based
on the previous patch by Dustin Kirkland and the evdev support code in gtk-vnc
written by Daniel Berrange.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6678 c046a42c-6fe2-441c-8c8c-71466251a162
Introduce a growable flag that's set by bdrv_file_open(). Block devices should
never be growable, only files that are being used by block devices.
I went through Fabrice's early comments about the patch that was first applied.
While I disagree with that patch, I also disagree with Fabrice's suggestion.
There's no good reason to do the checks in the block drivers themselves. It
just increases the possibility that this bug could show up again. Since we're
calling bdrv_getlength() to determine the length, we're giving the block drivers
a chance to chime in and let us know what range is valid.
Basically, this patch makes the BlockDriver API guarantee that all requests are
within 0..bdrv_getlength() which to me seems like a Good Thing.
What do others think?
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6677 c046a42c-6fe2-441c-8c8c-71466251a162
aurel32 [Mon, 2 Mar 2009 17:13:21 +0000 (17:13 +0000)]
SH: Implement MOVCO.L and MOVLI.L
* target-sh4/cpu.h (struct CPUSH4State): New field ldst.
* target-sh4/translate.c (cpu_ldst): New.
(sh4_translate_init): Initialize cpu_ldst.
(_decode_opc): Support MOVCO.L and MOVLI.L.