qemu.git
10 years agopSeries: Clean up write-only variables
David Gibson [Tue, 17 May 2011 06:47:04 +0000 (16:47 +1000)] 
pSeries: Clean up write-only variables

A few pieces of the pSeries emulation code have variables which are set
but never used, which causes warnings on gcc 4.6.  This patch removes
these instances.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agow32: Fix compilation and replace non-portable usage of ulong
Stefan Weil [Sat, 14 May 2011 23:38:04 +0000 (23:38 +0000)] 
w32: Fix compilation and replace non-portable usage of ulong

ulong is undefined for w32 (and maybe other) compilations.
Replace it by uintptr_t (which also fixes compilation for w64
and is a better choice for pointer to integer conversions).

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoahci: Fix non-NCQ accesses for LBA > 16bits
Alexander Graf [Thu, 19 May 2011 09:57:09 +0000 (11:57 +0200)] 
ahci: Fix non-NCQ accesses for LBA > 16bits

AHCI provides two ways of reading/writing data:

 1) NCQ
 2) ATA commands with the LBA in the command FIS

In the second code path, we didn't handle any LBAs that were bigger than
16 bits, so whenever a guest that used high LBA numbers wanted to access
data, the LBA got truncated down to 16 bits, giving the guest garbage.

This patch adds support for LBAs higher than 16 bits. I've tested that it
works just fine with SeaBIOS and Linux guests. This patch also unbreaks
the often reported grub errors people have seen with AHCI.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock: Remove type hint, it's guest matter, doesn't belong here
Markus Armbruster [Mon, 16 May 2011 13:04:57 +0000 (15:04 +0200)] 
block: Remove type hint, it's guest matter, doesn't belong here

No users of bdrv_get_type_hint() left.  bdrv_set_type_hint() can make
the media removable by side effect.  Make that explicit.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblockdev: Store -drive option media in DriveInfo
Markus Armbruster [Mon, 16 May 2011 13:04:56 +0000 (15:04 +0200)] 
blockdev: Store -drive option media in DriveInfo

DriveInfo is closely tied to -drive, and like -drive, it mixes
information about host and guest part of the block device.  Unlike
DriveInfo, BlockDriverState should be about the host part only.

One of the remaining guest bits there is the "type hint".  -drive
option media sets it, and qdevs "ide-drive", "scsi-disk" and non-qdev
IF_XEN devices check it to pick HD vs. CD.

Communicate -drive option media via new DriveInfo member media_cd
instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock QMP: Deprecate query-block's "type", drop info block's "type="
Markus Armbruster [Mon, 16 May 2011 13:04:55 +0000 (15:04 +0200)] 
block QMP: Deprecate query-block's "type", drop info block's "type="

query-block's specification documents response member "type" with
values "hd", "cdrom", "floppy", "unknown".

Its value is unreliable: a block device used as floppy has type
"floppy" if created with if=floppy, but type "hd" if created with
if=none.

That's because with if=none, the type is at best a declaration of
intent: the drive can be connected to any guest device.  Its type is
really the guest device's business.  Reporting it here is wrong.

No known user of QMP uses "type".  It's unlikely that any unknown
users exist, because its value is useless unless you know how the
block device was created.  But then you also know the true value.

Fixing the broken value risks breaking (hypothetical!) clients that
somehow rely on the current behavior.  Not fixing the value risks
breaking (hypothetical!) clients that rely on the value to be
accurate.  Can't entirely avoid hypothetical lossage.  Change the
value to be always "unknown".

This makes "info block" always report "type=unknown".  Pointless.
Change it to not report the type.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agodefaults: ide-cd, ide-hd and scsi-cd devices suppress default CD-ROM
Markus Armbruster [Wed, 18 May 2011 16:31:02 +0000 (18:31 +0200)] 
defaults: ide-cd, ide-hd and scsi-cd devices suppress default CD-ROM

ide-hd has to suppress the default CD-ROM, or else you can't put one
on secondary master without -nodefaults.

Unlike legacy scsi-disk, scsi-cd suppresses default CD-ROM.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoscsi: Split qdev "scsi-disk" into "scsi-hd" and "scsi-cd"
Markus Armbruster [Mon, 16 May 2011 13:04:53 +0000 (15:04 +0200)] 
scsi: Split qdev "scsi-disk" into "scsi-hd" and "scsi-cd"

A "scsi-disk" is either a hard disk or a CD-ROM, depending on the
associated BlockDriverState's type hint.  Unclean; disk vs. CD belongs
to the guest part, not the host part.

Have separate qdevs "scsi-hd" and "scsi-cd" to model disk vs. CD in
the guest part.

Keep scsi-disk for backward compatibility.

