aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-11-22pcie/port: fix bridge control register wmaskIsaku Yamahata1-0/+8
pci generic layer initialized wmask for bridge control register according to pci spec. pcie deviates slightly from it, so initialize it properly. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22pci: fix bridge control bit wmaskMichael S. Tsirkin1-2/+24
Bits 12 to 15 in bridge control register are reserver and must be read-only zero, curent mask is 0xffff which makes them writeable. Fix this up by using symbolic bit names for writeable bits instead of a hardcoded constant. Fix a comment w1mask -> w1cmask as well. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22x3130/downstream: support aer.Isaku Yamahata1-10/+33
add aer support. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22x3130/upstream: support aerIsaku Yamahata1-9/+24
add aer support. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22ioh3420: support aerIsaku Yamahata1-10/+70
Add aer support. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22pcie_aer: complete unwinding recursionMichael S. Tsirkin1-53/+27
Open-code functions created in the previous patch, to make code more compact and clear. Detcted and documented what looks like a bug in code that becomes apparent from this refactoring. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22pcie_aer: get rid of recursionMichael S. Tsirkin1-17/+31
Added some TODOs: they are trivial but omitted here to make the patch logic as transparent as possible. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22pcie/aer: helper functions for pcie aer capabilityIsaku Yamahata5-1/+951
This patch implements helper functions for pcie aer capability which will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22pcie_regs.h: more constantsIsaku Yamahata1-0/+2
Add constants for PCI AER log. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22pci: add W1C bits to pci status registerIsaku Yamahata1-0/+16
This patch adds W1C bit support in the initialization/reset of pci status registers. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-16pci: allow hotplug removal of cold-plugged devicesMichael S. Tsirkin4-12/+32
This patch fixes hot unplug of cold plugged devices (those present at system start), which got broken by 5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 . Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Cam Macdonell <cam@cs.ualberta.ca> Tested-by: Cam Macdonell <cam@cs.ualberta.ca> Reported-by: Cam Macdonell <cam@cs.ualberta.ca>.
2010-11-16PCI: Bus number from the bridge, not the deviceAlex Williamson1-2/+1
pcibus_dev_print() was erroneously retrieving the device bus number from the secondary bus number offset of the device instead of the bridge above the device. This ends of landing in the 2nd byte of the 3rd BAR for devices, which thankfully is usually zero. Note: pcibus_get_dev_path() copied this code, inheriting the same bug. pcibus_get_dev_path() is used for ramblock naming, so changing it can effect migration. However, I've only seen this byte be non-zero for an assigned device, which can't migrate anyway, so hopefully we won't run into any issues. This patch does not touch pcibus_get_dev_path, as bus number is guest assigned for nested buses, so using it for migration is broken anyway. Fix it properly later. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-13e1000: Fix TCP checksum overflow with TSOAlex Williamson1-1/+4
When adding the length to the pseudo header, we're not properly accounting for overflow. From: Mark Wu <dwu@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-13tap: make set_offload a nop after netdev cleanupMichael S. Tsirkin1-1/+5
virtio-net expects set_offload to succeed after peer cleanup. Since we don't have an open fd anymore, make it so. Fixes warning about the failure of offload setting. Reported-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-04tap: clear vhost_net backend on cleanupMichael S. Tsirkin1-0/+1
Frontends calling tap_get_vhost_net get an invalid pointer after the peer backend has been deleted. Jason Wang <jasowang@redhat.com> reports this leading to a crash in ack_features when we remove the vhost-net bakend of a virtio nic. The fix is simply to clear the backend pointer. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-03Fold send_all() wrapper unix_write() into one functionJes Sorensen1-6/+2
The current send_all() wrapper for POSIX calls does nothing but call unix_write(). Merge them to simplify the code. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-03Remove obsolete 'f' double parameter typeJes Sorensen1-17/+1
'f' double is no longer used, and we should be using floating point variables to store byte sizes. Remove it. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-03Switch migrate_set_speed() to take an 'o' argument rather than a float.Jes Sorensen2-4/+5
Clarify default value of MB in migration speed argument in monitor, if no suffix is specified. This differ from previous default of bytes, but is consistent with the rest of the places where we accept a size argument. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-03Add support for 'o' octet (bytes) format as monitor parameter.Jes Sorensen1-0/+29
Octet format relies on strtosz which supports K/k, M/m, G/g, T/t suffixes and unit support for humans, like 1.3G Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-03Introduce strtosz() library function to convert a string to a byte count.Jes Sorensen3-20/+98
strtosz() returns -1 on error. It now supports human unit formats in eg. 1.0G, with better error handling. The following suffixes are supported: B/b = bytes K/k = KB M/m = MB G/g = GB T/t = TB This patch changes -numa and -m input to use strtosz(). Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-02intel-hda: documentation updateGerd Hoffmann2-0/+3
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-01Fix out of tree buildBlue Swirl1-1/+1
df2943ba3c73ca21dbda063f15fa3e80064af864 broke out of tree build. Fix breakage by adding $(SRC_PATH). Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-11-01Merge remote branch 'spice/config.2' into stagingAnthony Liguori3-7/+309
2010-11-01Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori30-291/+2637
2010-11-01hda-audio: Zap tabsmalc1-2/+2
Signed-off-by: malc <av1474@comtv.ru>
2010-11-01Add Intel HD Audio support to qemu.Gerd Hoffmann8-2/+2946
This patch adds three devices to qemu: intel-hda Intel HD Audio Controller, the PCI device. Provides a HDA bus. Emulates ICH6 at the moment. Adding a ICH9 PCIE variant shouldn't be hard. hda-duplex HDA Codec. Attaches to the HDA bus. Supports 16bit stereo, rates 16k -> 96k, playback, recording and volume control (with CONFIG_MIXEMU=y). hda-output HDA Codec without recording support. Subset of the hda-duplex codec. Use this if you don't want your guests access your mic. Usage: add '-device intel-hda -device hda-duplex' to your command line. Tested guests: * Linux works. * Win7 works. * DOS (mpxplay) works. * WinXP doesn't work. [ v2 changes ] * Fixed endianess, big endian hosts work now. * Fixed some emulation bugs. * Added immediate command emulation. * Added vmstate support. * Make it behave like all other sound card drivers: - can be configured via '--audio-card-list=hda' - can be added to a VM using '-soundhw hda' * Code style fixups. * Zapped guest-triggerable asserts. * Handle partial reads/writes of audio data correctly. Cc: malc <av1474@comtv.ru> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-01add VMSTATE_BOOLGerd Hoffmann2-0/+35
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-01Remove trailing whitespacemalc1-1/+1
Signed-off-by: malc <av1474@comtv.ru>
2010-10-31sparc32: convert debug printf statements to tracepointsBlue Swirl10-206/+213
Replace debug printf statements with tracepoints. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Remove unncessary includesJes Sorensen1-8/+0
No need to include stdlib.h for BSD as it is included by qemu-common.h, windows.h is handled by sysemu.h and osdep.c no longer needs malloc.h Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Consolidate oom_check() functionsJes Sorensen5-20/+11
This consolidates the duplicated oom_check() functions, as well as splitting them into OS dependant versions to avoid the #ifdef grossness that was present in the old osdep.c version. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Separate qemu_pidfile() into OS specific versionsJes Sorensen3-38/+45
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Do not redefine reserved key-words TRUE/FALSEJes Sorensen1-10/+10
TRUE/FALSE are generally reserved keywords and shouldn't be defined in a driver like this. Rename the macros to SDP_TRUE and SDP_FALSE respectively. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Move qemu_gettimeofday() to OS specific filesJes Sorensen10-47/+47
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30We only support eventfd under POSIX, move qemu_eventfd() to os-posix.cJes Sorensen2-34/+32
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30qemu_pipe() is used only by POSIX code, so move to oslib-posix.cJes Sorensen2-22/+22
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Move osdep socket code to oslib-{posix,win32}.cJes Sorensen3-38/+36
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Move QEMU OS dependant library functions to OS specific filesJes Sorensen5-89/+158
This moves library functions used by both QEMU and the QEMU tools, such as qemu-img, qemu-nbd etc. from osdep.c to oslib-{posix,win32}.c In addition it introduces oslib-obj.y to the Makefile set to be included by the various targets, instead of relying on these library functions magically getting included via block-obj-y. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30target-xxx: Use fprintf_function (format checking)Stefan Weil26-67/+54
fprintf_function uses format checking with GCC_FMT_ATTR. Format errors were fixed in * target-i386/helper.c * target-mips/translate.c * target-ppc/translate.c Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30exec: Use fprintf_function for dump_exec_info (format checking)Stefan Weil2-14/+5
fprintf_function uses format checking with GCC_FMT_ATTR. It is declared in qemu-common.h and used in cpu-all.h (which is included from cpu.h), so qemu-common.h must be included earlier. Some redundant include statements for standard include files were removed. Fix also two format errors (ptrdiff_t needs %td). Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30tcg: Use fprintf_function (format checking)Stefan Weil2-6/+3
fprintf_function uses format checking with GCC_FMT_ATTR. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Add fprintf_function for function pointers to fprintf-like functionsStefan Weil1-0/+3
This kind of function pointers is used very often in qemu. The new data type uses format checking with GCC_FMT_ATTR and will be used in later patches. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Mov muldiv64 to qemu-common.h (Thus unbreaking gus)malc3-25/+24
Signed-off-by: malc <av1474@comtv.ru>
2010-10-27Merge branch 'pci' into for_anthonyMichael S. Tsirkin26-277/+2607
2010-10-27pcie: update satus on resetMichael S. Tsirkin1-1/+1
Reset never triggers a new event, so it's enough to update status. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27msi: minor cleanupsMichael S. Tsirkin1-4/+3
Comment fixup (tell what it does not what it does not do), typo fix, whitespace fix. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27msi: simplify range checksMichael S. Tsirkin1-25/+20
config write handlers should be idempotent. So no need for complex range checks: a simple one checking that we are touching the relevant capability will do. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27pci: improve w1c mask handlingMichael S. Tsirkin1-2/+4
- save/restore must not check w1c bits since they are in fact guest controlled - clear w1c bits on reset Note: for express there are different kinds of reset, some leave part of config space alone. We will likely need a sticky bit mask to implement this. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27pcie: clean up hot plug notificationMichael S. Tsirkin4-71/+62
Simplify logic for hotplug notification, by tracking state of the logical interrupt condition. We then simply use this variable to make the interrupt decision, according to spec. API is made cleaner as we no longer force users to pass in old slot control value. Includes fixes by Isaku Yamahata. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2010-10-27pcie: simplify range checkMichael S. Tsirkin1-49/+59
Simplify code slighly by reversing the polarity for the range check Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>