qemu
15 years agolinux-user: mmap: add check if requested memory area fits target address space
aurel32 [Mon, 8 Dec 2008 18:12:33 +0000 (18:12 +0000)]
linux-user: mmap: add check if requested memory area fits target address space

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

15 years agolinux-user: Fix h2g usage in page_find_alloc
aurel32 [Mon, 8 Dec 2008 18:12:26 +0000 (18:12 +0000)]
linux-user: Fix h2g usage in page_find_alloc

Paul's comment on my first approach to fix the h2g usage in
page_find_alloc finally open my eyes about what the code is actually
supposed to do:

With the help of h2g_valid we can no cleanly check if a freshly allocate
page (for host usage) is guest-reachable and, in case it is, mark it
reserved in the guest's address range.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

15 years agolinux-user: Introduce h2g_valid
aurel32 [Mon, 8 Dec 2008 18:12:18 +0000 (18:12 +0000)]
linux-user: Introduce h2g_valid

Introduce h2g_valid to check if a given host address can be converted
into a valid guest address.

Based on a patch from  Jan Kiszka <jan.kiszka@web.de>

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

15 years agolinux-user: Safety belt for h2g
aurel32 [Mon, 8 Dec 2008 18:12:11 +0000 (18:12 +0000)]
linux-user: Safety belt for h2g

h2g can only work on 64-bit hosts if the provided address is mappable to
the guest range. Neglecting this was already the source for several
bugs. Instrument the macro so that it will trigger earlier in the
future (at least as long as we have this kind of mapping mechanism).

Based on a patch from Jan Kiszka <jan.kiszka@web.de>

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

15 years agolinux-user: Move abi_* typedefs into qemu-types.h
aurel32 [Mon, 8 Dec 2008 18:12:04 +0000 (18:12 +0000)]
linux-user: Move abi_* typedefs into qemu-types.h

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

15 years agoconfigure: also close stdout when calling cc
aurel32 [Mon, 8 Dec 2008 18:11:57 +0000 (18:11 +0000)]
configure: also close stdout when calling cc

Remove some ugly outputs with colorgcc

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

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

15 years agotarget-ppc: kill a warning
aurel32 [Mon, 8 Dec 2008 18:11:50 +0000 (18:11 +0000)]
target-ppc: kill a warning

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

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

15 years agotarget-ppc: cleanup op_helper.c after TCG conversion
aurel32 [Mon, 8 Dec 2008 18:11:42 +0000 (18:11 +0000)]
target-ppc: cleanup op_helper.c after TCG conversion

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

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

15 years agotarget-ppc: enable access type in MMU
aurel32 [Mon, 8 Dec 2008 18:11:33 +0000 (18:11 +0000)]
target-ppc: enable access type in MMU

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

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

15 years agotarget-ppc: memory load/store rework
aurel32 [Mon, 8 Dec 2008 18:11:21 +0000 (18:11 +0000)]
target-ppc: memory load/store rework

Rework the memory load/store:
- Unify load/store functions for 32-bit and 64-bit CPU
- Don't swap values twice for bit-reverse load/store functions
  in little endian mode.
- On a 64-bit CPU in 32-bit mode, do the address truncation for
  address computation instead of every load store. Truncate the
  address when incrementing the address (if needed)
- Cache writes to access_types.
- Add a few missing calls to gen_set_access_type()

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

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

15 years agoMake memory load functions (ldxx_y(ptr)) take a const pointer.
balrog [Sun, 7 Dec 2008 23:44:44 +0000 (23:44 +0000)]
Make memory load functions (ldxx_y(ptr)) take a const pointer.

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

15 years agoFix 64-bit targets compilation on ARM host.
balrog [Sun, 7 Dec 2008 23:35:47 +0000 (23:35 +0000)]
Fix 64-bit targets compilation on ARM host.

Only fix compilation, probably doesn't run.

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

15 years agoMove spitz microdrive to PCMCIA socket 0.
balrog [Sun, 7 Dec 2008 23:33:34 +0000 (23:33 +0000)]
Move spitz microdrive to PCMCIA socket 0.

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

15 years agotarget-alpha: gdb-stub support
aurel32 [Sun, 7 Dec 2008 23:26:32 +0000 (23:26 +0000)]
target-alpha: gdb-stub support

(Vince Weaver)

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