Don't copy scsi-disk property removable to scsi-cd.  It's not used and
always zero(!) there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoide: Split qdev "ide-drive" into "ide-hd" and "ide-cd"
Markus Armbruster [Mon, 16 May 2011 13:04:52 +0000 (15:04 +0200)] 
ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd"

An "ide-drive" is either a hard disk or a CD-ROM, depending on the
associated BlockDriverState's type hint.  Unclean; disk vs. CD belongs
to the guest part, not the host part.

Have separate qdevs "ide-hd" and "ide-cd" to model disk vs. CD in
the guest part.

Keep ide-drive for backward compatibility.

"ide-disk" would perhaps be a nicer name than "ide-hd", but there's
already "scsi-disk", which is like "ide-drive", and will be likewise
split in the next commit.  {ide,scsi}-{hd,cd} is the best consistent
set of names I could find within the backward compatibility
straightjacket.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqed: support for growing images
Stefan Hajnoczi [Mon, 16 May 2011 12:56:53 +0000 (13:56 +0100)] 
qed: support for growing images

The .bdrv_truncate() operation resizes images and growing is easy to
implement in QED.  Simply check that the new size is valid and then
update the image_size header field to reflect the new size.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu_img: is_not_zero() optimization
Dmitry Konishchev [Wed, 18 May 2011 11:03:59 +0000 (15:03 +0400)] 
qemu_img: is_not_zero() optimization

I run qemu-img under profiler and realized, that most of CPU time is
consumed by is_not_zero() function. I had made a couple of optimizations
on it and got the following output for `time qemu-img convert -O qcow2
volume.qcow2 snapshot.qcow2`:

Original qemu-img:
real 0m56.159s
user 0m34.670s
sys  0m12.079s

Patched qemu-img:
real 0m34.805s
user 0m18.445s
sys  0m12.552s

Signed-off-by: Dmitry Konishchev <konishchev@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqed: Periodically flush and clear need check bit
Stefan Hajnoczi [Mon, 9 May 2011 15:45:40 +0000 (16:45 +0100)] 
qed: Periodically flush and clear need check bit

One strategy to limit the startup delay of consistency check when
opening image files is to ensure that the file is marked dirty for as
little time as possible.

QED currently marks the image dirty when the first allocating write
request is issued and clears the dirty bit again when the image is
cleanly closed.  In practice that means the image is marked dirty for
most of a guest's lifetime and prone to being in a dirty state upon
crash or power failure.

It is safe to clear the dirty bit after all allocating write requests
have completed and a flush has been performed.  This patch adds a timer
after the last allocating write request completes.  When the timer fires
it will flush and then clear the dirty bit.  The timer is set to 5
seconds and is cancelled upon arrival of a new allocating write request.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-tool: Stub out qemu-timer functions
Stefan Hajnoczi [Mon, 9 May 2011 15:45:39 +0000 (16:45 +0100)] 
qemu-tool: Stub out qemu-timer functions

Block drivers may use timers for flushing metadata to disk or
reconnecting to a network drive.  Stub out the following functions in
qemu-tool.c:

QEMUTimer *qemu_new_timer_ns(QEMUClock *clock, int scale,
                             QEMUTimerCB *cb, void *opaque)
void qemu_free_timer(QEMUTimer *ts)
void qemu_del_timer(QEMUTimer *ts)
void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time)
int64_t qemu_get_clock_ns(QEMUClock *clock)

They will result in timers never firing when linked against qemu-tool.o.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoahci: Fix crashes on duplicate BH registration
Jan Kiszka [Mon, 9 May 2011 15:48:19 +0000 (17:48 +0200)] 
ahci: Fix crashes on duplicate BH registration

If ahci_dma_set_inactive is called a while there is still a pending BH
from a previous run, we will crash on the second run of
ahci_check_cmd_bh as it overwrites AHCIDevice::check_bh. Avoid this
broken and redundant duplicate registration.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoAdd documentation for qemu_progress_{init,print}()
Jes Sorensen [Mon, 9 May 2011 15:32:20 +0000 (17:32 +0200)] 
Add documentation for qemu_progress_{init,print}()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoide: Turn debug messages into assertions
Kevin Wolf [Mon, 9 May 2011 09:42:03 +0000 (11:42 +0200)] 
ide: Turn debug messages into assertions

These printfs aren't really debug messages, but clearly indicate a bug if they
ever become effective. Noone uses DEBUG_IDE, let's re-enable the check
unconditionally and make it an assertion instead of printfs in the device
emulation.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agohw/xen_disk: Remove unused local variable
Stefan Weil [Sun, 8 May 2011 07:01:52 +0000 (09:01 +0200)] 
hw/xen_disk: Remove unused local variable

