irq: Introduce CPU_INTERRUPT_TGT_* defines.
These defines will be place-holders for cpu-specific functionality.Generic code will, at the end of the patch series, no longer have toconcern itself about how SMI, NMI, etc should be handled. Instead,generic code will know only that the interrupt is internal or external....
irq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.
This mask contains all of the bits that should be ignored while singlestepping in the debugger. The mask contains 2 bits that are not currentlycleared, but are also never set. The bits are included in the mask for...
target-mips: Do not check CPU_INTERRUPT_TIMER.
This bit is never set, therefore we should not read it either.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-sparc: Do not check CPU_INTERRUPT_TIMER.
irq: Remove CPU_INTERRUPT_TIMER.
It is no longer used anywhere.
target-arm: Privatize CPU_INTERRUPT_FIQ.
This interrupt name was only used by the ARM port.
target-i386: Privatize some i386-specific interrupt names.
SMI, VIRQ, INIT, SIPI, and MCE are all only used by the i386 port.
Merge remote-tracking branch 'mst/for_anthony' into staging
Merge remote-tracking branch 'kraxel/usb.7.pull' into staging
Merge remote branch 'origin/master' into pci
Conflicts: exec.c
CPUPhysMemoryClient: Pass guest physical address not region offset
When we're trying to get a newly registered phys memory client updatedwith the current page mappings, we end up passing the region offset(a ram_addr_t) as the start address rather than the actual guest...
CPUPhysMemoryClient: Fix typo in phys memory client registration
When we register a physical memory client, we try to walk the pagetables, calling the set_memory hook for every entry. Effectivelyplaying catchup for the client for everything already registered....
pci: Add class 0x403 as 'audio controller'
Used by HD audio controllers like our intel-hda.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
MSI: Robust resource release
msi_init may fail, so we need to check on uninit if the cap wasactually installed. This also avoids that the users need to check.
eepro100: Support byte/word writes to pointer register
pointer is a 32 bit register, but may be written using 8 or 16 bit writes.Add support for byte/word writes.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100: Support byte/word read/write access to MDI control register
MDI control is a 32 bit register, but may be read or written using8 or 16 bit access. Data is latched when the MSB is written.
Add support for byte/word read/write access.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
eepro100: Support byte read access to general control register
The general control register is a byte register.Add support for byte reads.
eepro100: Support 32 bit read/write access to flash register
eepro100: Fix endianness issues
Like other Intel devices, e100 (eepro100) uses little endian byte order.
This patch was tested with these combinations:
i386 host, i386 + mipsel guests (le-le)mipsel host, i386 guest (le-le)i386 host, mips + ppc guests (le-be)...
eepro100: Support byte/word writes to port address
port is a 32 bit register, but may be written using 8 or 16 bit writes.Add support for byte/word writes.
eepro100: Pad received short frames
QEMU sends frames smaller than 60 bytes to ethernet nics.Such frames are rejected by real NICs and their emulations.To avoid this behaviour, other NIC emulations pad receivedframes. This patch enables this workaround for eepro100, too....
eepro100: Remove unused structure element
cppcheck reports that 'packet' is unused.
It was only used to calculate the size of the preceding data.Removing it saves a lot of stack space (local variable rx).
eepro100: Remove type casts which are no longer needed
eepro100: Avoid duplicate debug messages
When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice.Now logging in eepro100_write1 and eepro100_write2 is similar to thelogging in eepro100_write4 (which already was correct).
usb: mass storage fix
Initialize scsi_len with zero when starting a new request, so anystuff leftover from the previous request is cleared out. This mayhappen in case the data returned by the scsi command doesn't fitinto the buffer provided by the guest....
uhci: switch to QTAILQ
uhci: keep uhci state pointer in async packet struct.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ohci: get ohci state via container_of()
musb: get musb state via container_of()
usb: move complete callback to port ops
usb: control buffer fixes
Windows allows control transfers to pass up to 4k of data, so raise ourcontrol buffer size to 4k. For control out transfers the usb core code copiesthe control request data to a buffer before calling the device's handle_control...
usb-linux: introduce a usb_linux_alt_setting function
The next patch in this series introduces multiple ways to get thealt setting dependent upon usb_fs_type, it is cleaner to put thisinto its own function.
Note that this patch also changes the assumed alt setting in case...
usb-linux: Get the alt. setting from sysfs rather then asking the dev
At least one device I have lies when receiving a USB_REQ_GET_INTERFACE,always returning 0 even if the alternate setting is different. This islikely caused because in practice this control message is never used as...
usb-linux: Add support for buffering iso usb packets
Currently we are submitting iso packets to the host one at a time, as wereceive them from the emulated host controller. This has 2 problems:1) If we were fast enough to submit every packet in time for the next host host...
usb-linux: Refuse packets for endpoints which are not in the usb descriptor
If an endpoint is not in the usb descriptor we've no idea what kind ofendpoint it is and thus how to handle it, refuse packages in this case.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb-linux: Refuse iso packets when max packet size is 0 (alt setting 0)
Refuse iso usb packets when then max packet size for the endpoint is 0,this avoids an abort in usb_host_alloc_iso() caused by trying to qemu_malloca 0 bytes large buffer.
usb-linux: We only need to keep track of 15 endpoints
Currently we reserve room for endpoint data for 16 endpoints, but giventhat we only use endpoint data for endpoints 1-15, and always index thearray with the endpoint-number - 1, 15 is enough.
usb-linux: Add support for buffering iso out usb packets
Extend the iso buffering code to also buffer iso out packets, thisfixes for example using usb speakers with usb redirection.
Make spice dummy functions inline to fix calls not checking return values
qemu_spice_set_passwd() and qemu_spice_set_pw_expire() dummy functionsneeds to be inline, in order to handle the case where they are calledwithout checking the return value.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
spice: don't create updates in spice server context.
This patch moves the creation of spice screen updates from the spiceserver context to qemu iothread context (display refresh timer to beexact). This way we avoid accessing qemu internals (display surface)...
spice: don't call displaystate callbacks from spice server context.
This patch moves the displaystate callback calls for setting the cursorand the mouse pointer from spice server to qemu (iothread) context.This allows us to simplify locking.
spice: drop obsolete iothread locking
We don't use qemu internals from spice server context any more.Thus we don't also need to grab the iothread mutex from spiceserver context. And we don't have to temporarely release thelock to avoid deadlocks. Drop all the calls....
qemu-img resize: Fix option parsing
For shrinking images, you're supposed to use a negative size. However, theleading minus makes getopt think that it's an option and so you get the helptext if you don't use -- like in 'qemu-img resize test.img -- -1G'....
atapi: Move comment to proper place
Move misplaced comment for media_is_dvd()
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
atapi: Explain why we need a 'media not present' state
After the re-org of the atapi code, it might not be intuitive for areader of the code to understand why we're inserting a 'media notpresent' state between cd changes.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
ide/atapi: fix set but unused
Signed-off-by: Alon Levy <alevy@redhat.com>Acked-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-progress.c: printf isn't signal safe
Change the signal handling to indicate a signal is pending, ratherthen printing directly from the signal handler.
In addition make the signal prints go to stderr, rather than stdout.
NBD: Avoid leaking a couple of strings when the NBD device is closed
Signed-off-by: Nick Thomas <nick@bytemark.co.uk>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
lm32: fix exception handling
Global interrupt enable bit is already saved within the exception handlerhelper routine. Thus remove extra code in translation routines.
Additionally, debug exceptions has always DEBA as base address.
Signed-off-by: Michael Walle <michael@walle.cc>...
milkymist-vgafb: fix console resizing
After enabling the framebuffer, ensure that the console is resized.
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
milkymist-sysctl: fix timers
Prevent timers from firing right after starting.
lm32: add Milkymist Minimac2 support
This patch adds support for Milkymist's minimal Ethernet MAC v2. Itsuperseds minimac1.
kvm: use qemu_free consistently
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
x86: Allow multiple cpu feature matches of lookup_feature
kvmclock is represented by two feature bits. Therefore, lookup_featureneeds to continue its search even after the first match. Enhance itaccordingly and switch to a bool return type at this chance....
kvm: add kvmclock to its second bit
We have two bits that can represent kvmclock in cpuid.They signal the guest which msr set to use. When we tweak flagsinvolving this value - specially when we use "-", we have to act on both.
Signed-off-by: Glauber Costa <glommer@redhat.com>...
kvm: create kvmclock when one of the flags are present
kvmclock presence can be signalled by two different flags. So fordevice creation, we have to test for both.
Signed-off-by: Glauber Costa <glommer@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
Break up user and system cpu_interrupt implementations
Both have only two lines in common, and we will convert the systemservice into a callback which is of no use for user mode operation.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>CC: Riku Voipio <riku.voipio@iki.fi>...
Redirect cpu_interrupt to callback handler
This allows to override the interrupt handling of QEMU in system mode.KVM will make use of it to set a specialized handler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm: Install specialized interrupt handler
KVM only requires to set the raised IRQ in CPUState and to kick thereceiving vcpu if it is remote. Installing a specialized handler allowspotential future changes to the TCG code path without risking KVM sideeffects....
fix crash in migration, 32-bit userspace on 64-bit host
This change fixes a long-standing immediate crash (memory corruptionand abort in glibc malloc code) in migration on 32bits.
The bug is present since this commit:
commit 692d9aca97b865b0f7903565274a52606910f129...
kvm: use kernel-provided para_features instead of statically coming up with new capabilities
Use the features provided by KVM_GET_SUPPORTED_CPUID directly tomask out features from guest-visible cpuid.
The old get_para_features() mechanism is kept for older kernels that do not implement it....
linux-user: Fix compilation for "old" linux versions
Debian Lenny and other installations with older linux versionsfailed to compile linux-user because some CLONE_xxx macros areundefined.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Fix buffer overrun in sched_getaffinity
Zeroing of the cpu array should start from &cpus[kernel_ret]not &cpus[num_zeros_to_fill].
This fixes a crash in EFL's edje_cc running under qemu-arm.
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
Don't zero out buffer in sched_getaffinity
The kernel doesn't fill the buffer provided to sched_getaffinitywith zero bytes, so neither should QEMU.
Merge branch 'patches' of git://qemu.weilnetz.de/git/qemu
virtfs: fix build due from rename
The latest virtfs pull broke the cris-softmmu target.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'amitshah/for-anthony' into staging
Merge remote-tracking branch 'jvrao/for-anthony' into staging
virtio-serial: Fix endianness bug in the config space
The virtio serial specification requres that the values in the configspace are encoded in native endian of the guest.
The qemu virtio-serial code did not do conversion to the guest endianformat what caused problems when host and guest use different format....
char: Detect chardev release by NULL handlers as well as NULL opaque
Juan says he prefers these extra checks to ensure a user of a chardev isreleasing it.
Requested-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
char: Allow devices to use a single multiplexed chardev.
This fixes regression caused by commit2d6c1ef40f3678ab47a4d14fb5dadaa486bfcda6("char: Prevent multiple devices opening same chardev"):
-nodefaults -nographic -chardev stdio,id=stdio,mux=on,signal=off \...
spice-chardev: listen to frontend guest open / close
Note the vmc_register_interface() in spice_chr_write is left in placein case someone uses spice-chardev with a frontend which does not haveguest open / close notification.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
virtio-console: notify backend of guest open / close
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Reviewed-by: Alon Levy <alevy@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
chardev: Allow frontends to notify backends of guest open / close
Some frontends know when the guest has opened the "channel" and is activelylistening to it, for example virtio-serial. This patch adds 2 new qemu-chardevfunctions which can be used by frontends to signal guest open / close, and...
target-arm: Don't update base register on abort in Thumb T1 LDM
Make sure the base register isn't updated if it is in the load listfor a Thumb LDM (T1 encoding) which aborts partway through the load.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
target-arm: fix LDMIA bug on page boundarytarget-arm: fix LDMIA bug on page boundary
When consecutive memory locations are on page boundary, a base register may beloaded before page fault occurs. After page fault handling, it losts the memorylocation information. To solve this problem, loading a base register has to put back....
ioapic: Do not set irr for masked edge IRQs
So far we set IRR for edge IRQs even if the pin is masked. If the guestlater on unmasks and switches the pin to level-triggered mode, irr willremain set, causing an IRQ storm. The point is that setting IRR is not...
vl.c: Replace -virtfs string manipulation with QemuOpts
The -virtfs option creates an fsdev representing the pass-through filesystem and a guest-visible virtio-9p-pci device that can access thisfile system. This patch replaces the string manipulation used to build...
v9fs_walk: As per 9p2000 RFC, MAXWELEM >= nwnames >= 0.
The nwnames field in TWALK message is assumed to be >=0 and <= MAXWELEMwhich is defined as macro P9_MAXWELEM (16) in virtio-9p.h as per 9p2000RFC. Appropriate changes are required in V9fsWalkState and v9fs_walk....
hw/virtio-9p-local.c: Remove unnecessary null char in symlink file
This patch removes the addition of null char in symlink filewhich is being appended to file in case of mapped security model.Without this patch, the extra null char causes LTP testcase lstat03...
virtio-9p: Bugfix to send correct iounit
LCREATE function packs address of iounit in the pdu, fix that to sendactual iounit itself.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
virtio-9p: removexattr on default acl should return 0
If we don't have default acl, removexattr on default aclshould return 0
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
virtio-9p: Print the pdu details on return
virtio-9p: move 9p files around
Now that we start adding more files related to 9pfsit make sense to move them to a separate directory
pflash: Restore & fix lazy ROMD switching
Commit 5145b3d1cc revealed a bug in the lazy ROMD switch-back logic, butresolved it by breaking that feature. This approach addresses the issueby switching back to ROMD after a certain amount of read accesseswithout further unlock sequences....
darwin-user: Remove unneeded null pointer check
cppcheck reports this error:
commpage.c:223: error: Possible null pointer dereference:value - otherwise it is redundant to check if value is null at line 214
The null pointer check in line 214 is indeed not needed....
Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
rtl8139: Fix compilation for w32/w64
Compilation for Windows needs a different declaration for theprintf format attribute, so use the macro which was defined forthis purpose.
Cc: Benjamin Poirier <benjamin.poirier@gmail.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
ide/atapi: Introduce CHECK_READY flag for commands
Some commands are supposed to report a Not Ready Condition (i.e. they requirea medium to be present in order to execute successfully). Instead ofduplicating the check in each command implementation, let's add a flag and...
qed: Fix consistency check on 32-bit hosts
The qed_bytes_to_clusters() function is normally used with size_tlengths. Consistency check used it with file size length and thereforefailed on 32-bit hosts when the image file is 4 GB or more.
Make qed_bytes_to_clusters() explicitly 64-bit and update consistency...
Add dd-style SIGUSR1 progress reporting
This introduces support for dd-style progress reporting on POSIXsystems, if the user hasn't specified -p to report progress. If sent aSIGUSR1, qemu-img will report current progress for commands thatsupport progress reporting....
Remove obsolete 'enabled' variable from progress state
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide/atapi: Factor commands out
In preparation for a table of function pointers, factor each command out fromide_atapi_cmd() into its own function.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide/atapi: Use table instead of switch for commands
ide/atapi: Replace bdrv_get_geometry calls by s->nb_sectors
The disk size can only change when the medium is changed, and the changecallback takes care of updating s->nb_sectors in this case.
ide: Split atapi.c out
Besides moving code, this patch only fixes some whitespace issues in the movedcode and makes all functions in atapi.c static which can be static.
atapi: Add 'medium ready' to 'medium not ready' transition on cd change
MMC-5 Table F.1 lists errors that can be thrown for the TEST_UNIT_READYcommand. Going from medium not ready to medium ready states iscommunicated by throwing an error.
This adds the missing 'tray opened' event that we fail to report to...
Improve accuracy of block migration bandwidth calculation
block_mig_state.total_time is currently the sum of the read requestlatencies. This is not very accurate because block migration uses aio andso several requests can be submitted at once. Bandwidth should be computed...
qemu-timer: Avoid type casts
The type casts are no longer needed after some small changesin struct qemu_alarm_timer. This also improves readabilityof the code.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
qemu-timer: Fix timers for w32
Commit 68c23e5520e8286d79d96ab47c0ea722ceb75041 removed themultimedia timer, but this timer is needed for certainLinux kernels. Otherwise Linux boot stops with this error:
MP-BIOS bug: 8254 timer not connected to IO-APIC...