]> git.proxmox.com Git - qemu.git/log
qemu.git
12 years agoide/atapi: Clean up misleading name in cmd_start_stop_unit()
Markus Armbruster [Tue, 6 Sep 2011 16:58:37 +0000 (18:58 +0200)]
ide/atapi: Clean up misleading name in cmd_start_stop_unit()

"eject" is misleading; it means "eject" when start is clear, but
"load" when start is set.  Rename to loej, because that's how MMC-5
calls it, in section 6.40.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Reject ATA commands specific to drive kinds
Markus Armbruster [Tue, 6 Sep 2011 16:58:36 +0000 (18:58 +0200)]
ide: Reject ATA commands specific to drive kinds

ACS-2 Table B.2 explicitly prohibits ATAPI devices from implementing
WIN_RECAL, WIN_READ_EXT, WIN_READDMA_EXT, WIN_READ_NATIVE_MAX,
WIN_MULTREAD_EXT, WIN_WRITE, WIN_WRITE_ONCE, WIN_WRITE_EXT,
WIN_WRITEDMA_EXT, WIN_MULTWRITE_EXT, WIN_WRITE_VERIFY, WIN_VERIFY,
WIN_VERIFY_ONCE, WIN_VERIFY_EXT, WIN_SPECIFY, WIN_MULTREAD,
WIN_MULTWRITE, WIN_SETMULT, WIN_READDMA, WIN_READDMA_ONCE,
WIN_WRITEDMA, WIN_WRITEDMA_ONCE, WIN_FLUSH_CACHE_EXT.  Restrict them
to IDE_HD and IDE_CFATA.

Same for CFA_WRITE_SECT_WO_ERASE, CFA_WRITE_MULTI_WO_ERASE.  Restrict
them to IDE_CFATA, like the other CFA_ commands.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Use a table to declare which drive kinds accept each command
Markus Armbruster [Tue, 6 Sep 2011 16:58:35 +0000 (18:58 +0200)]
ide: Use a table to declare which drive kinds accept each command

No functional change.

It would be nice to have handler functions in the table, like commit
e1a064f9 did for ATAPI.  Left for another day.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Fix ATA command READ to set ATAPI signature for CD-ROM
Markus Armbruster [Tue, 6 Sep 2011 16:58:34 +0000 (18:58 +0200)]
ide: Fix ATA command READ to set ATAPI signature for CD-ROM

Must set the ATAPI device signature, see ATA4 8.27.5.2 Outputs for
PACKET Command feature set devices, and ACS-2 7.36.6 Outputs for
PACKET feature set devices.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: removed unused depends_on field
Frediano Ziglio [Wed, 7 Sep 2011 14:19:17 +0000 (16:19 +0200)]
qcow2: removed unused depends_on field

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoGdbstub: Fix back-trace on SPARC32
Fabien Chouteau [Thu, 8 Sep 2011 10:48:16 +0000 (12:48 +0200)]
Gdbstub: Fix back-trace on SPARC32

Gdb expects all registers windows to be flushed in ram, which is not the case
in Qemu. Therefore the back-trace generation doesn't work. This patch adds a
function to handle reads (and only read) in stack frames as if windows were
flushed.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add regression testsuite
Max Filippov [Mon, 5 Sep 2011 23:55:57 +0000 (03:55 +0400)]
target-xtensa: add regression testsuite

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMAINTAINERS: add xtensa maintainer
Max Filippov [Mon, 5 Sep 2011 23:55:56 +0000 (03:55 +0400)]
MAINTAINERS: add xtensa maintainer

Add myself as target-xtensa and DC232B maintainer.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add dc232b core and board
Max Filippov [Mon, 5 Sep 2011 23:55:55 +0000 (03:55 +0400)]
target-xtensa: add dc232b core and board

This is Diamond 232L Standard Core Rev.B (LE).

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement boolean option
Max Filippov [Mon, 5 Sep 2011 23:55:54 +0000 (03:55 +0400)]
target-xtensa: implement boolean option

See ISA, 4.3.9

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement memory protection options
Max Filippov [Mon, 5 Sep 2011 23:55:53 +0000 (03:55 +0400)]
target-xtensa: implement memory protection options

- TLB opcode group;
- region protection option (ISA, 4.6.3);
- region translation option (ISA, 4.6.4);
- MMU option (ISA, 4.6.5).

Cache control attribute bits are not used by this implementation.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add gdb support
Max Filippov [Mon, 5 Sep 2011 23:55:52 +0000 (03:55 +0400)]
target-xtensa: add gdb support