cppcheck report:
hw/xen_disk.c:309: style:
 Variable 'len' is assigned a value that is never used

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-img.c: Remove superfluous parenthesis
Jes Sorensen [Fri, 6 May 2011 09:39:11 +0000 (11:39 +0200)] 
qemu-img.c: Remove superfluous parenthesis

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoposix-aio-compat: Fix idle_threads counter
Kevin Wolf [Mon, 2 May 2011 15:32:54 +0000 (17:32 +0200)] 
posix-aio-compat: Fix idle_threads counter

A thread should only be counted as idle when it really is waiting for new
requests. Without this patch, sometimes too few threads are started as busy
threads are counted as idle.

Not sure if it makes a difference in practice outside some artificial
qemu-io/qemu-img tests, but I think the change makes sense in any case.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoide: cleanup warnings
Andrea Arcangeli [Tue, 3 May 2011 20:03:39 +0000 (22:03 +0200)] 
ide: cleanup warnings

Add \n.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoahci: Unbreak bar registration
Jan Kiszka [Sun, 8 May 2011 17:54:52 +0000 (19:54 +0200)] 
ahci: Unbreak bar registration

Fix regression of 667bb59: ahci_init initializes ahci.mem, so we have to
move bar registration after it.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agow32: Fix missing declaration of ffs()
Stefan Weil [Sun, 15 May 2011 07:51:59 +0000 (09:51 +0200)] 
w32: Fix missing declaration of ffs()

target-ppc/cpu.h now needs ffs(), too, so ffs() must be declared
before this file is included.

Moving the declaration from qemu-common.h to qemu-os-win32.h
(which is included in qemu-common.h early) fixes the compiler
warning for w32.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agoset $SDL_VIDEODRIVER=x11 on Linux to prevent sudo kvm from fighting for video card
Michael Tokarev [Sat, 7 May 2011 21:18:30 +0000 (01:18 +0400)] 
set $SDL_VIDEODRIVER=x11 on Linux to prevent sudo kvm from fighting for video card

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agoconfigure: List available targets in --help output
Peter Maydell [Tue, 3 May 2011 13:50:13 +0000 (14:50 +0100)] 
configure: List available targets in --help output

Include the list of available targets in the --help output
for the --target-list= option.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agotarget-mips: Fix warning caused by unused local variable
Aurelien Jarno [Sat, 14 May 2011 23:00:20 +0000 (01:00 +0200)] 
target-mips: Fix warning caused by unused local variable

Fix compilation with gcc-4.6, based on a patch from Stefan
Weil <weil@mail.berlios.de>.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agoconfigure: quote kvm_ppc_pvr
Aurelien Jarno [Sat, 14 May 2011 22:35:13 +0000 (00:35 +0200)] 
configure: quote kvm_ppc_pvr

10 years agotarget-lm32: Remove unused local variables
Stefan Weil [Sat, 7 May 2011 20:49:33 +0000 (22:49 +0200)] 
target-lm32: Remove unused local variables

cppcheck report:
target-lm32/translate.c:587: style:
    Variable 't0' is assigned a value that is never used
target-lm32/translate.c:588: style:
    Variable 'l1' is assigned a value that is never used

Remove both variables. Please check whether that is the correct solution.

Cc: Michael Walle <michael@walle.cc>
Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Michael Walle <michael@walle.cc>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agotarget-arm: Fix VMLA, VMLS, VNMLS, VNMLA handling of NaNs
Peter Maydell [Thu, 5 May 2011 18:35:35 +0000 (19:35 +0100)] 
target-arm: Fix VMLA, VMLS, VNMLS, VNMLA handling of NaNs

Correct handling of NaNs for VFP VMLA, VMLS, VNMLS and VNMLA requires that
we implement the set of negations and additions specified by the ARM ARM;
plausible looking simplifications like turning (-A + B) into (B - A) or
computing (A + B) rather than (B + A) result in selecting the wrong NaN or
returning a NaN with the wrong sign bit.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agodoc: Add explanation that -alt-grab and -ctrl-grab affect special keys
Brad Hards [Fri, 29 Apr 2011 11:46:12 +0000 (21:46 +1000)] 
doc: Add explanation that -alt-grab and -ctrl-grab affect special keys

Phillip Merensky reported that the special keys (e.g. Ctrl-Alt-f for full
screen) did not work correctly if -alt-grab is used.

BUG: 696530

Review of ui/sdl.c:sdl_refresh indicates that this is the intended behaviour,
so we should update the documentation to match the actual behaviour, as
suggested by Phillip in the bug report.

Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agoMerge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
Aurelien Jarno [Sat, 14 May 2011 14:54:59 +0000 (16:54 +0200)] 
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf

* 'ppc-next' of git://repo.or.cz/qemu/agraf:
  PPC: Qdev'ify e500 pci
  PPC MPC7544DS: Use new TLB helper function
  PPC: Implement e500 (FSL) MMU
  PPC: Add another 64 bits to instruction feature mask
  PPC: Add GS MSR definition
  PPC: Make MPC8544DS emulation work w/o KVM
  PPC: Make MPC8544DS obey -cpu switch
  Fix off-by-one error in sizing pSeries hcall table
  ppc64: Fix out-of-tree builds
  kvm: ppc: warn user on PAGE_SIZE mismatch
  kvm: ppc: detect old headers
  monitor: add PPC BookE SPRs
  kvm: ppc: fixes for KVM_SET_SREGS on init
  ppc64: Don't try to build sPAPR RTAS on Darwin
  Place pseries vty devices at addresses more similar to existing machines
  Make pSeries 'model' property more closely resemble real hardware
  pseries: Increase maximum CPUs to 256

10 years agosparc64: fix incorrect BPcc target sign extension
Blue Swirl [Sat, 14 May 2011 07:14:57 +0000 (07:14 +0000)] 
sparc64: fix incorrect BPcc target sign extension

Fix wrong number of bits used when sign extending the branch offset of BPcc
instructions.

Reported-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agosparc64: fix wrpstate and wrtl on delay slot
Blue Swirl [Tue, 26 Apr 2011 18:44:20 +0000 (18:44 +0000)] 
sparc64: fix wrpstate and wrtl on delay slot

Use TCG local to work around TCG register flush due to a branch.

Thanks to Artyom Tarasenko, Igor Kovalenko and Aurelien Jarno.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Thu, 12 May 2011 13:08:12 +0000 (08:08 -0500)] 
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

Conflicts:
cpu-all.h

10 years agoMerge remote-tracking branch 'agraf/xen-next' into staging
Anthony Liguori [Thu, 12 May 2011 13:06:06 +0000 (08:06 -0500)] 
Merge remote-tracking branch 'agraf/xen-next' into staging

10 years agoPPC: Qdev'ify e500 pci
Alexander Graf [Mon, 30 Aug 2010 22:22:28 +0000 (00:22 +0200)] 
PPC: Qdev'ify e500 pci

The e500 PCI controller isn't qdev'ified yet. This leads to severe issues
when running with -drive.

To be able to use a virtio disk with an e500 VM, let's convert the PCI
controller over to qdev.

Reviewed-by: Paul Brook <paul@codesourcery.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC MPC7544DS: Use new TLB helper function
Alexander Graf [Fri, 6 May 2011 08:37:56 +0000 (10:37 +0200)] 
PPC MPC7544DS: Use new TLB helper function

Now that we have some nice helpers that can find us a TLB entry, let's
use that on the machine initialization code, so we don't need to know
about the internals of the TLB array.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Implement e500 (FSL) MMU
Alexander Graf [Sat, 30 Apr 2011 21:34:58 +0000 (23:34 +0200)] 
PPC: Implement e500 (FSL) MMU

Most of the code to support e500 style MMUs is already in place, but
we're missing on some of the special TLB0-TLB1 handling code and slightly
different TLB modification.

This patch adds support for the FSL style MMU.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Add another 64 bits to instruction feature mask
Alexander Graf [Sat, 30 Apr 2011 22:00:58 +0000 (00:00 +0200)] 
PPC: Add another 64 bits to instruction feature mask

To enable quick runtime detection of instruction groups to the currently
selected CPU emulation, we have a feature mask of what exactly the respective
instruction supports.

This feature mask is 64 bits long and we just successfully exceeded those 64
bits. To add more features, we need to think of something.

The easiest solution that came to my mind was to simply add another 64 bits
that we can also match on. Since the comparison is only done on start of the
qemu process to generate an internal opcode calling table, we should be fine
on any performance penalties here.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Add GS MSR definition
Alexander Graf [Sat, 30 Apr 2011 21:34:56 +0000 (23:34 +0200)] 
PPC: Add GS MSR definition

The BookE specification defines MSR bit 28 as Guest State. Add it
to the list of MSR macros.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Make MPC8544DS emulation work w/o KVM
Alexander Graf [Sat, 30 Apr 2011 21:34:53 +0000 (23:34 +0200)] 
PPC: Make MPC8544DS emulation work w/o KVM

The MPC8544DS board emulation was only used with KVM so far, so some
parts of the code didn't provide proper values for non-KVM execution.

This patch makes the machine work without KVM enabled. To actually use
this, you also need proper e500v2 MMU emulation.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Make MPC8544DS obey -cpu switch
Alexander Graf [Sat, 30 Apr 2011 21:05:03 +0000 (23:05 +0200)] 
PPC: Make MPC8544DS obey -cpu switch

The MPC8544DS board emulation code ignored the user defined -cpu switch.
This patch enables it to only provide a sane default, not force an e500v2
CPU inside.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoFix off-by-one error in sizing pSeries hcall table
David Gibson [Tue, 10 May 2011 06:06:21 +0000 (16:06 +1000)] 
Fix off-by-one error in sizing pSeries hcall table