15 years agoMIPS: remove a few warnings
aurel32 [Sun, 7 Dec 2008 23:26:24 +0000 (23:26 +0000)]
MIPS: remove a few warnings

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

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

15 years agogdbstub: kill a warning
aurel32 [Sun, 7 Dec 2008 23:26:17 +0000 (23:26 +0000)]
gdbstub: kill a warning

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

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

15 years agoParallel port reset
aurel32 [Sun, 7 Dec 2008 23:26:09 +0000 (23:26 +0000)]
Parallel port reset

Attached patch adds a reset handler to parallel port, so it gets correct
register values after a reset.

(HervĂ© Poussineau)

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

15 years agotarget-ppc: kill a few warnings
aurel32 [Sun, 7 Dec 2008 23:00:00 +0000 (23:00 +0000)]
target-ppc: kill a few warnings

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

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

15 years agoQuote configure's arguments and location while storing them in config_host.mak
malc [Sun, 7 Dec 2008 22:50:16 +0000 (22:50 +0000)]
Quote configure's arguments and location while storing them in config_host.mak

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

15 years agoSH4: SCI improvement
aurel32 [Sun, 7 Dec 2008 22:46:49 +0000 (22:46 +0000)]
SH4: SCI improvement

This patch simply implement one register of SH4's SCI := Serial Communication Interface.

R2D evaluation board uses SCI for SPI connection.  So, Linux kernel for R2D with
default configuration causes a QEMU assertion failure when it initializes SPI driver.
This patch avoids it and reduces the kernel config modification work for QEMU.

Completing SCI implementation task is left.  Other board support is desirable to confirm
this task, which uses SCI for a serial terminal.

(Shin-ichiro KAWASAKI)

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

15 years agoSH4: kill a few warnings
aurel32 [Sun, 7 Dec 2008 22:46:42 +0000 (22:46 +0000)]
SH4: kill a few warnings

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

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

15 years agoSH4: Implement FD bit
aurel32 [Sun, 7 Dec 2008 22:46:31 +0000 (22:46 +0000)]
SH4: Implement FD bit

SH4 manual say that if a floating point instruction is executed while
FD bit in the status register is 1, an exception should be raised. QEMU
presently does not do that, so the kernel does not initialize FP state
for any thread, nor does it save/restore FP state. The most apparent
consequence is that while recent gcc/libc expect double-precision mode
to be set by kernel, they run in single-precision mode, and all FP code
produces wrong values.

This patch fixes this. It also fixes a couple of places where PC was
not updated before handling an exception, although both those places
deal with invalid instruction and don't lead to any user-visible bugs.

(Vladimir Prus)

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

15 years agoSome cleanups after dyngen removal
aurel32 [Sun, 7 Dec 2008 20:35:00 +0000 (20:35 +0000)]
Some cleanups after dyngen removal

1. hostregs_helper.h: fix comment
2. translate-all.c: rename dyngen_code(_search_pc) to
   tcg_gen_code(_search_pc)
3. tcg.c:
  - rename dyngen_table_op_count to tcg_table_op_count
  - no need to generate a log of dyngen ops generated
  - rename dyngen_code(_search_pc) to tcg_gen_code(_search_pc)
4. tcg.h: rename dyngen_code(_search_pc) to
   tcg_gen_code(_search_pc)

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

15 years agoSH4: Eliminate P4 to A7 mangling (Takashi YOSHII).
balrog [Sun, 7 Dec 2008 19:39:58 +0000 (19:39 +0000)]
SH4: Eliminate P4 to A7 mangling (Takashi YOSHII).

Main purpose of this is to delete
       *physical = address & 0x1fffffff;
at target-sh4/helper.c:449, using new mmio rule introduced by #5849
This masking is a nice trick to realize P4/A7 duality of SH registers.
But, IMHO, it is logically wrong.

Most of SH4 cpu control registers in P4 area(0xfc000000...0xffffffff) have
one more address called A7 which is usually P4 address with upper 3bits masked.
This is an address only appears in TLB's physical address part.

