sdk/emulator/qemu.git
14 years agotcg: add div/rem 32-bit helpers
Aurelien Jarno [Tue, 2 Mar 2010 22:16:36 +0000 (23:16 +0100)]
tcg: add div/rem 32-bit helpers

Some targets like ARM would benefit to use 32-bit helpers for
div/rem/divu/remu.

Create a #define for div2 so that targets can select between
div, div2 and helper implementation. Use the helper version if none
of the #define are present.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix pagetable code
Paul Brook [Sun, 14 Mar 2010 14:58:46 +0000 (14:58 +0000)]
Fix pagetable code

The multi-level pagetable code fails to iterate ove all entries because
of the L2_BITS v.s. L2_SIZE thinko.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agospelling typo (compatibilty) in hw/fw_cfg.c
Vagrant Cascadian [Sun, 14 Mar 2010 08:51:53 +0000 (08:51 +0000)]
spelling typo (compatibilty) in hw/fw_cfg.c

here's a trivial patch to fix the spelling of "compatibility":

Signed-off-by: Vagrant Cascadian <vagrant@freegeek.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agox86/cpuid: fix indentation
Aurelien Jarno [Sat, 13 Mar 2010 15:46:33 +0000 (16:46 +0100)]
x86/cpuid: fix indentation

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: Enable all features of real CPU
Aurelien Jarno [Sat, 13 Mar 2010 15:43:15 +0000 (16:43 +0100)]
x86/cpuid: Enable all features of real CPU

Enable all features of real CPU, unsupported features will be
trimmed depending on TCG or KVM capabilities.

Move the list of unsupported TCG features near the TCG capabilities
masks.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: fix CPUID levels
Andre Przywara [Thu, 11 Mar 2010 13:39:06 +0000 (14:39 +0100)]
x86/cpuid: fix CPUID levels

Bump up the xlevel number for qemu32 to allow parsing of the processor
name string for this model.
Similiarly the 486 processor should have at least the feature bit
leaf enabled.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: Always expose 32 and 64-bit CPUs
Andre Przywara [Thu, 11 Mar 2010 13:39:04 +0000 (14:39 +0100)]
x86/cpuid: Always expose 32 and 64-bit CPUs

Since 64-bit capability is just another CPUID bit we now properly
mask, there is no reason anymore to hide the 64-bit capable CPU
models from a 32-bit only QEMU. All 64-bit CPUs can be used
perfectly in 32-bit legacy mode anyway, so these models also make
sense for 32-bit.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: add TCG feature bit trimming
Andre Przywara [Thu, 11 Mar 2010 13:39:03 +0000 (14:39 +0100)]
x86/cpuid: add TCG feature bit trimming

In KVM we trim the user provided CPUID bits to match the host CPU's
one. Introduce a similar feature to QEMU/TCG. Create a mask of TCG's
capabilities and apply it to the user bits.
This allows to let the CPU models reflect their native archetypes.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: remove unnecessary kvm_trim function
Andre Przywara [Thu, 11 Mar 2010 13:39:01 +0000 (14:39 +0100)]
x86/cpuid: remove unnecessary kvm_trim function

Correct me if I am wrong, but kvm_trim looks like a really bloated
implementation of a bitwise AND. So remove this function and replace
it with the real stuff(TM).

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: add "host" to the list of supported CPU models
Andre Przywara [Thu, 11 Mar 2010 13:39:00 +0000 (14:39 +0100)]
x86/cpuid: add "host" to the list of supported CPU models

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: add missing CPUID feature flag names
Andre Przywara [Thu, 11 Mar 2010 13:38:59 +0000 (14:38 +0100)]
x86/cpuid: add missing CPUID feature flag names

Some CPUID feature flags had no string value, so they could not be
switched on or off from the command line.
Add names for the missing ones mentioned in the current public CPUID
specification from both Intel and AMD. Those only mentioned in the
Linux kernel source I put as comments.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: moved host_cpuid function and remove prototype
Andre Przywara [Thu, 11 Mar 2010 13:38:58 +0000 (14:38 +0100)]
x86/cpuid: moved host_cpuid function and remove prototype