The pSeries machine uses two tables to look up guest hcalls for emulation.
One of these is exactly one entry too small to hold all the hcalls it needs
to, leading to memory corruption.

This patch fixes the bug, and while we're at it, make both tables 'static'
since they're never used from other modules.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoppc64: Fix out-of-tree builds
Andreas Färber [Sun, 8 May 2011 11:25:56 +0000 (13:25 +0200)] 
ppc64: Fix out-of-tree builds

On ppc64 host, recursion into pc-bios/spapr-rtas/ fails for
out-of-tree builds. Add missing dir and symlink.

Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agokvm: ppc: warn user on PAGE_SIZE mismatch
Alexander Graf [Sat, 16 Apr 2011 08:15:11 +0000 (10:15 +0200)] 
kvm: ppc: warn user on PAGE_SIZE mismatch

On PPC, the default PAGE_SIZE is 64kb. Unfortunately, the hardware
alignments don't match here: There are RAM and MMIO regions within
a single page when it's 64kb in size.

So the only way out for now is to tell the user that he should use 4k
PAGE_SIZE.

This patch gives the user a hint on that, telling him that failing to
register a prefix slot is most likely to be caused by mismatching PAGE_SIZE.

This way it's also more future-proof, as bigger PAGE_SIZE can easily be
supported by other machines then, as long as they stick to 64kb granularities.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agokvm: ppc: detect old headers
Alexander Graf [Sat, 16 Apr 2011 00:00:36 +0000 (02:00 +0200)] 
kvm: ppc: detect old headers

When compiling Qemu with older kernel headers, the PVR setting
mechanism isn't available yet. Unfortunately, back then I didn't add
a capability we could check against, so all we can do is add a configure
test to see if we support PVR setting. For BookE, we don't care yet.

This fixes compilation errors with KVM enabled on older kernel headers
(like 2.6.32).

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agomonitor: add PPC BookE SPRs
Scott Wood [Fri, 29 Apr 2011 22:10:23 +0000 (17:10 -0500)] 
monitor: add PPC BookE SPRs

Read them via KVM_GET_SREGS in kvm_arch_get_registers(),
and display them in "info registers".

Also get CR and PID from the existing KVM_GET_REGS.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agokvm: ppc: fixes for KVM_SET_SREGS on init
Scott Wood [Mon, 11 Apr 2011 23:34:34 +0000 (18:34 -0500)] 
kvm: ppc: fixes for KVM_SET_SREGS on init

Classic/server ppc has had SREGS for a while now (though I think not
always?), but it's still missing for booke.  Check the capability before
calling KVM_SET_SREGS.

Without this, booke kvm fails to boot as of commit
84b4915dd2c0eaa86c970ffc42a68ea8ba9e48b5 (kvm: Handle kvm_init_vcpu
errors).

Also, don't write random stack state into the non-PVR sregs fields --
have kvm fill it in first.

Eventually booke will have sregs and it will have its own capability to
be tested here.  However, we will want a way for platform code to request
to look like the actual CPU we're running on, especially if SoC devices
are being directly assigned.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoppc64: Don't try to build sPAPR RTAS on Darwin
Andreas Färber [Sun, 1 May 2011 16:23:56 +0000 (18:23 +0200)] 
ppc64: Don't try to build sPAPR RTAS on Darwin

The Darwin assembler fails to build it.

Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPlace pseries vty devices at addresses more similar to existing machines
David Gibson [Tue, 19 Apr 2011 01:54:52 +0000 (11:54 +1000)] 
Place pseries vty devices at addresses more similar to existing machines

Currently the qemu pseries machine numbers its virtual serial devices
from 0.  However, existing pSeries machines running pHyp number them from
0x30000000.

In theory these indices are arbitrary, since everything necessary for the
kernel to find them is advertised in the device tree.  However the debian
installer, at least, incorrectly looks for a device named vty@30... to
determine whether to use the hypervisor console.

Therefore this patch moves the numbers we use to match the existing pHyp
practice, in order to workaround broken userspace apps of this type.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoMake pSeries 'model' property more closely resemble real hardware
David Gibson [Tue, 19 Apr 2011 01:54:51 +0000 (11:54 +1000)] 
Make pSeries 'model' property more closely resemble real hardware

Currently, the qemu emulated pseries machine puts
"qemu,emulated-pSeries-LPAR" in the device tree's root level 'model'
property.  Unfortunately this confuses some installers and ybin, which
expect this to start with "IBM" on pSeries machines.  This patch addresses
this problem, making the property more closely resemble the pattern of
existing real hardware.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopseries: Increase maximum CPUs to 256
Anton Blanchard [Tue, 19 Apr 2011 01:54:50 +0000 (11:54 +1000)] 
pseries: Increase maximum CPUs to 256