Current code use trick writing drivers as if they are really in A7
(that's why you see many *_A7 in hw/sh*.c), and using translation P4 to A7.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoSH: improve the way sh7750 registers io memory (Takashi YOSHII).
balrog [Sun, 7 Dec 2008 19:33:15 +0000 (19:33 +0000)]
SH: improve the way sh7750 registers io memory (Takashi YOSHII).

Fixes to be needed for commit #5849 "Change MMIO callbacks..."
 hw/sh7750.c:
  - Divide region of CPU control registers to avoid overlapping
    to peripheral modules.
  - Delete unused var "icr", which had moved to hw/sh_intc.c.
 hw/sm501.c:
  - Merge non page aligned palette registers into the region of
    control registers.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoFix some new warnings introduced after r5022
blueswir1 [Sun, 7 Dec 2008 19:30:18 +0000 (19:30 +0000)]
Fix some new warnings introduced after r5022

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

15 years agoSH: r2d pci support (Takashi YOSHII).
balrog [Sun, 7 Dec 2008 19:20:43 +0000 (19:20 +0000)]
SH: r2d pci support (Takashi YOSHII).

This patch adds pci support to sh/r2d board.
This is the first user of PCIC support I formerly sent.

PCIC actually is inside of chip with CPU core on SH7751.
But, this code is written as if SH7750 and PCIC are on board.
I care little about physical device boundary, but fitting with qemu's
design.

This patch also adds some BSC (Bus State Controller) registers,
because PCI device driver software have to accesses them.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoEnable gcc flag -Wredundant-decls
blueswir1 [Sun, 7 Dec 2008 19:16:27 +0000 (19:16 +0000)]
Enable gcc flag -Wredundant-decls

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

15 years agoEnable gcc flag -Wstrict-prototypes
blueswir1 [Sun, 7 Dec 2008 19:15:47 +0000 (19:15 +0000)]
Enable gcc flag -Wstrict-prototypes

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

15 years agoEnable gcc flag -Wmissing-prototypes
blueswir1 [Sun, 7 Dec 2008 19:15:17 +0000 (19:15 +0000)]
Enable gcc flag -Wmissing-prototypes

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

15 years agoSH: Don't subtract bases from access addresses in PCIC.
balrog [Sun, 7 Dec 2008 19:13:12 +0000 (19:13 +0000)]
SH: Don't subtract bases from access addresses in PCIC.

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

15 years agoSH: On-chip PCI controller support (Takashi YOSHII).
balrog [Sun, 7 Dec 2008 19:08:45 +0000 (19:08 +0000)]
SH: On-chip PCI controller support (Takashi YOSHII).

This patch adds SuperH on-chip PCI controller(PCIC) support.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agosh4: Add r2d onboard FPGA IRQ controller (Takashi YOSHII).
balrog [Sun, 7 Dec 2008 18:59:57 +0000 (18:59 +0000)]
sh4: Add r2d onboard FPGA IRQ controller (Takashi YOSHII).

This adds IRQ controller in FPGA on r2d, and use it for CF.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agosh4: Add IRL (4-bit encoded interrupt input) support (Takashi YOSHII).
balrog [Sun, 7 Dec 2008 18:49:57 +0000 (18:49 +0000)]
sh4: Add IRL (4-bit encoded interrupt input) support (Takashi YOSHII).

This patch adds IRL(4bit encoded 15 level interrupt input) support
to SH using qemu_irq as a multi level (!=on/off) signal.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agosh4: mmio based CF support on r2d board (Takashi YOSHII).
balrog [Sun, 7 Dec 2008 18:41:42 +0000 (18:41 +0000)]
sh4: mmio based CF support on r2d board (Takashi YOSHII).

 This patch adds emulation for a CompactFlash on sh4/r2d board.
 The device is CF, but wired to be worked as True-IDE mode, and connected
 directly to SH bus. So, this code is to support generally mmio based
 IDEs which are supported by "pata_platform" driver in linux kernel.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoRemove FORCE_RET() and RETURN()
aurel32 [Sun, 7 Dec 2008 18:15:54 +0000 (18:15 +0000)]
Remove FORCE_RET() and RETURN()

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

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

15 years agoSome cleanups after dyngen removal
aurel32 [Sun, 7 Dec 2008 18:15:45 +0000 (18:15 +0000)]
Some cleanups after dyngen removal

   this patch removes some now unused things after dyngen removal.

1. dyngen-exec.h:  op_param, op _jmp and some associated macros
   are now unused;
2. Makefile.target:  tcg-dyngen is not needed anymore
2. tcg/tcg-op.h, tcg/tcg-opc.h:  gen-op.h is dead
3. tcg.c:
    - INDEX_op_end is now the first op
    - CONFIG_DYNGEN_OP is never defined
4. tcg.h:  dyngen_op not needed anymore
5. exec-all.h:  remove some ASM macros.

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

15 years agotarget-i386: fix CVE-2007-1322
aurel32 [Sun, 7 Dec 2008 18:15:36 +0000 (18:15 +0000)]
target-i386: fix CVE-2007-1322

The icebp instruction can be abused to terminate the emulation,
resulting in denial of service.

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

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

15 years agoslirp: fix CVE 2007-5729
aurel32 [Sun, 7 Dec 2008 18:15:23 +0000 (18:15 +0000)]
slirp: fix CVE 2007-5729

The emulated network cards in QEMU allows local users to execute arbitrary
code by writing Ethernet frames with a size larger than the slirp's default
MTU, which triggers a heap-based buffer overflow in the slirp library.

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

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

15 years agoSome fixes for TCG debugging
blueswir1 [Sun, 7 Dec 2008 17:16:42 +0000 (17:16 +0000)]
Some fixes for TCG debugging

This fixes a few things after Paul's improvements for TCG debugging:

  - change TCGv_i64 field name to something different from
    TCGv_i32
  - fix things in tcg that the above change made visible.

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>

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

15 years agotarget-ppc: disable single stepping
aurel32 [Sun, 7 Dec 2008 16:23:22 +0000 (16:23 +0000)]
target-ppc: disable single stepping

... which left was enabled by mistake.

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

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

15 years agoPXA: Account for offset from page start in a subpage mapping.
balrog [Sun, 7 Dec 2008 16:08:49 +0000 (16:08 +0000)]
PXA: Account for offset from page start in a subpage mapping.

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

15 years agoUpdate .gitignore
aurel32 [Sun, 7 Dec 2008 16:04:13 +0000 (16:04 +0000)]
Update .gitignore

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

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

15 years agotarget-ppc: Fix use of uninitialized TCG variable in tlbiva
aurel32 [Sun, 7 Dec 2008 15:45:15 +0000 (15:45 +0000)]
target-ppc: Fix use of uninitialized TCG variable in tlbiva

Silences a warning about possible unitialized use of t0.

Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

15 years agoRemove a few dyngen and dyngen related code
aurel32 [Sun, 7 Dec 2008 15:21:23 +0000 (15:21 +0000)]
Remove a few dyngen and dyngen related code

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

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

15 years agoARM: fix smmul and smmla/smmls usage of registers (Mans Rullgard).
balrog [Sun, 7 Dec 2008 14:18:02 +0000 (14:18 +0000)]
ARM: fix smmul and smmla/smmls usage of registers (Mans Rullgard).

This fixes the destination and accumulator registers for the smmul
and smmla instructions.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoARM: fix usad8 and usada8 usage of registers (Mans Rullgard).
balrog [Sun, 7 Dec 2008 14:03:27 +0000 (14:03 +0000)]
ARM: fix usad8 and usada8 usage of registers (Mans Rullgard).

This fixes the destination and accumulator registers for the usad8
and usada8 instructions.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoRemove gcc 3.4 check
aurel32 [Sun, 7 Dec 2008 13:40:38 +0000 (13:40 +0000)]
Remove gcc 3.4 check

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

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

15 years agotarget-ppc: convert SPR accesses to TCG
aurel32 [Sun, 7 Dec 2008 13:40:29 +0000 (13:40 +0000)]
target-ppc: convert SPR accesses to TCG

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

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

15 years agotarget-ppc: remove dead code
aurel32 [Sun, 7 Dec 2008 13:40:15 +0000 (13:40 +0000)]
target-ppc: remove dead code

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

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

15 years agoPatch holes in ARM translation (Laurent Desnogues).
balrog [Sun, 7 Dec 2008 13:32:09 +0000 (13:32 +0000)]
Patch holes in ARM translation (Laurent Desnogues).

 - gen_set_CF_bit31:  use the right value to set carry flag
 - shifter_out_im:  remove a spurious semi-colon
 - add a break for VSHRN, VRSHRN, VQSHRN, VQRSHRN
   size 2 case
 - sbfx, ubfx are v6t2 instructions

The correct cps user mode behaviour is unclear so it's left out from the
commit until ARM decides it.

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoARM: cosmetics (Laurent Desnogues).
balrog [Sun, 7 Dec 2008 13:20:16 +0000 (13:20 +0000)]
ARM: cosmetics (Laurent Desnogues).

  - remove macros that are not used
  - remove disass structure is_mem field which value is never used
  - correct a typo in a comment.

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoomap1: fix uart3 init (Jean-Christophe PLAGNIOL-VILLARD).
balrog [Sun, 7 Dec 2008 12:52:07 +0000 (12:52 +0000)]
omap1: fix uart3 init (Jean-Christophe PLAGNIOL-VILLARD).

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoomap1: add OSC_12M_SEL UART register support (original patch from Jean-Christophe...
balrog [Sun, 7 Dec 2008 12:49:26 +0000 (12:49 +0000)]
omap1: add OSC_12M_SEL UART register support (original patch from Jean-Christophe PLAGNIOL-VILLARD)

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

15 years agopflash_cfi01: add Single Byte Program (Jean-Christophe PLAGNIOL-VILLARD).
balrog [Sun, 7 Dec 2008 12:36:28 +0000 (12:36 +0000)]
pflash_cfi01: add Single Byte Program (Jean-Christophe PLAGNIOL-VILLARD).

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoSCSI: Handle inquiry commands of varying length (Justin Chevrier).
balrog [Sun, 7 Dec 2008 03:12:54 +0000 (03:12 +0000)]
SCSI: Handle inquiry commands of varying length (Justin Chevrier).

Openserver 5.0.5 sends an Inquiry command to the emulated SCSI disk
expecting a response length of 40 bytes. Currently the response to an
Inquiry command is hardcoded to 36 bytes. When receiving a response of
length 36 instead of 40 Openserver panics.

Modifications to original patch based on feedback from Ryan Harper and Paul
Brook. Thanks guys.

Signed-off-by: Justin Chevrier <address@hidden>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoLSI53C895A: Handle empty SCRIPTS opcode (Justin Chevrier)
balrog [Sun, 7 Dec 2008 03:07:51 +0000 (03:07 +0000)]
LSI53C895A: Handle empty SCRIPTS opcode (Justin Chevrier)

Basically after each DMA transfer the Openserver driver would issue an
empty (0) SCRIPTS opcode. As the opcode is essentially a NOP it has no
second DWORD and therefore the DSP should only be incremented by 4 bytes
instead of the 8 bytes we currently do.

Here's a snippet of the log:

lsi_scsi: Data ready tag=0x100d9 len=16384
...
lsi_scsi: SCRIPTS dsp=068c5e50 opcode 01000400 arg 07a09000
lsi_scsi: DMA addr=0x07a09000 len=1024
lsi_scsi: SCRIPTS dsp=068c5e58 opcode 00000000 arg 01000400
lsi_scsi: Wrong phase got 1 expected 0

Note the 2nd DWORD after the empty opcode; the next opcode in the DMA
transfer sequence. As can be expected the address after that has the next
DMA address to use.

After the attached patch the DMA transfer is able to complete successfully:

lsi_scsi: SCRIPTS dsp=068c5e50 opcode 01000400 arg 07a0d000
lsi_scsi: DMA addr=0x07a0d000 len=1024
lsi_scsi: SCRIPTS dsp=068c5e5c opcode 01000400 arg 07a0d400
lsi_scsi: DMA addr=0x07a0d400 len=1024
...

Tested againsted Openserver 5.0.5 and Debian ARM.

Signed-off-by: Justin Chevrier <address@hidden>
Acked-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>

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

15 years agoLSI53C895A: Remove current_dma_len hack
balrog [Sun, 7 Dec 2008 03:03:21 +0000 (03:03 +0000)]
LSI53C895A: Remove current_dma_len hack

Signed-off-by: Justin Chevrier <address@hidden>
Acked-by: Ryan Harper <ryanh@us.ibm.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>

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

15 years agoRemove a duplicate omap_l4_attach(), add one missing elsewhere.
balrog [Sun, 7 Dec 2008 01:51:28 +0000 (01:51 +0000)]
Remove a duplicate omap_l4_attach(), add one missing elsewhere.

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

15 years agoDon't wrap I2C registers addresses on PXA270.
balrog [Sun, 7 Dec 2008 01:49:28 +0000 (01:49 +0000)]
Don't wrap I2C registers addresses on PXA270.

This way the registers will only be visible at the given offset instead of
every 0x100 bytes.

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

15 years agoETRAX-FS: Simplify the DMA blocks address registration and decoding.
edgar_igl [Sun, 7 Dec 2008 00:14:21 +0000 (00:14 +0000)]
ETRAX-FS: Simplify the DMA blocks address registration and decoding.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

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

15 years agoETRAX-FS: No need to decode the address anymore.
edgar_igl [Sat, 6 Dec 2008 23:19:03 +0000 (23:19 +0000)]
ETRAX-FS: No need to decode the address anymore.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

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

15 years agotarget-ppc: remove dead code
aurel32 [Sat, 6 Dec 2008 22:01:01 +0000 (22:01 +0000)]
target-ppc: remove dead code

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

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

15 years agotarget-ppc: convert SLB/TLB instructions to TCG
aurel32 [Sat, 6 Dec 2008 21:46:17 +0000 (21:46 +0000)]
target-ppc: convert SLB/TLB instructions to TCG

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

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

15 years agoThe configure test for struct iovec #includes <sys/uio.h> but qemu-common.h did not.
blueswir1 [Sat, 6 Dec 2008 19:44:56 +0000 (19:44 +0000)]
The configure test for struct iovec #includes <sys/uio.h> but qemu-common.h did not.

This fixes compilation of hw/virtio.h on Mac OS X.

Signed-off-by: Andreas Faerber <andreas.faerber@web.de>

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

15 years agotarget-ppc: convert dcr load/store to TCG
aurel32 [Sat, 6 Dec 2008 16:37:18 +0000 (16:37 +0000)]
target-ppc: convert dcr load/store to TCG

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

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

15 years agotarget-ppc: convert msr load/store to TCG
aurel32 [Sat, 6 Dec 2008 13:03:35 +0000 (13:03 +0000)]
target-ppc: convert msr load/store to TCG

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

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

15 years agotarget-ppc: convert POWER bridge instructions to TCG
aurel32 [Sat, 6 Dec 2008 12:19:14 +0000 (12:19 +0000)]
target-ppc: convert POWER bridge instructions to TCG

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

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

15 years agoRevert "hw/apic.c: use fls() from host-utils"
aurel32 [Sat, 6 Dec 2008 10:46:35 +0000 (10:46 +0000)]
Revert "hw/apic.c: use fls() from host-utils"

This reverts commit 5876.

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

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

15 years agoMake struct iovec universally available
aliguori [Fri, 5 Dec 2008 20:05:26 +0000 (20:05 +0000)]
Make struct iovec universally available

Vectored IO APIs will require some sort of vector argument.  It makes sense to
use struct iovec and just define it globally for Windows.

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

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

15 years agoAttached patch contains warning fixes.
blueswir1 [Fri, 5 Dec 2008 17:56:40 +0000 (17:56 +0000)]
Attached patch contains warning fixes.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

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

15 years agoAttached patch make cpu-exec.c compile on NetBSD.
blueswir1 [Fri, 5 Dec 2008 17:55:45 +0000 (17:55 +0000)]
Attached patch make cpu-exec.c compile on NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

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

15 years agoAttached patch makes NetBSD use the native bswap functions
blueswir1 [Fri, 5 Dec 2008 17:54:09 +0000 (17:54 +0000)]
Attached patch makes NetBSD use the native bswap functions
which compile.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

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

15 years agosys-queue.h defines _SYS_QUEUE_H_ which is also defined by
blueswir1 [Fri, 5 Dec 2008 17:53:21 +0000 (17:53 +0000)]
sys-queue.h defines _SYS_QUEUE_H_ which is also defined by
the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
on NetBSD, which doesn't exist in sys-queue.h. Therefore,
include <sys/queue.h> before including sys-queue.h.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

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

15 years agoFix PPC PREP platform, broken by commit 5849
aurel32 [Fri, 5 Dec 2008 16:05:41 +0000 (16:05 +0000)]
Fix PPC PREP platform, broken by commit 5849

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

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

15 years agohw/ppc4xx_pci.c: kill two warnings
aurel32 [Fri, 5 Dec 2008 16:05:32 +0000 (16:05 +0000)]
hw/ppc4xx_pci.c: kill two warnings

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

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

15 years agotarget-ppc: convert POWER shift instructions to TCG
aurel32 [Fri, 5 Dec 2008 07:21:44 +0000 (07:21 +0000)]
target-ppc: convert POWER shift instructions to TCG

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

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

15 years agotarget-ppc: add functions to load/store SPR
aurel32 [Fri, 5 Dec 2008 07:21:31 +0000 (07:21 +0000)]
target-ppc: add functions to load/store SPR

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

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

15 years agodo boundary check based on absolute value (Glauber Costa)
aliguori [Thu, 4 Dec 2008 22:36:38 +0000 (22:36 +0000)]
do boundary check based on absolute value (Glauber  Costa)

For backward operations, dstpitch and srcpitch can
be negative. This leads BLTUNSAFE macro into an
overflow, and as a result, it avoids performing
operations that are perfectly valid.

The visible effect that led to that patch was the gnome-panel
bar in Fedora10. Before this patch, you could see garbage
clobbering a big portion of the bar.

After this patch, this garbage is gone.

Signed-off-by: Glauber Costa <glommer@redhat.com>

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

15 years agoUse writeback caching by default with qcow2
aliguori [Thu, 4 Dec 2008 21:39:21 +0000 (21:39 +0000)]
Use writeback caching by default with qcow2

qcow2 writes a cluster reference count on every cluster update.  This causes
performance to crater when using anything but cache=writeback.  This is most
noticeable when using savevm.  Right now, qcow2 isn't a reliable format
regardless of the type of cache your using because metadata is not updated in
the correct order.  Considering this, I think it's somewhat reasonable to use
writeback caching by default with qcow2 files.

It at least avoids the massive performance regression for users until we sort
out the issues in qcow2.

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

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

15 years agoFix RTC initial date computation
aurel32 [Thu, 4 Dec 2008 21:34:52 +0000 (21:34 +0000)]
Fix RTC initial date computation

qemu_get_clock() returns a structure containing the time the user wants
to be set (either UTC time, a local time, or a given date). Use mktimegm()
instead of mktime() to convert it into POSIX time without taking the host
timezone into account.

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

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

15 years agoFix windows build after virtio changes
aliguori [Thu, 4 Dec 2008 21:28:28 +0000 (21:28 +0000)]
Fix windows build after virtio changes

Windows does not have sys/uio.h and does not have err.h.

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

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

15 years agohw/apic.c: use fls() from host-utils
aurel32 [Thu, 4 Dec 2008 20:57:02 +0000 (20:57 +0000)]
hw/apic.c: use fls() from host-utils

...and fix a bug, the implementation in hw/apic.c was wrong.

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

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

15 years agoAdd missing file from previous commit.
aliguori [Thu, 4 Dec 2008 20:35:16 +0000 (20:35 +0000)]
Add missing file from previous commit.

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

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

15 years agoAdd virtio-balloon support
aliguori [Thu, 4 Dec 2008 20:33:06 +0000 (20:33 +0000)]
Add virtio-balloon support

This adds a VirtIO based balloon driver.  It uses madvise() to actually balloon
the memory when possible.

Until 2.6.27, KVM forced memory pinning so we must disable ballooning unless the
kernel actually supports it when using KVM.  It's always safe when using TCG.

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

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

15 years agoAdd ballooning infrastructure.
aliguori [Thu, 4 Dec 2008 20:19:35 +0000 (20:19 +0000)]
Add ballooning infrastructure.

Balloon devices allow you to ask the guest to allocate memory.  This allows you
to release that memory.  It's mostly useful for freeing up large chunks of
memory from cooperative guests.

Ballooning is supported by both Xen and VirtIO.

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

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

15 years agoDefine fls() in terms of clz32().
aliguori [Thu, 4 Dec 2008 20:08:06 +0000 (20:08 +0000)]
Define fls() in terms of clz32().

As suggested by Laurent Desnogues.

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

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

15 years agoRemove TARGET_PAGE_SIZE from virtio interface (Hollis Blanchard)
aliguori [Thu, 4 Dec 2008 19:58:45 +0000 (19:58 +0000)]
Remove TARGET_PAGE_SIZE from virtio interface (Hollis Blanchard)

TARGET_PAGE_SIZE should only be used internal to qemu, not in guest/host
interfaces. The virtio frontend code in Linux uses two constants (PFN shift
and vring alignment) for the interface, so update qemu to match.

I've tested this with PowerPC KVM and confirmed that it fixes virtio problems
when using non-TARGET_PAGE_SIZE pages in the guest.

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

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

15 years agoAdd virtio-blk support
aliguori [Thu, 4 Dec 2008 19:52:44 +0000 (19:52 +0000)]
Add virtio-blk support

Virtio-blk is a paravirtual block device based on VirtIO.  It can be used by
specifying the if=virtio parameter to the -drive parameter.

When using -enable-kvm, it can achieve very good performance compared to IDE or
SCSI.

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

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

15 years agoVirtio core support
aliguori [Thu, 4 Dec 2008 19:38:57 +0000 (19:38 +0000)]
Virtio core support

This patch adds core support for VirtIO.  VirtIO is a paravirtualization
framework that has been in Linux since 2.6.21.  A PCI transport has been
available since 2.6.25.  Network drivers are also available for Windows.

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

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

15 years agoIntroduce fls() helper
aliguori [Thu, 4 Dec 2008 19:19:45 +0000 (19:19 +0000)]
Introduce fls() helper

This is needed for virtio.  The implementation is originally from
Marcelo Tosatti.

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

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

15 years agoClarify -soundhw documentation as to avoid hda confusion
malc [Thu, 4 Dec 2008 18:01:26 +0000 (18:01 +0000)]
Clarify -soundhw documentation as to avoid hda confusion

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

15 years agoUpdate
malc [Thu, 4 Dec 2008 11:29:42 +0000 (11:29 +0000)]
Update

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

15 years agoSilence warnings generated due to `#if BUILD_Y8950'
malc [Wed, 3 Dec 2008 23:00:35 +0000 (23:00 +0000)]
Silence warnings generated due to `#if BUILD_Y8950'

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

15 years agoMake audio violate POSIX less
malc [Wed, 3 Dec 2008 22:48:44 +0000 (22:48 +0000)]
Make audio violate POSIX less

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

15 years agoMore consistent PAGE_xxx defines, avoid conflicting with system PAGE_xxx
blueswir1 [Wed, 3 Dec 2008 16:29:47 +0000 (16:29 +0000)]
More consistent PAGE_xxx defines, avoid conflicting with system PAGE_xxx

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

15 years agoIBM PowerPC 4xx 32-bit PCI controller emulation
aurel32 [Tue, 2 Dec 2008 23:53:50 +0000 (23:53 +0000)]
IBM PowerPC 4xx 32-bit PCI controller emulation

This PCI controller can be found on a number of 4xx SoCs, including the 440EP.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

15 years agoChange order of metadata update to prevent loosing guest data because of unexpected...
aliguori [Tue, 2 Dec 2008 20:14:05 +0000 (20:14 +0000)]
Change order of metadata update to prevent loosing guest data because of unexpected exit (Gleb Natapov)

Currently the order is this (during cow since it's the interesting case):
1. Decrement refcount of old clusters
2. Increment refcount for newly allocated clusters
3. Copy content of old sectors that will not be rewritten
4. Update L2 table with pointers to new clusters
5. Write guest data into new clusters (asynchronously)

There are several problems with this order. The first one is that if qemu
crashes (or killed or host reboots) after new clusters are linked into L2
table but before user data is written there, then on the next reboot guest
will find neither old data nor new one in those sectors and this is not
what gust expects even when journaling file system is in use.  The other
problem is that if qemu is killed between steps 1 and 4 then refcount
of old cluster will be incorrect and may cause snapshot corruption.

The patch change the order to be like this:
1. Increment refcount for newly allocated clusters
2. Write guest data into new clusters (asynchronously)
3. Copy content of old sectors that were not rewritten
4. Update L2 table with pointers to new clusters
5. Decrement refcount of old clusters

Unexpected crash may cause cluster leakage, but guest data should be safe.

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

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

15 years agoCleanup {alloc|get}_cluster_offset() (Gleb Natapov)
aliguori [Tue, 2 Dec 2008 20:11:27 +0000 (20:11 +0000)]
Cleanup {alloc|get}_cluster_offset() (Gleb Natapov)

Move duplicated code into helper functions.

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

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

15 years agoWrite table offset and size in one syscall (Gleb Natapov)
aliguori [Tue, 2 Dec 2008 20:10:14 +0000 (20:10 +0000)]
Write table offset and size in one syscall (Gleb Natapov)

Otherwise if VM is killed between two writes data may be lost.
But if offset and size fields are at the same disk block one
write should update them both simultaneously.

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

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