the host_cpuid function was located at the end of the file and had
a prototype before it's first use. Move it up and remove the
prototype.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: fix missing feature set bits
Andre Przywara [Thu, 11 Mar 2010 13:38:57 +0000 (14:38 +0100)]
x86/cpuid: fix missing feature set bits

This one was accidently removed with commit
bb0300dc57c10b3721451b0ff566a03f9276cc77

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: replace magic number with named constant
Andre Przywara [Thu, 11 Mar 2010 13:38:56 +0000 (14:38 +0100)]
x86/cpuid: replace magic number with named constant

CPUID leaf Fn8000_0001.EDX contains a copy of many Fn0000_0001.EDX bits.
Define a name for this mask to improve readability and avoid typos.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86/cpuid: move CPUID functions into separate file
Andre Przywara [Thu, 11 Mar 2010 13:38:55 +0000 (14:38 +0100)]
x86/cpuid: move CPUID functions into separate file

about half of target-i386/helper.c consist of CPUID related functions.
Only one of them is a real TCG helper function. So move the whole
CPUID stuff out of this into a separate file to get better
maintainable parts.
This is only code reordering and should not affect QEMU's
functionality.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix build with -DNDEBUG in CFLAGS
Blue Swirl [Sat, 13 Mar 2010 14:18:50 +0000 (14:18 +0000)]
Fix build with -DNDEBUG in CFLAGS

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix a typo in error message
Blue Swirl [Sat, 13 Mar 2010 11:36:09 +0000 (11:36 +0000)]
Fix a typo in error message

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agofdc: fix drive property handling.
Gerd Hoffmann [Wed, 10 Mar 2010 16:30:29 +0000 (17:30 +0100)]
fdc: fix drive property handling.

Fix the floppy controller init wrappers to set the drive properties
only in case the DriveInfo pointers passed in are non NULL.  This allows
to set the properties using -global.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoinstall: honor DESTDIR on sysconfdir population
Andre Przywara [Mon, 8 Mar 2010 14:43:41 +0000 (15:43 +0100)]
install: honor DESTDIR on sysconfdir population

When creating and populating $sysconfdir, we should prepend $DESTDIR
as we do with all other paths.

Reported-by: Frank Arnold <frank.arnold@amd.com>
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoconfigure: fix --sysconfdir specification
Andre Przywara [Mon, 8 Mar 2010 13:09:48 +0000 (14:09 +0100)]
configure: fix --sysconfdir specification

--sysconfdir requires a parameter (the path), this should be reflected
in the case pattern.

Reported-by: Frank Arnold <frank.arnold@amd.com>
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-arm: make RFE usable with any register
Adam Lackorzynski [Tue, 2 Mar 2010 00:17:35 +0000 (01:17 +0100)]
target-arm: make RFE usable with any register

The rfe instruction can be used with any register, not just sp. Adjust the
condition check accordingly.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg/arm: implement andc op
Aurelien Jarno [Tue, 2 Mar 2010 23:13:43 +0000 (00:13 +0100)]
tcg/arm: implement andc op

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: update README with const and pure helpers
Aurelien Jarno [Fri, 5 Mar 2010 21:48:03 +0000 (22:48 +0100)]
tcg: update README with const and pure helpers

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg/arm: correctly save/restore registers in prologue/epilogue
Aurelien Jarno [Fri, 5 Mar 2010 07:35:07 +0000 (08:35 +0100)]
tcg/arm: correctly save/restore registers in prologue/epilogue

Since commit 6113d6d3169393c323ac4c82d756a850145a5e7a QEMU crashes
on ARM hosts. This is not a bug of this commit, but a latent bug
revealed by this commit.

The TCG code is called through a procedure call using the prologue
and epilogue code. This code does not save and restore enough registers.
The "Procedure Call Standard for the ARM Architecture" says:

  A subroutine must preserve the contents of the registers r4-r8, r10,
  r11 and SP (and r9 in PCS variants that designate r9 as v6).

The current code only saves and restores r9 to r11, and misses r4 to
r8. The patch fixes that by saving r4 to r12. Theoretically there is
no need to save and restore r12, but an even number of registers have
to be saved as per EABI.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-i386: fix commit c22549204a6edc431e8e4358e61bd56386ff6957
TeLeMan [Fri, 12 Mar 2010 11:38:06 +0000 (19:38 +0800)]
target-i386: fix commit c22549204a6edc431e8e4358e61bd56386ff6957