The original pSeries machine was limited to 32 CPUs, more or less
arbitrarily.  Particularly when we get SMT KVM guests it will be
pretty easy to exceed this.  Therefore, raise the max number of CPUs
in a pseries machine guest to 256.

Signed-off-by: Anton Blanchard <anton@au1.ibm.com>
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agousb-linux: Add missing break statement
Stefan Weil [Sat, 7 May 2011 20:10:53 +0000 (22:10 +0200)] 
usb-linux: Add missing break statement

cppcheck report:
usb-linux.c:661: warning: Redundant assignment of "len" in switch

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb-musb: uninline functions
Gerd Hoffmann [Mon, 9 May 2011 07:44:03 +0000 (09:44 +0200)] 
usb-musb: uninline functions

Prototype without "inline" keyword breaks the build with some gcc
versions.  Noticed by Alexander Graf.

Fix this by removing the inline keywork everywhere.  Some functions
can't be inlined anyway as the are referenced using function pointers.
Beside that gcc does a pretty good job on auto-inlining these days.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoirq: Privatize CPU_INTERRUPT_NMI.
Richard Henderson [Wed, 4 May 2011 20:34:31 +0000 (13:34 -0700)] 
irq: Privatize CPU_INTERRUPT_NMI.

This interrupt name is used by i386, CRIS, and MicroBlaze.
Copy the name into each target.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agotarget-i386: Privatize some i386-specific interrupt names.
Richard Henderson [Wed, 4 May 2011 20:34:30 +0000 (13:34 -0700)] 
target-i386: Privatize some i386-specific interrupt names.

SMI, VIRQ, INIT, SIPI, and MCE are all only used by the i386 port.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agotarget-arm: Privatize CPU_INTERRUPT_FIQ.
Richard Henderson [Wed, 4 May 2011 20:34:29 +0000 (13:34 -0700)] 
target-arm: Privatize CPU_INTERRUPT_FIQ.

This interrupt name was only used by the ARM port.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agoirq: Remove CPU_INTERRUPT_TIMER.
Richard Henderson [Wed, 4 May 2011 20:34:28 +0000 (13:34 -0700)] 
irq: Remove CPU_INTERRUPT_TIMER.

It is no longer used anywhere.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agotarget-sparc: Do not check CPU_INTERRUPT_TIMER.
Richard Henderson [Wed, 4 May 2011 20:34:27 +0000 (13:34 -0700)] 
target-sparc: Do not check CPU_INTERRUPT_TIMER.

This bit is never set, therefore we should not read it either.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agotarget-mips: Do not check CPU_INTERRUPT_TIMER.
Richard Henderson [Wed, 4 May 2011 20:34:26 +0000 (13:34 -0700)] 
target-mips: Do not check CPU_INTERRUPT_TIMER.

This bit is never set, therefore we should not read it either.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agoirq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.
Richard Henderson [Wed, 4 May 2011 20:34:25 +0000 (13:34 -0700)] 
irq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.

This mask contains all of the bits that should be ignored while single
stepping in the debugger.  The mask contains 2 bits that are not currently
cleared, but are also never set.  The bits are included in the mask for
consistency in handling of the CPU_INTERRUPT_TGT_EXT_N bits.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agoirq: Introduce CPU_INTERRUPT_TGT_* defines.
Richard Henderson [Wed, 4 May 2011 20:34:24 +0000 (13:34 -0700)] 
irq: Introduce CPU_INTERRUPT_TGT_* defines.

These defines will be place-holders for cpu-specific functionality.
Generic code will, at the end of the patch series, no longer have to
concern itself about how SMI, NMI, etc should be handled.  Instead,
generic code will know only that the interrupt is internal or external.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agolsi53c895a: Rename 'sense' to 'status'
Hannes Reinecke [Mon, 2 May 2011 07:54:05 +0000 (09:54 +0200)] 
lsi53c895a: Rename 'sense' to 'status'

The 'sense' field in the HBA status structure is misnamed, as it
actually carries the SCSI status. Rename it.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-trivial@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agolibcacard: add correct subdirectory dependencies
Paolo Bonzini [Mon, 2 May 2011 07:54:03 +0000 (09:54 +0200)] 
libcacard: add correct subdirectory dependencies

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-trivial@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agolinux-user: Replace deprecated function
Stefan Weil [Sat, 7 May 2011 20:32:25 +0000 (22:32 +0200)] 
linux-user: Replace deprecated function

Function bzero is deprecated, so replace it by function memset.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix spelling in comments (intruction -> instruction)
Stefan Weil [Sat, 7 May 2011 20:20:03 +0000 (22:20 +0200)] 
Fix spelling in comments (intruction -> instruction)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoac97: Remove unused local variables
Stefan Weil [Sun, 8 May 2011 06:58:11 +0000 (08:58 +0200)] 
ac97: Remove unused local variables