Specific xtensa processor overlay for GDB contains register map in
the gdb/xtensa-config.c. This description is used by the GDB to e.g.
parse 'g' response packets and it may be reused in the qemu's gdbstub
(only XTREG definitions for non-pseudoregisters are needed).

Currently mainline GDB does not support operations with privileged SRs
(see http://sourceware.org/ml/gdb/2011-07/msg00075.html). This support
may be enabled, see NUM_CORE_REGS comment in the gdbstub.c

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement relocatable vectors
Max Filippov [Mon, 5 Sep 2011 23:55:51 +0000 (03:55 +0400)]
target-xtensa: implement relocatable vectors

See ISA, 4.4.3 for details.

Vector addresses recorded in core configuration are absolute values that
correspond to default VECBASE value.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement CPENABLE and PRID SRs
Max Filippov [Mon, 5 Sep 2011 23:55:50 +0000 (03:55 +0400)]
target-xtensa: implement CPENABLE and PRID SRs

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement accurate window check
Max Filippov [Mon, 5 Sep 2011 23:55:49 +0000 (03:55 +0400)]
target-xtensa: implement accurate window check

See ISA, 4.7.1.3 for details.

Window check is inserted before commands that push "used register
watermark" beyond its current level. Used register watermark is reset on
instructions that change WINDOW_BASE/WINDOW_START SRs.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement interrupt option
Max Filippov [Mon, 5 Sep 2011 23:55:48 +0000 (03:55 +0400)]
target-xtensa: implement interrupt option

See ISA, 4.4.6 (interrupt option), 4.4.7 (high priority interrupt
option) and 4.4.8 (timer interrupt option) for details.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement SIMCALL
Max Filippov [Mon, 5 Sep 2011 23:55:47 +0000 (03:55 +0400)]
target-xtensa: implement SIMCALL

Tensilica iss provides support for applications running in freestanding
environment through SIMCALL command. It is used by Tensilica libc to
access argc/argv, for file I/O, etc.

Note that simcalls that accept buffer addresses expect virtual addresses.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement unaligned exception option
Max Filippov [Mon, 5 Sep 2011 23:55:46 +0000 (03:55 +0400)]
target-xtensa: implement unaligned exception option

See ISA, 4.4.4 for details.

Correct (aligned as per ISA) address for unaligned access is generated
in case this option is not enabled.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement extended L32R
Max Filippov [Mon, 5 Sep 2011 23:55:45 +0000 (03:55 +0400)]
target-xtensa: implement extended L32R

See ISA, 4.3.3 for details.

TB flag XTENSA_TBFLAG_LITBASE is used to track enable bit of LITBASE SR.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement loop option
Max Filippov [Mon, 5 Sep 2011 23:55:44 +0000 (03:55 +0400)]
target-xtensa: implement loop option

See ISA, 4.3.2 for details.

Operations that change LEND SR value invalidate TBs at the old and at
the new LEND. LEND value at TB compilation time is considered constant
and loop instruction is generated based on this value.

Invalidation may be avoided for the TB at the old LEND address, since
looping code verifies actual LEND value.

Invalidation may be avoided for the TB at the new LEND address if
there's a way to associate LEND address with TB at compilation time and
later verify that it doesn't change.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement windowed registers
Max Filippov [Mon, 5 Sep 2011 23:55:43 +0000 (03:55 +0400)]
target-xtensa: implement windowed registers

See ISA, 4.7.1 for details.

Physical registers and currently visible window are separate fields in
CPUEnv. Only current window is accessible to TCG. On operations that
change window base helpers copy current window to and from physical
registers.

Window overflow check described in 4.7.1.3 is in separate patch.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement RST2 group (32 bit mul/div/rem)
Max Filippov [Mon, 5 Sep 2011 23:55:42 +0000 (03:55 +0400)]
target-xtensa: implement RST2 group (32 bit mul/div/rem)

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement exceptions
Max Filippov [Mon, 5 Sep 2011 23:55:41 +0000 (03:55 +0400)]
target-xtensa: implement exceptions

- mark privileged opcodes with ring check;
- make debug exception on exception handler entry.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add PS register and access control
Max Filippov [Mon, 5 Sep 2011 23:55:40 +0000 (03:55 +0400)]
target-xtensa: add PS register and access control

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement CACHE group
Max Filippov [Mon, 5 Sep 2011 23:55:39 +0000 (03:55 +0400)]
target-xtensa: implement CACHE group

All operations in this group are no-ops, because cache ought to be
transparent to applications. However cache may be abused, then we'll
need to actually implement these opcodes.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement SYNC group
Max Filippov [Mon, 5 Sep 2011 23:55:38 +0000 (03:55 +0400)]
target-xtensa: implement SYNC group

All operations in this group are no-ops, because there are no delayed
side effects.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: mark reserved and TBD opcodes
Max Filippov [Mon, 5 Sep 2011 23:55:37 +0000 (03:55 +0400)]
target-xtensa: mark reserved and TBD opcodes

Reserved opcodes must generate illegal instruction exception. Usually
they signal emulation quality problems.
Not implemented opcodes are good to see.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement LSAI group
Max Filippov [Mon, 5 Sep 2011 23:55:36 +0000 (03:55 +0400)]
target-xtensa: implement LSAI group

- base + offset load/store operations for 1/2/4 byte values;
- cache operations (not implemented);
- multiprocessor synchronization operations.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement shifts (ST1 and RST1 groups)
Max Filippov [Mon, 5 Sep 2011 23:55:35 +0000 (03:55 +0400)]
target-xtensa: implement shifts (ST1 and RST1 groups)

- ST1: SAR (shift amount special register) manipulation, NSA(U);
- RST1: shifts, 16-bit multiplication.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement RST3 group
Max Filippov [Mon, 5 Sep 2011 23:55:34 +0000 (03:55 +0400)]
target-xtensa: implement RST3 group

- access to Special Registers (wsr, rsr);
- access to User Registers (wur, rur);
- misc. operations option (value clamp, sign extension, min, max);
- conditional moves.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add special and user registers
Max Filippov [Mon, 5 Sep 2011 23:55:33 +0000 (03:55 +0400)]
target-xtensa: add special and user registers

Special Registers hold the majority of the state added to the processor
by the options. See ISA, 5.3 for details.

User Registers hold state added in support of designer's TIE and in some
cases of options that Tensilica provides. See ISA, 5.4 for details.

Only registers mapped in sregnames or uregnames are considered valid.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement JX/RET0/CALLX
Max Filippov [Mon, 5 Sep 2011 23:55:32 +0000 (03:55 +0400)]
target-xtensa: implement JX/RET0/CALLX

Group SNM0 (indirect jumps and calls).

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement conditional jumps
Max Filippov [Mon, 5 Sep 2011 23:55:31 +0000 (03:55 +0400)]
target-xtensa: implement conditional jumps

- BZ (comparison to zero);
- BI0 (comparison to signed immediate);
- BI1 (comparison to unsigned immediate);
- B (two registers comparison, bit sets comparison);
- BEQZ.N/BNEZ.N (narrow comparison to zero).

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add sample board
Max Filippov [Mon, 5 Sep 2011 23:55:30 +0000 (03:55 +0400)]
target-xtensa: add sample board

Sample board and sample CPU core are used for debug and may be used for
development of custom SoC emulators.

This board has two fixed size memory regions for DTCM and ITCM and
variable length SRAM region.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement RT0 group
Max Filippov [Mon, 5 Sep 2011 23:55:29 +0000 (03:55 +0400)]
target-xtensa: implement RT0 group

NEG and ABS are the only members of RT0 group.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement narrow instructions
Max Filippov [Mon, 5 Sep 2011 23:55:28 +0000 (03:55 +0400)]
target-xtensa: implement narrow instructions

Instructions with op0 >= 8 are 2 bytes long, others are 3 bytes long.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: implement disas_xtensa_insn
Max Filippov [Mon, 5 Sep 2011 23:55:27 +0000 (03:55 +0400)]
target-xtensa: implement disas_xtensa_insn

Set up disas_xtensa_insn switch structure, mark required options on high
level groups. Implement arithmetic/bit logic/jump/call0.

Implement code generation loop with single step/breakpoint checking.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add target to the configure script
Max Filippov [Mon, 5 Sep 2011 23:55:26 +0000 (03:55 +0400)]
target-xtensa: add target to the configure script

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-xtensa: add target stubs
Max Filippov [Mon, 5 Sep 2011 23:55:25 +0000 (03:55 +0400)]
target-xtensa: add target stubs

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agomipsnet: use trace framework
Hervé Poussineau [Sun, 4 Sep 2011 20:29:27 +0000 (22:29 +0200)]
mipsnet: use trace framework

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agomipsnet: convert to qdev
Hervé Poussineau [Sun, 4 Sep 2011 20:29:26 +0000 (22:29 +0200)]
mipsnet: convert to qdev

Move mipsnet_init() function to mipssim machine

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoPCI: delete unused mem_base and pci_to_cpu_addr
Blue Swirl [Sat, 3 Sep 2011 16:41:21 +0000 (16:41 +0000)]
PCI: delete unused mem_base and pci_to_cpu_addr

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoSparc64: remove useless variable
Blue Swirl [Sun, 4 Sep 2011 11:32:23 +0000 (11:32 +0000)]
Sparc64: remove useless variable

Remove a useless variable, spotted by clang analyzer:
/src/qemu/target-sparc/op_helper.c:3904:18: warning: unused variable 'tmp' [-Wunused-variable]
    target_ulong tmp = val;
The error message is actually incorrect since the variable is used.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agolsi53c895a: avoid a warning from clang analyzer
Blue Swirl [Sun, 4 Sep 2011 11:22:31 +0000 (11:22 +0000)]
lsi53c895a: avoid a warning from clang analyzer

Avoid this warning from clang analyzer by deleting the variable:
/src/qemu/hw/lsi53c895a.c:895:5: warning: Value stored to 'id' is never read
    id = (current_tag >> 8) & 0xf;

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agocpu-exec: remove unnecessary assignment
Blue Swirl [Sun, 4 Sep 2011 11:06:22 +0000 (11:06 +0000)]
cpu-exec: remove unnecessary assignment

Avoid this warning from clang analyzer:
/src/qemu/cpu-exec.c:97:5: warning: Value stored to 'phys_page2' is never read
    phys_page2 = -1;

Adjust the scope of the variable while at it.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agokvm: remove unnecessary assignments
Blue Swirl [Sun, 4 Sep 2011 11:03:52 +0000 (11:03 +0000)]
kvm: remove unnecessary assignments

Avoid these warnings from clang analyzer:
/src/qemu/target-i386/kvm.c:772:5: warning: Value stored to 'cwd' is never read
    cwd = swd = twd = 0;
/src/qemu/target-i386/kvm.c:772:11: warning: Although the value stored to 'swd' is used in the enclosing expression, the value is never actually read from 'swd'
    cwd = swd = twd = 0;

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agohid: fix misassignment
Blue Swirl [Sun, 4 Sep 2011 10:59:52 +0000 (10:59 +0000)]
hid: fix misassignment

The code does not have any effect as is, fix it.

Spotted by clang analyzer:
/src/qemu/hw/hid.c:99:13: warning: Value stored to 'x1' is never read
            x1 = 1;

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoscsi-bus: remove duplicate table entries
Blue Swirl [Sun, 4 Sep 2011 10:56:51 +0000 (10:56 +0000)]
scsi-bus: remove duplicate table entries

Remove duplicate entries from SCSI command table, spotted by
clang analyzer:
/src/qemu/hw/scsi-bus.c:979:40: warning: initializer overrides prior initialization of this subobject
        [ ERASE_16                 ] = "ERASE_16",
/src/qemu/hw/scsi-bus.c:978:40: note: previous initialization is here
        [ WRITE_SAME_16            ] = "WRITE_SAME_16",
/src/qemu/hw/scsi-bus.c:984:40: warning: initializer overrides prior initialization of this subobject
        [ MAINTENANCE_IN           ] = "MAINTENANCE_IN",
/src/qemu/hw/scsi-bus.c:917:40: note: previous initialization is here
        [ MAINTENANCE_IN           ] = "MAINTENANCE_IN",
/src/qemu/hw/scsi-bus.c:985:40: warning: initializer overrides prior initialization of this subobject
        [ MAINTENANCE_OUT          ] = "MAINTENANCE_OUT",
/src/qemu/hw/scsi-bus.c:918:40: note: previous initialization is here
        [ MAINTENANCE_OUT          ] = "MAINTENANCE_OUT",

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqemu-io: remove unnecessary assignment
Blue Swirl [Sun, 4 Sep 2011 10:38:01 +0000 (10:38 +0000)]
qemu-io: remove unnecessary assignment

Remove an unnecessary assignment, spotted by clang analyzer:
/src/qemu/qemu-io.c:995:9: warning: Value stored to 'offset' is never read
        offset += reqs[i].qiov->size;

Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agowin32: improve version.o dependency
Blue Swirl [Sun, 4 Sep 2011 09:32:55 +0000 (09:32 +0000)]
win32: improve version.o dependency

Actually, version.rc doesn't need config-host.mak but config-host.h, fix it.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agog364fb: compile in hwlib
Blue Swirl [Sun, 4 Sep 2011 20:51:28 +0000 (20:51 +0000)]
g364fb: compile in hwlib

Compile g364fb in hwlib. Two compilations less for the full build.

Acked-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge remote-tracking branch 'sstabellini/xen-next' into staging
Anthony Liguori [Fri, 9 Sep 2011 18:13:27 +0000 (13:13 -0500)]
Merge remote-tracking branch 'sstabellini/xen-next' into staging

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Fri, 9 Sep 2011 18:09:57 +0000 (13:09 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

12 years agobuild: fix missing trace dep on GENERATED_HEADERS
Michael Roth [Wed, 7 Sep 2011 23:40:51 +0000 (18:40 -0500)]
build: fix missing trace dep on GENERATED_HEADERS

fc764105 added an include for qemu-common.h to trace/control.h, which
made all users of this header file dependent on GENERATED_HEADERS. Since
it's used by pretty much all the trace backends now, make trace-obj-y
dependent on GENERATED_HEADERS.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovns/tls: don't use depricated gnutls functions
Gerd Hoffmann [Wed, 7 Sep 2011 15:52:10 +0000 (17:52 +0200)]
vns/tls: don't use depricated gnutls functions

Avoid using deprecated gnutls functions with recent gnutls versions.
Fixes build failure on Fedora 16.  Keep the old way for compatibility
with old installations such as RHEL-5 (gnutls 1.4.x).

Based on a patch from Raghavendra D Prabhu <raghu.prabhu13@gmail.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoUse hex instead of binary.
Gerd Hoffmann [Wed, 7 Sep 2011 13:02:16 +0000 (15:02 +0200)]
Use hex instead of binary.

Older gcc versions don't understand 0b<bits>,
use hex representation instead.

Fixes build failure on RHEL-5.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoDon't use g_thread_get_initialized.
Gerd Hoffmann [Wed, 7 Sep 2011 13:02:15 +0000 (15:02 +0200)]
Don't use g_thread_get_initialized.

Initialize glib threads unconditionally in main() instead
of using g_thread_get_initialized in the 9p code.

Fixes a build failure on RHEL-5, which ships glib 2.12.
g_thread_get_initialized was added in 2.20.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu_vmalloc: align properly for transparent hugepages and KVM
Avi Kivity [Mon, 5 Sep 2011 08:07:05 +0000 (11:07 +0300)]
qemu_vmalloc: align properly for transparent hugepages and KVM

To make good use of transparent hugepages, KVM requires that guest-physical
and host-virtual addresses share the low 21 bits (as opposed to just the low
12 bits normally required).

Adjust qemu_vmalloc() to honor that requirement.  Ignore it for small regions
to avoid fragmentation.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agocurses: fix garbling when chtype != long
Devin J. Pohly [Wed, 7 Sep 2011 19:44:36 +0000 (15:44 -0400)]
curses: fix garbling when chtype != long

Qemu currently assumes that chtype is typedef'd to unsigned long, but
this is not necessarily the case (ncurses, for instance, can configure
this at build-time).  This patch uses the predefined chtype if qemu is
configured for curses support and falls back to unsigned long otherwise.

Fixes bug 568614.

Signed-off-by: Devin J. Pohly <djpohly+launchpad@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovirtio-balloon: Disassociate from the balloon handlers on unplug
Amit Shah [Fri, 9 Sep 2011 09:00:40 +0000 (14:30 +0530)]
virtio-balloon: Disassociate from the balloon handlers on unplug

Adding a 2nd balloon device after unplugging the first one doesn't work.
Also, the 'info balloon' command should indicate an error mentioning no
balloon device is registered after unplug.

Reproduction steps given by Shaolong Hu:

(qemu) info balloon
Device 'balloon' has not been activated by the guest
(qemu) device_add virtio-balloon-pci,id=balloon1
(qemu) info balloon
balloon: actual=4096
(qemu) balloon 2048
(qemu) info balloon
balloon: actual=2048
(qemu) device_del balloon1
(qemu) info balloon
balloon: actual=4096
(qemu) balloon 2048
(qemu) info balloon
balloon: actual=4096
(qemu) device_del balloon1
Device 'balloon1' not found
(qemu) device_add virtio-balloon-pci,id=balloon1
Another balloon device already registered
Device 'virtio-balloon-pci' could not be initialized
(qemu) device_add virtio-balloon-pci,id=balloon2
Another balloon device already registered
Device 'virtio-balloon-pci' could not be initialized

Reported-by: Shaolong Hu <shu@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoballoon: Disassociate handlers from balloon device on unplug
Amit Shah [Fri, 9 Sep 2011 09:00:39 +0000 (14:30 +0530)]
balloon: Disassociate handlers from balloon device on unplug

When a balloon device gets unplugged, allow the balloon handlers to be
freed.

Reported-by: Shaolong Hu <shu@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agotcg/ppc64: Fix zero extension code generation bug for ppc64 host
Thomas Huth [Fri, 9 Sep 2011 05:58:37 +0000 (15:58 +1000)]
tcg/ppc64: Fix zero extension code generation bug for ppc64 host

The ppc64 code generation backend uses an rldicr (Rotate Left Double
Immediate and Clear Right) instruction to implement zero extension of
a 32 bit quantity to a 64 bit quantity (INDEX_op_ext32u_i64).  However
this is wrong - this instruction clears specified low bits of the
value, instead of high bits as we require for a zero extension.  It
should instead use an rldicl (Rotate Left Double Immediate and Clear
Left) instruction.

Presumably amongst other things, this causes the SLOF firmware image
used with -M pseries to not boot on a ppc64 host.

It appears this bug was exposed by commit
0bf1dbdcc935dfc220a93cd990e947e90706aec6 (tcg/ppc64: fix 16/32 mixup)
which enabled the use of the op_ext32u_i64 operation on the ppc64
backend.

Signed-off-by: Thomas Huth <thuth@de.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoxen-mapcache: Fix rlimit set size.
Anthony PERARD [Fri, 9 Sep 2011 12:50:18 +0000 (12:50 +0000)]
xen-mapcache: Fix rlimit set size.

Previously, the address space soft limit was set mcache_max_size. So,
before the mcache_max_size was reached by the mapcache, QEMU was killed
for overuse of the virtual address space.

This patch fix that by setting the soft limit the maximum than can have
QEMU. So the soft and hard limit are always set to RLIM_INFINITY if QEMU
is privileged.

In case QEMU is not run as root and the limit is too low, the maximum
mapcache size will be set the rlim_max - 80MB because observed that QEMU
use 75MB more than the maximum mapcache size after several empirical
tests.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen: use uint64_t instead of target_ulong in cpu_ioreq_move
Stefano Stabellini [Fri, 20 May 2011 16:57:24 +0000 (16:57 +0000)]
xen: use uint64_t instead of target_ulong in cpu_ioreq_move

cpu_ioreq_move might move 8 bytes at a time so we must make sure that
the temporary variable can hold 8 bytes.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoMove the xenfb pointer handler to the connected method
John Haxby [Fri, 17 Jun 2011 12:16:00 +0000 (12:16 +0000)]
Move the xenfb pointer handler to the connected method

Ensure that we read "request-abs-pointer" after the frontend has written
it.  This means that we will correctly set up an ansolute or relative
pointer handler correctly.

Signed-off-by: John Haxby <john.haxby@oracle.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoIntroduce a new 'connected' xendev op called when Connected.
John Haxby [Fri, 17 Jun 2011 12:15:35 +0000 (12:15 +0000)]
Introduce a new 'connected' xendev op called when Connected.

Rename the existing xendev 'connect' op to 'initialised' and introduce
a new 'connected' op.  This new op, if defined, is called when the
backend is connected.  Note that since there is no state transition this
may be called more than once.

Signed-off-by: John Haxby <john.haxby@oracle.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoFix include statements for qemu-common.h
Stefan Weil [Thu, 8 Sep 2011 15:55:32 +0000 (17:55 +0200)]
Fix include statements for qemu-common.h

* qemu-common.h is not a system include file, so it should be included
  with "" instead of <>. Otherwise incremental builds might fail
  because only local include files are checked for changes.

* linux-user/syscall.c included the file twice.

Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agovirtio-9p: Fix syntax error in debug code
Stefan Weil [Wed, 20 Jul 2011 06:27:28 +0000 (08:27 +0200)]
virtio-9p: Fix syntax error in debug code

This error was reported by cppcheck:

qemu/hw/9pfs/virtio-9p-debug.c:342:
error: Invalid number of character ({) when these macros are defined:
'DEBUG_DATA'.

Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoSPARC: Trivial patch to clean up npc monitor output
Nathan Kunkee [Fri, 9 Sep 2011 02:58:31 +0000 (21:58 -0500)]
SPARC: Trivial patch to clean up npc monitor output

This patch fixes the spacing of the PC output from 'info cpus' for
SPARC.

Signed-off-by: Nathan Kunkee <nkunkee42@hotmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconfigure: Avoid duplicate flags when calling compile_prog
Stefan Weil [Sun, 4 Sep 2011 16:30:02 +0000 (18:30 +0200)]
configure: Avoid duplicate flags when calling compile_prog

This patch removes redundant shell code and cleans it a little bit.

Shell macro compile_prog takes two arguments:
local_cflags and local ldflags.

$QEMU_CFLAGS is added automatically to the cflags, so there is no need
to pass it as an argument.

It is also unnecessary to pass -Werror twice.

$flag is a compiler warning option, so it should be in local_cflags
instead of local_ldflags.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqemu-options: Improve help texts for options which depend on configure
Stefan Weil [Mon, 5 Sep 2011 16:13:03 +0000 (18:13 +0200)]
qemu-options: Improve help texts for options which depend on configure

* Replace "available only" by the more common "only available".

* Tracing options depend on the configuration of the QEMU executable,
  so clarify the help text for both options.

Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agodocs: Fix qdev-device-use.txt typo in -chardev serial, path=COM<NUM>
Markus Armbruster [Tue, 6 Sep 2011 08:01:36 +0000 (10:01 +0200)]
docs: Fix qdev-device-use.txt typo in -chardev serial, path=COM<NUM>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconfigure: Remove relicts from --enable-io-thread
Stefan Weil [Sun, 4 Sep 2011 13:29:32 +0000 (15:29 +0200)]
configure: Remove relicts from --enable-io-thread

Commit 12d4536f7d911b6d87a766ad7300482ea663cea2 removed
configure option --enable-io-thread.

Remove help message which is now no longer valid.

Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoFix comment (install patch -> install path)
Stefan Weil [Sun, 4 Sep 2011 13:17:46 +0000 (15:17 +0200)]
Fix comment (install patch -> install path)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoMerge remote-tracking branch 'origin/master' into staging
Anthony Liguori [Thu, 8 Sep 2011 14:25:36 +0000 (09:25 -0500)]
Merge remote-tracking branch 'origin/master' into staging

12 years agotarget-i386: Compute all flag data inside %cl != 0 test.
Richard Henderson [Thu, 8 Sep 2011 08:23:11 +0000 (09:23 +0100)]
target-i386: Compute all flag data inside %cl != 0 test.

The (x << (cl - 1)) quantity is only used if CL != 0.  Move the
computation of that quantity nearer its use.

This avoids the creation of undefined TCG operations when the
constant propagation optimization proves that CL == 0, and thus
CL-1 is outside the range [0-wordsize).

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoMerge remote-tracking branch 'spice/spice.v42' into staging
Anthony Liguori [Thu, 8 Sep 2011 14:07:57 +0000 (09:07 -0500)]
Merge remote-tracking branch 'spice/spice.v42' into staging

12 years agoMerge remote-tracking branch 'qmp/queue/qmp' into staging
Anthony Liguori [Thu, 8 Sep 2011 14:07:13 +0000 (09:07 -0500)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging

12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Thu, 8 Sep 2011 14:05:14 +0000 (09:05 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

12 years agoMerge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging
Anthony Liguori [Thu, 8 Sep 2011 14:03:57 +0000 (09:03 -0500)]
Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Thu, 8 Sep 2011 13:59:32 +0000 (08:59 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

12 years agoMerge remote-tracking branch 'kraxel/usb.26' into staging
Anthony Liguori [Thu, 8 Sep 2011 13:57:33 +0000 (08:57 -0500)]
Merge remote-tracking branch 'kraxel/usb.26' into staging

12 years agoMerge remote-tracking branch 'aneesh/for-upstream-3' into staging
Anthony Liguori [Thu, 8 Sep 2011 13:52:59 +0000 (08:52 -0500)]
Merge remote-tracking branch 'aneesh/for-upstream-3' into staging

12 years agoiohandlers: fix issue with qemu_set_fd_handler()
Anthony Liguori [Wed, 7 Sep 2011 18:44:45 +0000 (13:44 -0500)]
iohandlers: fix issue with qemu_set_fd_handler()

As spotted by Aneesh, some users pass a NULL opaque so we need to be more
aggressive in checking whether a user means to unregister.

Also fix a double free caused by tag not being reset to zero after delete.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agousb-musb: Add reset function
Juha Riihimäki [Wed, 31 Aug 2011 20:49:41 +0000 (21:49 +0100)]
usb-musb: Add reset function

Add a separate reset function musb_reset() to the usb-musb interface,
so that users who implement a reset function can also reset usb-musb.
Use this in tusb6010.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-musb: Take a DeviceState* in init function
Peter Maydell [Wed, 31 Aug 2011 20:49:40 +0000 (21:49 +0100)]
usb-musb: Take a DeviceState* in init function

Initialise usb-musb by passing it a DeviceState* and the offset of the
IRQs in its gpio array, rather than a plain pointer to an irq array.
This is simpler for callers and also allows us to pass in a valid parent
to usb_bus_new(), so the USB bus actually appears in the qdev tree.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: Remove leading underscores from __musb_irq_max
Peter Maydell [Wed, 31 Aug 2011 20:49:39 +0000 (21:49 +0100)]
usb: Remove leading underscores from __musb_irq_max

Identifiers with double leading underscore are reserved, so rename
__musb_irq_max so we don't encroach on reserved namespace.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: tag as unmigratable
Gerd Hoffmann [Wed, 31 Aug 2011 09:44:24 +0000 (11:44 +0200)]
usb-host: tag as unmigratable

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: claim port at device initialization time.
Gerd Hoffmann [Thu, 1 Sep 2011 11:56:37 +0000 (13:56 +0200)]
usb: claim port at device initialization time.

This patch makes qemu assign a port when creating the device, not when
attaching it.  For most usb devices this isn't a noticable difference
because they are in attached state all the time.

The change affects usb-host devices which live in detached state while
the real device is unplugged from the host.  They have a fixed port
assigned all the time now instead of getting grabbing one on attach and
releasing it at detach, i.e. they stop floating around at the usb bus.

The change also allows to simplify usb-hub.  It doesn't need the
handle_attach() callback any more to configure the downstream ports.
This can be done at device initialitation time now.  The changed
initialization order (first grab upstream port, then register downstream
ports) also fixes some icky corner cases.  For example it is not possible
any more to plug the hub into one of its own downstream ports.

The usb host adapters must care too.  USBPort->dev being non-NULL
doesn't imply any more the device is in attached state.  The host
adapters must additionally check the USBPort->dev->attached flag.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ccid: remote wakeup support
Gerd Hoffmann [Tue, 30 Aug 2011 10:15:53 +0000 (12:15 +0200)]
usb-ccid: remote wakeup support

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ccid: switch to USBDesc*
Gerd Hoffmann [Tue, 30 Aug 2011 09:49:05 +0000 (11:49 +0200)]
usb-ccid: switch to USBDesc*

Switch the smard card emulation to use the USBDesc*
structs for the usb descriptors.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: fix use after free
Gerd Hoffmann [Thu, 25 Aug 2011 14:43:15 +0000 (16:43 +0200)]
usb: fix use after free

The ->complete() callback might have released the USBPacket (uhci
actually does), so we must not touch it after the callback returns.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: parse port in /proc/bus/usb/devices scan
Gerd Hoffmann [Wed, 17 Aug 2011 21:36:46 +0000 (23:36 +0200)]
usb-host: parse port in /proc/bus/usb/devices scan

Unfortunaly this is limited to root ports.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: constify port
Gerd Hoffmann [Wed, 17 Aug 2011 21:35:45 +0000 (23:35 +0200)]
usb-host: constify port

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: handle siTDs
Gerd Hoffmann [Fri, 26 Aug 2011 12:13:48 +0000 (14:13 +0200)]
usb-ehci: handle siTDs

This patch adds code to do minimal siTD handling, which is basically
just following the next pointer.  This is good enougth to handle the
inactive siTDs used by FreeBSD.  Active siTDs are skipped too as we
don't have split transfer support in qemu, additionally a warning is
printed.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: endpoint table fixup
Gerd Hoffmann [Fri, 26 Aug 2011 14:27:41 +0000 (16:27 +0200)]
usb-host: endpoint table fixup

USB Devices can have up to 15 IN and 15 OUT endpoints, not 15 endpoints
total.  Move from one array to two arrays (one IN, one OUT) to maintain
the endpoint state.

12 years agousb-host: claim port
Gerd Hoffmann [Wed, 24 Aug 2011 11:34:17 +0000 (13:34 +0200)]
usb-host: claim port

When configured to pass through a specific host port (using hostbus and
hostport properties), try to claim the port if supported by the kernel.
That will avoid any kernel drivers binding to devices plugged into that
port.  It will not stop any userspace apps (such as usb_modeswitch)
access the device via usbfs though.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: fix configuration tracking.
Gerd Hoffmann [Wed, 24 Aug 2011 12:45:07 +0000 (14:45 +0200)]
usb-host: fix configuration tracking.

It is perfectly fine to leave the usb device in unconfigured state
(USBHostDevice->configuration == 0).  Just do that and wait for the
guest to explicitly set a configuration.  This is closer to what real
hardware does and it also simplifies the device initialization.  There
is no need to figure how the device is configured on the host.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: limit open retries
Gerd Hoffmann [Wed, 24 Aug 2011 11:45:06 +0000 (13:45 +0200)]
usb-host: limit open retries

Limit the number of times qemu tries to open host devices to three.
Reset error counter when the device goes away, after un-plugging and
re-plugging the device qemu will try again three times.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: fix halted endpoints
Gerd Hoffmann [Wed, 24 Aug 2011 08:55:40 +0000 (10:55 +0200)]
usb-host: fix halted endpoints

Two fixes for the price of one ;)

First, reinitialize the endpoint table after device reset.
This is needed anyway as the reset might have switched interfaces.
It also clears the endpoint halted state.

Second the CLEAR_HALT ioctl wants a unsigned int passed in as
argument, not uint8_t.

This gets my usb sd card reader (sandisk micromate) going.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>