The commit c22549204a6edc431e8e4358e61bd56386ff6957 led movntps &
movntdq to be translated incorrectly.

Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: update address space definitions
Aurelien Jarno [Sat, 13 Mar 2010 00:39:17 +0000 (01:39 +0100)]
target-mips: update address space definitions

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix Sparc host build breakage
Blue Swirl [Sat, 13 Mar 2010 09:52:19 +0000 (09:52 +0000)]
Fix Sparc host build breakage

Fix error:
  CC    sparc-bsd-user/op_helper.o
In file included from /src/qemu/tcg/tcg.c:158:
/src/qemu/tcg/sparc/tcg-target.c:728:5: "TARGET_PHYS_ADDR_BITS" is not defined

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix more wrong usermode virtual address types
Blue Swirl [Sat, 13 Mar 2010 09:48:08 +0000 (09:48 +0000)]
Fix more wrong usermode virtual address types

Fixes warning:
  CC    sparc-bsd-user/exec.o
/src/qemu/exec.c: In function `page_check_range':
/src/qemu/exec.c:2375: warning: comparison is always true due to limited range of data type

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix usermode virtual address type
Paul Brook [Fri, 12 Mar 2010 23:23:29 +0000 (23:23 +0000)]
Fix usermode virtual address type

Usermode virtual addresses are abi_ulong, not target_ulong.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoFreeBSD ppc_init_cacheline_sizes(): add missing #includes
Juergen Lock [Fri, 12 Mar 2010 21:50:15 +0000 (22:50 +0100)]
FreeBSD ppc_init_cacheline_sizes(): add missing #includes

This fixes commit e4ee916d3f9a93df06bd498c92767c1558d59a0b.
(The bug was mine actually...)

Submitted by: Andreas Tobler <andreast@fgznet.ch>

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: malc <av1474@comtv.ru>
14 years agotcg/ppc[64]: Only define addend load helpers in softmmu case
malc [Fri, 12 Mar 2010 21:27:46 +0000 (00:27 +0300)]
tcg/ppc[64]: Only define addend load helpers in softmmu case

Signed-off-by: malc <av1474@comtv.ru>
14 years agoRemove userspace target_phys_addr_t
Paul Brook [Mon, 1 Mar 2010 02:27:26 +0000 (02:27 +0000)]
Remove userspace target_phys_addr_t

TARGET_PHYS_ADDR_BITS isn't meaningful for userspace emulation, so don't
define it.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoTarget specific usermode cleanup
Paul Brook [Mon, 1 Mar 2010 04:11:28 +0000 (04:11 +0000)]
Target specific usermode cleanup

Disable various target specific code that is only relevant to system emulation.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoRemove cpu_get_phys_page_debug from userspace emulation
Paul Brook [Mon, 1 Mar 2010 03:46:18 +0000 (03:46 +0000)]
Remove cpu_get_phys_page_debug from userspace emulation

cpu_get_phys_page_debug makes no sense for userspace emulation, so remove it.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoDisable phsyical memory handling in userspace emulation.
Paul Brook [Fri, 12 Mar 2010 16:54:58 +0000 (16:54 +0000)]
Disable phsyical memory handling in userspace emulation.

Code to handle physical memory access is not meaningful in usrmode emulation,
so disable it.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoRemove TLB from userspace
Paul Brook [Fri, 12 Mar 2010 16:54:58 +0000 (16:54 +0000)]
Remove TLB from userspace

Remove TLB from userspace CPU structure.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoAdd tb_page_addr_t
Paul Brook [Fri, 12 Mar 2010 16:54:58 +0000 (16:54 +0000)]
Add tb_page_addr_t

The page tracking code in exec.c is used by both userspace and system
emulation.  Userspace emulation uses it to track virtual pages, and
system emulation to track ram pages.  Introduce a new type to hold this
kind of address.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoFix last page errors in page_check_range and page_set_flags.
Richard Henderson [Wed, 10 Mar 2010 23:57:04 +0000 (15:57 -0800)]
Fix last page errors in page_check_range and page_set_flags.

The addr < end comparison prevents iterating over the last
page in the guest address space; an iteration based on
length avoids this problem.

At the same time, assert that the given address is in the
guest address space.

Signed-off-by: Richard Henderson <rth@twiddle.net>
14 years agoImplement multi-level page tables.
Richard Henderson [Wed, 10 Mar 2010 23:53:37 +0000 (15:53 -0800)]
Implement multi-level page tables.

Define L1_MAP_ADDR_SPACE_BITS to be either the virtual address size
(in user mode) or physical address size (in system mode), and use
that to size l1_map.  This rewrites page_find_alloc, page_flush_tb,
and walk_memory_regions.

Use TARGET_PHYS_ADDR_SPACE_BITS for the physical memory map based
off of l1_phys_map.  This rewrites page_phys_find_alloc and
phys_page_for_each.

Signed-off-by: Richard Henderson <rth@twiddle.net>
14 years agolinux-user: Fix mmap_find_vma returning invalid addresses.
Richard Henderson [Wed, 10 Mar 2010 23:39:07 +0000 (15:39 -0800)]
linux-user: Fix mmap_find_vma returning invalid addresses.

Don't return addresses that aren't properly aligned for the guest,
e.g. when the guest has a larger page size than the host.  Don't
return addresses that are outside the virtual address space for the
target, by paying proper attention to the h2g/g2h macros.

At the same time, place the default mapping base for 64-bit guests
(on 64-bit hosts) outside the low 4G.  Consistently interpret
mmap_next_start in the guest address space.

Signed-off-by: Richard Henderson <rth@twiddle.net>
14 years agolinux-user: Use h2g_valid in qemu_vmalloc.
Richard Henderson [Wed, 10 Mar 2010 22:38:59 +0000 (14:38 -0800)]
linux-user: Use h2g_valid in qemu_vmalloc.

Signed-off-by: Richard Henderson <rth@twiddle.net>
14 years agoUse TARGET_VIRT_ADDR_SPACE_BITS in h2g_valid.
Richard Henderson [Wed, 10 Mar 2010 22:36:58 +0000 (14:36 -0800)]
Use TARGET_VIRT_ADDR_SPACE_BITS in h2g_valid.

Previously, only 32-bit guests had a proper check for the
validity of the virtual address.  Extend that check to 64-bit
guests with a restricted virtual address space.

Signed-off-by: Richard Henderson <rth@twiddle.net>
14 years agoMove TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h.
Richard Henderson [Wed, 10 Mar 2010 22:33:23 +0000 (14:33 -0800)]
Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h.

Removes a set of ifdefs from exec.c.

Introduce TARGET_VIRT_ADDR_SPACE_BITS for all targets other
than Alpha.  This will be used for page_find_alloc, which is
supposed to be using virtual addresses in the first place.

Signed-off-by: Richard Henderson <rth@twiddle.net>
14 years agotarget-ppc: fix evsrwu and evsrws (second try)
Aurelien Jarno [Thu, 11 Mar 2010 20:29:42 +0000 (21:29 +0100)]
target-ppc: fix evsrwu and evsrws (second try)

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-ppc: fix evsrwu and evsrws
Aurelien Jarno [Thu, 11 Mar 2010 20:22:35 +0000 (21:22 +0100)]
target-ppc: fix evsrwu and evsrws

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-ppc: fix evslw instruction
Aurelien Jarno [Thu, 11 Mar 2010 20:14:47 +0000 (21:14 +0100)]
target-ppc: fix evslw instruction

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoaudio: fix comment
malc [Thu, 11 Mar 2010 15:28:38 +0000 (18:28 +0300)]
audio: fix comment

Signed-off-by: malc <av1474@comtv.ru>
14 years agoQMP: Really move the RESET event to qemu_system_reset()
Luiz Capitulino [Wed, 10 Mar 2010 15:06:34 +0000 (09:06 -0600)]
QMP: Really move the RESET event to qemu_system_reset()

Something bad has happened in the merge of commit 0ee44250, as
the log message says it's supposed to be in qemu_system_reset()
but it is do_vm_stop().

Possibly, it was a problem with the conflict resolution with
ea375f9a (which has been merged first).

This commit moves (again) the RESET event into qemu_system_reset().

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agotarget-i386: fix SIB decoding with index = 4
Aurelien Jarno [Sat, 6 Mar 2010 17:02:31 +0000 (18:02 +0100)]
target-i386: fix SIB decoding with index = 4

A SIB byte with an index of 4 means "no scaled index", even if the scale
value is not 0. In 64-bit mode, if REX.X is used, an index of 4 selects
%r12. This is correctly handled by the computation of the index variable,
which includes the index bits, and also the REX.X prefix:

    index = ((code >> 3) & 7) | REX_X(s);

Thanks to Avi Kivity, Jamie Lokier and Malc for the analysis of the
problem and the initial patch.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agodocumentation: qemu_write_full don't work with non-blocking fd's
Juan Quintela [Thu, 4 Mar 2010 09:00:39 +0000 (10:00 +0100)]
documentation: qemu_write_full don't work with non-blocking fd's

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock: print errno on error
Juan Quintela [Thu, 4 Mar 2010 09:00:38 +0000 (10:00 +0100)]
block: print errno on error

Now that we changed all create calls to return errno, just print it.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovmdk: share cleanup code
Juan Quintela [Thu, 4 Mar 2010 09:00:37 +0000 (10:00 +0100)]
vmdk: share cleanup code

cleanup code is identical for error/success cases.  Only difference
are goto labels.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovmdk: fix double free
Juan Quintela [Thu, 4 Mar 2010 09:00:36 +0000 (10:00 +0100)]
vmdk: fix double free

fail_gd error case would also free rgd_buf that was already freed

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovmdk: make vmdk_snapshot_create return -errno
Juan Quintela [Thu, 4 Mar 2010 09:00:35 +0000 (10:00 +0100)]
vmdk: make vmdk_snapshot_create return -errno

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovmdk: return errno instead of -1
Juan Quintela [Thu, 4 Mar 2010 09:00:34 +0000 (10:00 +0100)]
vmdk: return errno instead of -1

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqcow: return errno instead of -1
Juan Quintela [Thu, 4 Mar 2010 09:00:33 +0000 (10:00 +0100)]
qcow: return errno instead of -1

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqcow2: return errno instead of -1
Juan Quintela [Thu, 4 Mar 2010 09:00:32 +0000 (10:00 +0100)]
qcow2: return errno instead of -1

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoslirp: check system() success
Juan Quintela [Thu, 4 Mar 2010 09:00:31 +0000 (10:00 +0100)]
slirp: check system() success

we shouldn't call W*() macros until we check that fork worked.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agocow: return errno instead of -1
Juan Quintela [Thu, 4 Mar 2010 09:00:30 +0000 (10:00 +0100)]
cow: return errno instead of -1

Remove not needed ret = 0 assignment.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqemu-img rebase: Add -f option
Kevin Wolf [Tue, 2 Mar 2010 11:14:31 +0000 (12:14 +0100)]
qemu-img rebase: Add -f option

Allow the user to specify the format of the image to rebase.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoconfigure: Fix code which creates config.mak files
Stefan Weil [Mon, 1 Mar 2010 21:20:29 +0000 (22:20 +0100)]
configure: Fix code which creates config.mak files

These files are created by configure and grow
unnecessarily at each new call of configure:

roms/seabios/config.mak
roms/vgabios/config.mak
libhw32/config.mak
libhw64/config.mak

libhw32/config.mak and libhw64/config.mak set
compiler options, and the wrong old code results
in very long command lines.

The new code always writes a new config.mak
instead of appending to an existing one.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoconfigure: Fix wrong stderr redirection
Stefan Weil [Mon, 1 Mar 2010 21:10:46 +0000 (22:10 +0100)]
configure: Fix wrong stderr redirection

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Introduce WATCHDOG event
Luiz Capitulino [Thu, 25 Feb 2010 15:13:04 +0000 (12:13 -0300)]
QMP: Introduce WATCHDOG event

It's emitted whenever the watchdog device's timer expires. The action
taken is provided in the 'data' member.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRestore terminal attributes for tty based monitor
Shahar Havivi [Fri, 26 Feb 2010 09:34:59 +0000 (11:34 +0200)]
Restore terminal attributes for tty based monitor

Patch http://permalink.gmane.org/gmane.comp.emulators.qemu/63472 handle
close when using tty devices (like /dev/ttyS0),
yet tty based monitor are not restoring terminal attributes (as done
with stdio based monitor), when closing qemu after that command:
$ qemu -monitor /dev/tty
the terminal is not responding until you write reset (blindly),
this patch fix it

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agokbd keds: vnc
Gerd Hoffmann [Fri, 26 Feb 2010 16:17:39 +0000 (17:17 +0100)]
kbd keds: vnc

Use led status notification support in vnc.

The qemu vnc server keeps track of the capslock and numlock states based
on the key presses it receives from the vnc client.  But this fails in
case the guests idea of the capslock and numlock state changes for other
reasons.  One case is guest reboot (+ keyboard reset).  Another case are
more recent windows versions which reset capslock state before
presenting the login screen.

Usually guests use the keyboard leds to signal the capslock and numlock
state to the user, so we can use this to better keep track of capslock
and numlock state in the qemu vnc server.

Also toggle the numlock and capslock states on keydown events (instead
of keyup).  Guests do the same.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agokbd leds: usb kbd
Gerd Hoffmann [Fri, 26 Feb 2010 16:17:38 +0000 (17:17 +0100)]
kbd leds: usb kbd

Add led status notification support to the usb kbd driver.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agokbd leds: ps/2 kbd
Gerd Hoffmann [Fri, 26 Feb 2010 16:17:37 +0000 (17:17 +0100)]
kbd leds: ps/2 kbd

Add led status notification support to the ps/2 kbd driver.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agokbd leds: infrastructure
Gerd Hoffmann [Fri, 26 Feb 2010 16:17:36 +0000 (17:17 +0100)]
kbd leds: infrastructure

Adds infrastructure for keyboard led status tracking to qemu.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoscsi: Make device scsi-disk reject /dev/sg*
Markus Armbruster [Thu, 25 Feb 2010 10:23:52 +0000 (11:23 +0100)]
scsi: Make device scsi-disk reject /dev/sg*

You're supposed to use scsi-generic for that.  Which rejects anything
but /dev/sg*.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: Catch attempt to attach more than one device to a netdev
Markus Armbruster [Fri, 26 Feb 2010 14:50:51 +0000 (15:50 +0100)]
qdev: Catch attempt to attach more than one device to a netdev

Guest device and host netdev are peers, i.e. it's a 1:1 relation.
However, we fail to enforce that:

    $ qemu -nodefaults --nographic -netdev user,id=net0 -device e1000,netdev=net0 -device virtio-net-pci,netdev=net0 -monitor stdio
    QEMU 0.12.50 monitor - type 'help' for more information
    (qemu) info network
    Devices not on any VLAN:
      net0: net=10.0.2.0, restricted=n peer=virtio-net-pci.0
      e1000.0: model=e1000,macaddr=52:54:00:12:34:56 peer=net0
      virtio-net-pci.0: model=virtio-net-pci,macaddr=52:54:00:12:34:57 peer=net0

It's all downhill from there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: Improve diagnostics for bad property values
Markus Armbruster [Fri, 26 Feb 2010 14:50:50 +0000 (15:50 +0100)]
qdev: Improve diagnostics for bad property values

Property "vlan" reports "failed to parse" even when the value parses
just fine, but the result doesn't name an existing VLAN.

Similarly, properties "drive", "chr" and "netdev" misleadingly report
"failed to parse" when the value doesn't name an existing host device.

Change PropertyInfo method parse to return an error code, so that
qdev_prop_parse() can report the error more accurately.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial
Amit Shah [Thu, 25 Feb 2010 11:54:44 +0000 (17:24 +0530)]
virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial

Use the named constant instead of -1.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reported-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectors
Amit Shah [Thu, 25 Feb 2010 11:54:43 +0000 (17:24 +0530)]
qdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectors

net.c used a constant to signify no MSI vectors were specified. Extend
that to all qdev devices.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reported-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopcnet APROMWE bit location (retry)
Chris Kilgour [Wed, 24 Feb 2010 06:32:14 +0000 (22:32 -0800)]
pcnet APROMWE bit location (retry)

According to AMD document 21485D pp.141, APROMWE is bit 8 of BCR2.

Signed-off-by: Christopher Kilgour <techie@whiterocker.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomove x509 file name defines to qemu-x509.h
Gerd Hoffmann [Thu, 25 Feb 2010 08:41:36 +0000 (09:41 +0100)]
move x509 file name defines to qemu-x509.h

Want share them with vnc and spice.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoadding helper pci functions
Izik Eidus [Thu, 25 Feb 2010 08:41:25 +0000 (09:41 +0100)]
adding helper pci functions

Signed-off-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Introduce RTC_CHANGE event
Luiz Capitulino [Thu, 25 Feb 2010 15:11:44 +0000 (12:11 -0300)]
QMP: Introduce RTC_CHANGE event

Emitted whenever the RTC time changes.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Revamp the qmp-events.txt file
Luiz Capitulino [Thu, 25 Feb 2010 15:07:02 +0000 (12:07 -0300)]
QMP: Revamp the qmp-events.txt file

Now we can say it's useful, the following changes have been made:

- Put events in alphabetical order
- Add examples to all events
- Document all 'data' members
- Small corrections and cleanups

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Drop DEBUG event
Luiz Capitulino [Thu, 25 Feb 2010 15:07:01 +0000 (12:07 -0300)]
QMP: Drop DEBUG event

This event has been introduced in the first round of QMP commits,
turns out that it's based on the usage of the EXCP_DEBUG macro,
which has discussable semantics when exposed through QMP.

As libvirt doesn't use this, let's just drop it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Move RESET event into qemu_system_reset()
Luiz Capitulino [Thu, 25 Feb 2010 15:07:00 +0000 (12:07 -0300)]
QMP: Move RESET event into qemu_system_reset()

Nothing will change as that function is currently only called by
the main loop code, but it's the right place for the RESET event,
as it's where the reset is actually performed.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQMP: Move STOP event into do_vm_stop()
Luiz Capitulino [Thu, 25 Feb 2010 15:06:59 +0000 (12:06 -0300)]
QMP: Move STOP event into do_vm_stop()

I've introduced the STOP event in the main loop, this is wrong
as it will be only emitted if the io thread is enabled.

This fixes that by moving the STOP event to do_vm_stop().

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock: Emit BLOCK_IO_ERROR before vm_stop() call
Luiz Capitulino [Thu, 25 Feb 2010 15:06:58 +0000 (12:06 -0300)]
block: Emit BLOCK_IO_ERROR before vm_stop() call

The next commit will move the STOP event into do_vm_stop(), to
have the expected event sequence we need to emit the I/O error
event before calling vm_stop().

The expected sequence is:

{ "event": "BLOCK_IO_ERROR" [...] }
{ "event": "STOP" }

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix hanging user monitor when using balloon command
Adam Litke [Mon, 22 Feb 2010 16:51:20 +0000 (10:51 -0600)]
Fix hanging user monitor when using balloon command

This patch application failed.  My patch adds a cb() call in
do_balloon(), but the change in git has added the cb() call to
do_info_balloon().  That is causing qemu segfaults.  Applying the
following should correct the damage.  Thanks.

Fix for commit: 5c366a8a3d7ac71beda8499caa815cb3ea95eb58

The cb() call is needed in do_balloon(), not do_info_balloon().

Signed-off-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agosdl: improve grab exiting instructions
Anthony Liguori [Mon, 1 Mar 2010 14:47:28 +0000 (08:47 -0600)]
sdl: improve grab exiting instructions

It might not be obvious what "grab" is.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoppc: don't define bamboo-0.13 as the default machine
Aurelien Jarno [Mon, 8 Mar 2010 11:31:27 +0000 (12:31 +0100)]
ppc: don't define bamboo-0.13 as the default machine

It has been broken by commit 977b6b91cee1132f8c7b12d22f4b273091598e44.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoUpdate to a hopefully more future proof FSF address
Blue Swirl [Sun, 7 Mar 2010 15:48:43 +0000 (15:48 +0000)]
Update to a hopefully more future proof FSF address

See also 8167ee883931cb20c6264fc19d040ce2dc6ceaaa,
530e7615ce3c01882e582c84dc6304ab98a3d5c5 and
fad6cb1a565bb73f83fc0e2654489457b489e436.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoi386-dis: remove dead assignments, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:56:27 +0000 (13:56 +0000)]
i386-dis: remove dead assignments, spotted by clang

Value stored to 'mask' is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosoftfloat: remove dead assignments, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:49:58 +0000 (13:49 +0000)]
softfloat: remove dead assignments, spotted by clang

Value stored to 'bSign' is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoslirp: remove dead nested assignment, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:45:38 +0000 (13:45 +0000)]
slirp: remove dead nested assignment, spotted by clang

Although the value stored to 'r' is used in the enclosing expression,
the value is never actually read from 'r'.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoslirp: remove dead initialization, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:45:38 +0000 (13:45 +0000)]
slirp: remove dead initialization, spotted by clang

Value stored during initialization is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoslirp: remove dead increments, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:45:37 +0000 (13:45 +0000)]
slirp: remove dead increments, spotted by clang

Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoslirp: remove dead assignments, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:13:05 +0000 (13:13 +0000)]
slirp: remove dead assignments, spotted by clang

Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotarget-arm: Fix missing 'return' in SRS handling.
Adam Lackorzynski [Mon, 1 Mar 2010 16:19:54 +0000 (17:19 +0100)]
target-arm: Fix missing 'return' in SRS handling.

There's a return missing in the srs handling which leads to srs always being
treated an an invalid op.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix curses interaction with keymaps
Samuel Thibault [Sun, 28 Feb 2010 20:03:00 +0000 (21:03 +0100)]
Fix curses interaction with keymaps

The combination of keymap support (-k option) and curses is currently
very broken.  The patch below fixes it by first extending keymap support
to interpret the shift, ctrl, altgr and addupper keywords in keymaps,
and to fix curses into properly using keymaps.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
14 years agouse absolute URLs for .gitmodules
Paolo Bonzini [Fri, 5 Mar 2010 08:08:04 +0000 (09:08 +0100)]
use absolute URLs for .gitmodules

The relative URLs do not work when cloning a fork of qemu or when
cloning from the Savannah URL.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoDocumentation: Modify rule for html output (better looking output format)
Stefan Weil [Thu, 4 Mar 2010 21:21:02 +0000 (22:21 +0100)]
Documentation: Modify rule for html output (better looking output format)

To create html output from texi input, texi2html was used.
Output from makeinfo looks cleaner, so replace the old rule
and use makeinfo now.

For those who want to use their own variant of html output,
the macros MAKEINFO and MAKEINFOFLAGS allow customisation.
Option "-I ." is not needed (the current directory is
searched by default), so remove it.

Please note that the build requirements changed, too:
makeinfo is required for doc builds.
texi2html is no longer used.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoscsi: update comment on the standards revision
Christoph Hellwig [Thu, 4 Mar 2010 13:45:44 +0000 (14:45 +0100)]
scsi: update comment on the standards revision

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-nbd: Fix wrong description in qemu-nbd.texi
Ryota Ozaki [Wed, 3 Mar 2010 15:18:43 +0000 (00:18 +0900)]
qemu-nbd: Fix wrong description in qemu-nbd.texi

-c option needs argument <dev> but it's missing now.
This patch fixes it.

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoBuild usb-ohci for PCs
Kevin Wolf [Wed, 3 Mar 2010 15:02:25 +0000 (16:02 +0100)]
Build usb-ohci for PCs

The OHCI emulation isn't obviously broken and there are people who want to use
it. Let's build it by default so that it can be enabled via -device.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoppc440_bamboo: Disable new virtio-serial features for 0.12 machine type
Amit Shah [Thu, 25 Feb 2010 13:56:12 +0000 (19:26 +0530)]
ppc440_bamboo: Disable new virtio-serial features for 0.12 machine type

Disable the MULTIPORT feature and MSI vectors for the 0.12 machine
types; those features are added only for 0.13 onwards.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>