cppcheck report:
hw/ac97.c:1004: style:
 Variable 'written' is assigned a value that is never used
hw/ac97.c:1072: style:
 Variable 'written' is assigned a value that is never used

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comment (threshhold -> threshold, mapp -> map)
Stefan Weil [Thu, 28 Apr 2011 15:20:42 +0000 (17:20 +0200)] 
Fix typos in comment (threshhold -> threshold, mapp -> map)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (truely -> truly)
Stefan Weil [Thu, 28 Apr 2011 15:20:41 +0000 (17:20 +0200)] 
Fix typo in comment (truely -> truly)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (responsiblity -> responsibility)
Stefan Weil [Thu, 28 Apr 2011 15:20:40 +0000 (17:20 +0200)] 
Fix typo in comment (responsiblity -> responsibility)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (relevent -> relevant)
Stefan Weil [Thu, 28 Apr 2011 15:20:39 +0000 (17:20 +0200)] 
Fix typo in comment (relevent -> relevant)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments and code (occured -> occurred and related)
Stefan Weil [Thu, 28 Apr 2011 15:20:38 +0000 (17:20 +0200)] 
Fix typos in comments and code (occured -> occurred and related)

The code changed here is an unused data type name (evt_flush_occurred).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (neccessary -> necessary)
Stefan Weil [Thu, 28 Apr 2011 15:20:37 +0000 (17:20 +0200)] 
Fix typos in comments (neccessary -> necessary)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (instanciation -> instantiation)
Stefan Weil [Thu, 28 Apr 2011 15:20:36 +0000 (17:20 +0200)] 
Fix typos in comments (instanciation -> instantiation)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (interupt -> interrupt)
Stefan Weil [Thu, 28 Apr 2011 15:20:35 +0000 (17:20 +0200)] 
Fix typos in comments (interupt -> interrupt)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (existance -> existence)
Stefan Weil [Thu, 28 Apr 2011 15:20:34 +0000 (17:20 +0200)] 
Fix typos in comments (existance -> existence)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (imediately -> immediately)
Stefan Weil [Thu, 28 Apr 2011 15:20:33 +0000 (17:20 +0200)] 
Fix typos in comments (imediately -> immediately)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (dieing -> dying)
Stefan Weil [Thu, 28 Apr 2011 15:20:32 +0000 (17:20 +0200)] 
Fix typo in comment (dieing -> dying)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (consistant -> consistent)
Stefan Weil [Thu, 28 Apr 2011 15:20:31 +0000 (17:20 +0200)] 
Fix typo in comment (consistant -> consistent)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (embeded -> embedded)
Stefan Weil [Thu, 28 Apr 2011 15:20:30 +0000 (17:20 +0200)] 
Fix typo in comment (embeded -> embedded)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (auxilliary -> auxiliary)
Stefan Weil [Thu, 28 Apr 2011 15:20:29 +0000 (17:20 +0200)] 
Fix typo in comment (auxilliary -> auxiliary)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (colum -> column)
Stefan Weil [Thu, 28 Apr 2011 15:20:28 +0000 (17:20 +0200)] 
Fix typo in comment (colum -> column)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (accessable -> accessible, priveleged -> privileged)
Stefan Weil [Thu, 28 Apr 2011 15:20:27 +0000 (17:20 +0200)] 
Fix typos in comments (accessable -> accessible, priveleged -> privileged)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (accross -> across)
Stefan Weil [Thu, 28 Apr 2011 15:20:26 +0000 (17:20 +0200)] 
Fix typos in comments (accross -> across)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (dependancy -> dependency)
Stefan Weil [Thu, 28 Apr 2011 15:20:25 +0000 (17:20 +0200)] 
Fix typos in comments (dependancy -> dependency)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoxen: Add Xen hypercall for sleep state in the cmos_s3 callback.
Anthony PERARD [Tue, 5 Oct 2010 15:40:22 +0000 (16:40 +0100)] 
xen: Add Xen hypercall for sleep state in the cmos_s3 callback.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Set running state in xenstore.
Anthony PERARD [Mon, 6 Sep 2010 19:07:33 +0000 (20:07 +0100)] 
xen: Set running state in xenstore.

This tells to the xen management tool that the machine can begin run.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Initialize event channels and io rings
Arun Sharma [Mon, 6 Sep 2010 19:07:14 +0000 (20:07 +0100)] 
xen: Initialize event channels and io rings

Open and bind event channels; map ioreq and buffered ioreq rings.

Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agovl.c: Introduce getter for shutdown_requested and reset_requested.
Anthony PERARD [Thu, 22 Jul 2010 14:52:48 +0000 (15:52 +0100)] 
vl.c: Introduce getter for shutdown_requested and reset_requested.

Introduce two functions qemu_shutdown_requested_get and
qemu_reset_requested_get to get the value of shutdown/reset_requested
without reset it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopci: Use of qemu_put_ram_ptr in pci_add_option_rom.
John Baboval [Tue, 22 Mar 2011 14:52:09 +0000 (14:52 +0000)] 
pci: Use of qemu_put_ram_ptr in pci_add_option_rom.

Prevent a deadlock caused by leaving a map cache bucket locked by the
preceding qemu_get_ram_ptr() call.

Signed-off-By: John Baboval <john.baboval@virtualcomputer.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoconfigure: Always use 64bits target physical addresses with xen enabled.
Anthony PERARD [Thu, 21 Oct 2010 11:47:08 +0000 (12:47 +0100)] 
configure: Always use 64bits target physical addresses with xen enabled.

With MapCache, we can handle a 64b target, even with a 32b host/qemu.
So, we need to have target_phys_addr_t to 64bits.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoIntroduce qemu_put_ram_ptr
Anthony PERARD [Thu, 16 Sep 2010 12:57:49 +0000 (13:57 +0100)] 
Introduce qemu_put_ram_ptr

This function allows to unlock a ram_ptr give by qemu_get_ram_ptr. After
a call to qemu_put_ram_ptr, the pointer may be unmap from QEMU when
used with Xen.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Adds a cap to the number of map cache entries.
John Baboval [Tue, 22 Mar 2011 14:50:28 +0000 (14:50 +0000)] 
xen: Adds a cap to the number of map cache entries.

Adds a cap to the number of map cache entries. This prevents the map
cache from overwhelming system memory.

I also removed the bitmap macros and #included bitmap.h instead.

Signed-off-By: John Baboval <john.baboval@virtualcomputer.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Introduce the Xen mapcache
Jun Nakajima [Tue, 31 Aug 2010 15:41:25 +0000 (16:41 +0100)] 
xen: Introduce the Xen mapcache

On IA32 host or IA32 PAE host, at present, generally, we can't create
an HVM guest with more than 2G memory, because generally it's almost
impossible for Qemu to find a large enough and consecutive virtual
address space to map an HVM guest's whole physical address space.
The attached patch fixes this issue using dynamic mapping based on
little blocks of memory.

Each call to qemu_get_ram_ptr makes a call to qemu_map_cache with the
lock option, so mapcache will not unmap these ram_ptr.

Blocks that do not belong to the RAM, but usually to a device ROM or to
a framebuffer, are handled in a separate function. So the whole RAMBlock
can be map.

Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Introduce Xen Interrupt Controller
Anthony PERARD [Wed, 30 Jun 2010 16:50:10 +0000 (17:50 +0100)] 
xen: Introduce Xen Interrupt Controller

Every set_irq call makes a Xen hypercall.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopiix_pci: Introduces Xen specific call for irq.
Anthony PERARD [Fri, 16 Jul 2010 13:55:39 +0000 (14:55 +0100)] 
piix_pci: Introduces Xen specific call for irq.

This patch introduces Xen specific call in piix_pci.

The specific part for Xen is in write_config, set_irq and get_pirq.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopc, Disable vmport initialisation with Xen.
Anthony PERARD [Tue, 3 May 2011 16:06:54 +0000 (17:06 +0100)] 
pc, Disable vmport initialisation with Xen.

This is because there is not synchronisation of the vcpu register
between Xen and QEMU, so vmport can't work properly.

This patch introduces no_vmport parameter to pc_basic_device_init.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Add xenfv machine
Anthony PERARD [Wed, 30 Jun 2010 11:58:34 +0000 (12:58 +0100)] 
xen: Add xenfv machine

Introduce the Xen FV (Fully Virtualized) machine to Qemu, some more Xen
specific call will be added in further patches.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopc_memory_init: Move memory calculation to the caller.
Anthony PERARD [Mon, 11 Apr 2011 18:48:11 +0000 (19:48 +0100)] 
pc_memory_init: Move memory calculation to the caller.

This patch moves above_4g_mem_size and below_4g_mem_size calculation in
the caller of pc_memory_init (pc_init1). And the prototype of
pc_memory_init is changed because there is no need anymore to have
variable pointer and the ram_size parameter.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Add initialisation of Xen
Anthony PERARD [Thu, 19 Aug 2010 11:27:56 +0000 (12:27 +0100)] 
xen: Add initialisation of Xen

The xenpv machine use the common init function.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Support new libxc calls from xen unstable.
Anthony PERARD [Fri, 25 Feb 2011 16:20:34 +0000 (16:20 +0000)] 
xen: Support new libxc calls from xen unstable.

This patch updates the libxenctrl calls in Qemu to use the new interface,
otherwise Qemu wouldn't be able to build against new versions of the
library.

We check libxenctrl version in configure, from Xen 3.3.0 to Xen
unstable.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>