Commit Graph

5456 Commits (22b626e28e9895cc65c1e2023323bda5138716dc)

Author SHA1 Message Date
Avi Kivity 82afb3a707 g364fb: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity 9eadff4a94 dummy_m68k: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity c8a50e596c pflash_cfi01/pflash_cfi02: convert to memory API
cfi02 is annoying in that is ignores some address bits; we probably
want explicit support in the memory API for that.

Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity c2c1b0f84b piix_pci: wrap memory update in a transaction
The code will remap all PAMs, even if just one is updated, resulting
in reduced performance.  Wrap in a transaction to detect that those
other PAMs have not changed.

Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity cf9182e229 cirrus: wrap memory update in a transaction
This prevents spurious unmapping and remapping of the vga windows,
which reduces performance.

Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity 20e5758b08 leon3: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity b3cc496255 integratorcp: convert to memory API (RAM/flash only)
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity 28e7796459 sysbus: add sysbus_add_memory_overlap()
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity 5461eb2111 axis_dev88: convert to memory API (RAM only)
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:12 +03:00
Avi Kivity 5b15f27516 ppc_oldworld, ppc_newworld: fix escc BAR related crash
ppc maps the escc mmio region both at a fixed offset (as a sysbus area) and as part of a PCI BAR.
This crashes, since a MemoryRegion may have only one parent.  Use an alias so we have a separate
MemoryRegion for the BAR.

Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:49:46 +03:00
Avi Kivity 89da90b1b4 gt64xxx: fix crash in gt64120_pci_mapping()
The map/unmap code was assymetric - unmap used the local MemoryRegion while
map used isa_mmio_init(), which cannot handle dynamic mappings.

Fix by using isa_mmio_setup() and the local MemoryRegion.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-24 21:11:21 +02:00
Avi Kivity fbe15adf8e armv7m: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-24 20:17:51 +03:00
Avi Kivity 4c390a1d32 an5206: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-24 20:17:47 +03:00
Avi Kivity d2c33733c8 pci_host: convert conf index and data ports to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-24 20:17:39 +03:00
Avi Kivity be35694da9 sysbus: add helpers to add and delete memory regions to the system bus
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-24 20:17:35 +03:00
Avi Kivity 58160bafa2 stellaris_enet: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-24 20:17:20 +03:00
Jan Kiszka c9abe11120 pci: Error on PCI capability collisions
Nothing good can happen when we overlap capabilities. This may happen
when plugging in assigned devices or when devices models contain bugs.
Detect the overlap and report it.

Based on qemu-kvm commit by Alex Williamson.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Don Dutile <ddutile@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-08-24 15:52:54 +03:00
Isaku Yamahata 74d63b6547 pcie/aer: fix inject aer error command
various fixes to make aer inject error command work.
- wrong assert
- command line parser
- err.status needs initialization

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-08-24 15:52:54 +03:00
Isaku Yamahata 1553d4f1fc pcie/slot: fix hotplug event
When slot status register is cleared, PCIDevice::exp.hpev_notify
needs to be cleared.
Otherwise, PCIDevice::exp.hpev_notify is never set to false resulting
in no more hot plug event once it's raised.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-08-24 15:52:54 +03:00
Peter Maydell 710ffe6048 hw/omap_gpmc: Don't try to map CS0 twice on reset
Remove a spurious second map of the OMAP GPMC CS0 region on reset.
This fixes an assertion failure when we try to add the region to
its container when it was already added. (The old code did not
complain about mismatched map/unmap calls, but the new MemoryRegion
implementation does.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-23 21:51:47 +02:00
Peter A. G. Crosthwaite b861b7419c xilinx: removed microbalze_pic_init from xilinx.h
This is a microblaze target specific function that belongs outside
of xilinx.h (which is a collection of target independent device model
instantiator functions)

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-22 23:29:37 +02:00
Peter A. G. Crosthwaite 0d877c66b6 xilinx.h: Added missing includes
Added some missing #includes for this file. Previously this file
relied on its clients to pre-include its dependencies.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-22 23:29:37 +02:00
Jan Kiszka 78dd9ff632 vga: Drop some unused fields
Memory region refactorings obsoleted them.

CC: Avi Kivity <avi@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 14:37:03 -05:00
Jan Kiszka 80763888bf vga: Use linear mapping + dirty logging in chain 4 memory access mode
Most VGA memory access modes require MMIO handling as they demand weird
logic to get a byte from or into the video RAM. However, there is one
exception: chain 4 mode with all memory planes enabled for writing. This
mode actually allows lineary mapping, which can then be combined with
dirty logging to accelerate KVM.

This patch accelerates specifically VBE accesses like they are used by
grub in graphical mode. Not only the standard VGA adapter benefits from
this, also vmware and spice in VGA mode.

CC: Gerd Hoffmann <kraxel@redhat.com>
CC: Avi Kivity <avi@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 14:37:03 -05:00
Jan Kiszka fe55ff6e61 vmware-vga: Eliminate vga_dirty_log_restart
After the conversion to the new Memory API, vga_dirty_log_restart became
seriously pointless. Remove it from vmware-vga and and then finally drop
the service.

CC: Andrzej Zaborowski <balrogg@gmail.com>
CC: Avi Kivity <avi@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 14:37:03 -05:00
Jan Kiszka 8d121d4960 vmware-vga: Remove dead DIRECT_VRAM mode
The code was disabled since day 1 of vmware-vga, and now it does not
even build anymore. Time for a cleanup.

CC: Andrzej Zaborowski <balrogg@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 14:37:03 -05:00
Jan Kiszka ca0508df2e vmware-vga: Disable verbose mode
Elimiates 'vmsvga_value_write: guest runs Linux.' messages from the
console.

CC: Andrzej Zaborowski <balrogg@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 14:37:03 -05:00
Jan Kiszka 8a9501bae2 vmware-vga: Register reset service
Fixes cold reset in vmware graphic modes. We need to split up the reset
function for this purpose, breaking out init-once bits.

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 14:37:03 -05:00
Jan Kiszka 0035e5094c ioapic: Implement polarity
If the polarity bit is set in the redirection table, the input level
simply has to inverted as it is low active in this case.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 14:37:03 -05:00
Jan Kiszka 1f6f408c8c target-i386: Remove unused polarity arguments from APIC API
Polarity of external interrupts needs to be handled in the IOAPIC.
Passing it to the APIC is pointless. So remove all these arguments.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 14:37:03 -05:00
Avi Kivity ae0a54664c 440fx: fix PAM, PCI holes
The current implementation of PAM and the PCI holes is broken in several
ways:

  - PCI BARs are not restricted to the PCI hole (a BAR may hide memory)
  - PCI devices do not respect PAM (if a PCI device maps a region while
    PAM maps the region to RAM, the request will be honored)

This patch fixes things by introducing a pci address space, and using
memory region aliases to represent PAM regions, SMRAM, and PCI holes.

The memory hierarchy looks something like

system_memory
 |
 +--- low memory alias (0-0xe0000000)
 |      |
 |      +-- ram@0
 |
 +--- high memory alias (0x100000000-EOM)
 |      |
 |      +-- ram@0xe0000000
 |
 +--- pci hole alias (end of low memory-0x100000000)
 |      |
 |      +-- pci@end-of-low-memory
 |
 |
 +--- pam[n] (0xc0000-0xc3fff etc) (when set to pci, priority 1)
 |      |
 |      +-- pci@0xc4000 etc
 |
 +--- smram (0xa0000-0xbffff) (when set to pci/vga, priority 1)
        |
        +-- pci@0xa0000 etc

ram (simple ram region)

pci
 |
 +--- BARn
 |
 +--- VGA 0xa0000-0xbffff
 |
 +--- ROMs

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:49 -05:00
Avi Kivity be20f9e902 vga: drop get_system_memory() from vga devices and derivatives
Instead, use the bus accessors, or get the address space directly
from the board constructor.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:49 -05:00
Avi Kivity f5e6fed879 pci: add pci_address_space()
Returns the PCI address space.  Useful for bridges that can obscure
part of the PCI address space.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:49 -05:00
Avi Kivity c839adec88 isa: add isa_address_space()
A helper that returns the address space used by ISA devices.  Useful
for getting rid of isa_mem_base, multiple ISA buses, or ISA buses behind
bridges.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:49 -05:00
Avi Kivity c5b3572fc6 sysbus: remove sysbus_init_mmio_cb()
This problem with this function is that it is not reversible - it is
impossible to know where things are registered and unregister them
exactly.  As there are no more users, we can remove it.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:48 -05:00
Avi Kivity cd0fa1e6d3 ppce500_pci: convert to sysbus_init_mmio_cb2()
Not a huge step forward, but at least we now have a 1:1 relationship
between registration and unregistration.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:48 -05:00
Avi Kivity 45de094eb8 versatile_pci: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:48 -05:00
Avi Kivity 1635bdfa78 arm11mpcore: use sysbus_init_mmio_cb2
This tells the sysbus code it need not use IO_MEM_UNASSIGNED.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:48 -05:00
Avi Kivity fb57117a19 sh_pci: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:48 -05:00
Avi Kivity d76120135b sysbus: add a variant of sysbus_init_mmio_cb with an unmap callback
sysbus_init_mmio_cb() uses the destructive IO_MEM_UNASSIGNED to remove a
region.  Provide an alternative that calls an unmap callback, so the removal
may be done non-destructively.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:47 -05:00
Avi Kivity b6dcbe086c ppc4xx_sdram: convert to memory API
Clumsy due to the lack of clipping support, needed for
changing exposed ram size.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:47:42 -05:00
Avi Kivity 9074e0e3e8 ppc405_uc: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:23:20 -05:00
Avi Kivity c76f990e8d pcie_host: convert to memory API
Assuming that mmcfg size cannot change at runtime.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:22:03 -05:00
Avi Kivity 689a1921ae onenand: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:22:03 -05:00
Avi Kivity 64066a8fb6 omap_gpmc/nseries/tusb6010: convert to memory API
Somewhat clumsy since it needs a variable sized region.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:21:57 -05:00
Avi Kivity d09871f69c tusb6010: move declarations to new file tusb6010.h
Avoid #include hell.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:40 -05:00
Avi Kivity fc2bf44972 gt64xxx.c: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:40 -05:00
Avi Kivity f69bf9d41c armv7m: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:40 -05:00
Avi Kivity e219dea2f3 arm_timer: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:40 -05:00
Avi Kivity 460d7c53cd arm_sysctl: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:39 -05:00
Avi Kivity 755c080225 arm_gic: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:10 -05:00
Avi Kivity 312b4234c6 apic: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:10 -05:00
Avi Kivity 3812ed0baa apb_pci: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:10 -05:00
Hervé Poussineau 145aebeca4 pcnet: fix wrong opaque (broken by bd8d6f7cad)
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:10 -05:00
Bjørn Mork d4044c2a6b e1000: use MII status register for link up/down
Some guests will use the standard MII status register
to verify link state.  They will not notice link changes
unless this register is updated.

Verified with Linux 3.0 and Windows XP guests.

Without this patch, ethtool will report speed and duplex as
unknown when the link is down, but still report the link as
up.  This is because the Linux e1000 driver checks the
mac_reg[STATUS] register link state before it checks speed
and duplex, but uses the phy_reg[PHY_STATUS] register for
the actual link state check.  Fix by updating both registers
on link state changes.

Linux guest before:

 (qemu) set_link e1000.0 off

 kvm-sid:~# ethtool eth0
 Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: umbg
        Wake-on: d
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

 (qemu) set_link e1000.0 on

Linux guest after:

 (qemu) set_link e1000.0 off
 [   63.384221] e1000: eth0 NIC Link is Down

 kvm-sid:~# ethtool eth0
 Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: umbg
        Wake-on: d
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: no

 (qemu) set_link e1000.0 on
 [   84.304582] e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:51 -05:00
Anthony Liguori 903396ad3e char: remove qemu_chr_send_event()
It's dead code.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:44 -05:00
Anthony Liguori 74c0d6f020 char: rename qemu_chr_get_msgfd() -> qemu_chr_fe_get_msgfd()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:44 -05:00
Anthony Liguori 70f24fb6c6 char: rename qemu_chr_close() -> qemu_chr_delete()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:43 -05:00
Anthony Liguori 27143a445b char: rename qemu_chr_open() -> qemu_chr_new()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:43 -05:00
Anthony Liguori 41084f1bad char: qemu_chr_ioctl() -> qemu_chr_fe_ioctl()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:37 -05:00
Anthony Liguori 2817822dce char: rename qemu_chr_guest_close() -> qemu_chr_fe_close()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:16 -05:00
Anthony Liguori c9d830eddc char: rename qemu_chr_guest_open() -> qemu_chr_fe_open()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:16 -05:00
Anthony Liguori 909cda12b5 char: rename qemu_chr_can_read() -> qemu_chr_be_can_read()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:16 -05:00
Anthony Liguori fa5efccb2a char: rename qemu_chr_read() -> qemu_chr_be_write()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:16 -05:00
Anthony Liguori e7e71b0ec6 char: rename qemu_chr_printf() -> qemu_chr_fe_printf()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:15 -05:00
Anthony Liguori 2cc6e0a142 char: rename qemu_chr_write() -> qemu_chr_fe_write()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:15 -05:00
Harsh Prateek Bora 5f524c1ebc use readdir_r instead of readdir for reentrancy
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:52 +05:30
Aneesh Kumar K.V d208a0e005 hw/9pfs: Update v9fs_read to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:50 +05:30
Aneesh Kumar K.V 7eafdcc96c hw/9pfs: Add yield support for preadv coroutine
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:47 +05:30
Aneesh Kumar K.V 8c158561a0 hw/9pfs: Update v9fs_attach to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:46 +05:30
Aneesh Kumar K.V b81d685e21 hw/9pfs: Update v9fs_wstat to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:42 +05:30
Aneesh Kumar K.V d7a9049119 hw/9pfs: Update v9fs_write to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:40 +05:30
Aneesh Kumar K.V f6b3c976c6 hw/9pfs: Add yield support for pwritev coroutine
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:37 +05:30
Venkateswararao Jujjuri (JV) ffd668764c hw/9pfs: Update v9fs_link to use coroutines
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:35 +05:30
Venkateswararao Jujjuri c6c069b0c5 hw/9pfs: Add yield support for link coroutine
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:33 +05:30
Venkateswararao Jujjuri 3fa2a8d1cd hw/9pfs: Update v9fs_symlink to use coroutines
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:29 +05:30
Venkateswararao Jujjuri 02ac7a34ff hw/9pfs: Add yield support for symlin coroutine
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:26 +05:30
Venkateswararao Jujjuri baaa86d9f5 hw/9pfs: Update v9fs_create to use coroutines
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:22 +05:30
Aneesh Kumar K.V 4e9ad44498 hw/9pfs: Update v9fs_fsync to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:21 +05:30
Aneesh Kumar K.V 4743d1f5d3 hw/9pfs: Add yield support for fsync coroutine
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:18 +05:30
Aneesh Kumar K.V c540ee5187 hw/9pfs: Update v9fs_clunk to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:16 +05:30
Aneesh Kumar K.V bed4352c4f hw/9pfs: Add yeild support for clunk related coroutine
This include lsetxattr, lremovexattr, closedir and close.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:44:13 +05:30
Aneesh Kumar K.V 3cc19c0c60 hw/9pfs: Update v9fs_walk to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:23:22 +05:30
Aneesh Kumar K.V d8e0c29e40 hw/9pfs: Update v9fs_stat to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:22:37 +05:30
Venkateswararao Jujjuri 36f8981f01 hw/9pfs: Update v9fs_lcreate to use coroutines
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:21:42 +05:30
Venkateswararao Jujjuri e4de423214 hw/9pfs: Add yield support for open2 coroutine
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:21:42 +05:30
Aneesh Kumar K.V 857bc158d4 hw/9pfs: Update v9fs_open to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:19:53 +05:30
Aneesh Kumar K.V f6b7f0ab5c hw/9pfs: Add yield support for open and opendir coroutine
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:19:53 +05:30
Aneesh Kumar K.V e4e414a427 hw/9pfs: Update v9fs_getlock to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:18:58 +05:30
Aneesh Kumar K.V 0c27bf2a45 hw/9pfs: Update v9fs_lock to use coroutines
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:14:04 +05:30
Aneesh Kumar K.V 03feb1e172 hw/9pfs: Add yeild support for fstat coroutine
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-22 09:14:04 +05:30
Anthony Liguori f1a7104a5f Merge remote-tracking branch 'pmaydell/armhw-for-upstream' into staging 2011-08-21 18:34:33 -05:00
Blue Swirl 30c2f2388a escc: replace DPRINTFs with tracepoints
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 20:02:02 +00:00
Blue Swirl 42c812b98b m48t59: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct M48t59State {
	uint32_t                   type;                 /*     0     4 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   IRQ;                  /*     8     8 */
	uint32_t                   io_base;              /*    16     4 */
	uint32_t                   size;                 /*    20     4 */
	time_t                     time_offset;          /*    24     8 */
	time_t                     stop_time;            /*    32     8 */
	struct tm                  alarm;                /*    40    56 */
	/* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
	struct QEMUTimer *         alrm_timer;           /*    96     8 */
	struct QEMUTimer *         wd_timer;             /*   104     8 */
	uint8_t                    lock;                 /*   112     1 */

	/* XXX 1 byte hole, try to pack */

	uint16_t                   addr;                 /*   114     2 */

	/* XXX 4 bytes hole, try to pack */

	uint8_t *                  buffer;               /*   120     8 */
	/* --- cacheline 2 boundary (128 bytes) --- */

	/* size: 128, cachelines: 2 */
	/* sum members: 119, holes: 3, sum holes: 9 */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 20:02:01 +00:00
Blue Swirl d7b9553489 escc: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:
struct ChannelState {
...
	ChnType                    type;                 /*    32     4 */

	/* XXX 4 bytes hole, try to pack */
...
	uint8_t                    rregs[16];            /*    66    16 */

	/* XXX 2 bytes hole, try to pack */
...
	/* size: 392, cachelines: 7 */
	/* sum members: 382, holes: 2, sum holes: 6 */
	/* padding: 4 */
	/* last cacheline: 8 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 20:01:59 +00:00
Blue Swirl 242cca4fdf fdc: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:
struct FDCtrl {
	uint8_t                    version;              /*     0     1 */

	/* XXX 7 bytes hole, try to pack */

	qemu_irq                   irq;                  /*     8     8 */
	int                        dma_chann;            /*    16     4 */

	/* XXX 4 bytes hole, try to pack */
...
	uint8_t                    status2;              /*    42     1 */

	/* XXX 5 bytes hole, try to pack */

	uint8_t *                  fifo;                 /*    48     8 */
...
	uint8_t                    pwrd;                 /*    76     1 */

	/* XXX 3 bytes hole, try to pack */

	int                        sun4m;                /*    80     4 */
	uint8_t                    num_floppies;         /*    84     1 */

	/* XXX 3 bytes hole, try to pack */

	FDrive                     drives[2];            /*    88    64 */
	/* --- cacheline 2 boundary (128 bytes) was 24 bytes ago --- */
	int                        reset_sensei;         /*   152     4 */

	/* size: 160, cachelines: 3 */
	/* sum members: 134, holes: 5, sum holes: 22 */
	/* padding: 4 */
	/* last cacheline: 32 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 20:01:57 +00:00
Blue Swirl fe87aa83c6 pcnet: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:
struct PCNetState_st {
...
	uint16_t                   bcr[32];              /*   340    64 */

	/* XXX 4 bytes hole, try to pack */
...
	int                        tx_busy;              /*  4520     4 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   irq;                  /*  4528     8 */
	void                       (*phys_mem_read)(void *, target_phys_addr_t, uint8_t *, int, int); /*  4536     8 */
	/* --- cacheline 71 boundary (4544 bytes) --- */
	void                       (*phys_mem_write)(void *, target_phys_addr_t, uint8_t *, int, int); /*  4544     8 */
	void *                     dma_opaque;           /*  4552     8 */
	int                        looptest;             /*  4560     4 */

	/* size: 4568, cachelines: 72 */
	/* sum members: 4556, holes: 2, sum holes: 8 */
	/* padding: 4 */
	/* last cacheline: 24 bytes */
};	/* definitions: 2 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:38 +00:00
Blue Swirl 9a975d6356 esp: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct ESPState {
	SysBusDevice               busdev;               /*     0  5648 */
	/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
	uint32_t                   it_shift;             /*  5648     4 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   irq;                  /*  5656     8 */
	uint8_t                    rregs[16];            /*  5664    16 */
	uint8_t                    wregs[16];            /*  5680    16 */
	/* --- cacheline 89 boundary (5696 bytes) --- */
	int32_t                    ti_size;              /*  5696     4 */
	uint32_t                   ti_rptr;              /*  5700     4 */
	uint32_t                   ti_wptr;              /*  5704     4 */
	uint8_t                    ti_buf[16];           /*  5708    16 */
	uint32_t                   status;               /*  5724     4 */
	uint32_t                   dma;                  /*  5728     4 */

	/* XXX 4 bytes hole, try to pack */

	SCSIBus                    bus;                  /*  5736  2120 */
	/* --- cacheline 122 boundary (7808 bytes) was 48 bytes ago --- */
	SCSIDevice *               current_dev;          /*  7856     8 */
	SCSIRequest *              current_req;          /*  7864     8 */
	/* --- cacheline 123 boundary (7872 bytes) --- */
	uint8_t                    cmdbuf[16];           /*  7872    16 */
	uint32_t                   cmdlen;               /*  7888     4 */
	uint32_t                   do_cmd;               /*  7892     4 */
	uint32_t                   dma_left;             /*  7896     4 */
	uint32_t                   dma_counter;          /*  7900     4 */
	uint8_t *                  async_buf;            /*  7904     8 */
	uint32_t                   async_len;            /*  7912     4 */

	/* XXX 4 bytes hole, try to pack */

	ESPDMAMemoryReadWriteFunc  dma_memory_read;      /*  7920     8 */
	ESPDMAMemoryReadWriteFunc  dma_memory_write;     /*  7928     8 */
	/* --- cacheline 124 boundary (7936 bytes) --- */
	void *                     dma_opaque;           /*  7936     8 */
	int                        dma_enabled;          /*  7944     4 */

	/* XXX 4 bytes hole, try to pack */

	void                       (*dma_cb)(ESPState *); /*  7952     8 */

	/* size: 7960, cachelines: 125 */
	/* sum members: 7944, holes: 4, sum holes: 16 */
	/* last cacheline: 24 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:36 +00:00
Blue Swirl 61999750d3 sun4m: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:
struct sun4c_hwdef {
...
	uint8_t                    nvram_machine_id;     /*   112     1 */

	/* XXX 1 byte hole, try to pack */
...
	/* size: 136, cachelines: 3 */
	/* sum members: 135, holes: 1, sum holes: 1 */
	/* last cacheline: 8 bytes */
};	/* definitions: 1 */

struct sun4d_hwdef {
...
	uint8_t                    nvram_machine_id;     /*   128     1 */

	/* XXX 1 byte hole, try to pack */
...
	/* size: 152, cachelines: 3 */
	/* sum members: 151, holes: 1, sum holes: 1 */
	/* last cacheline: 24 bytes */
};	/* definitions: 1 */

struct sun4m_hwdef {
...
	uint8_t                    nvram_machine_id;     /*   260     1 */

	/* XXX 1 byte hole, try to pack */

	uint16_t                   machine_id;           /*   262     2 */
	uint32_t                   iommu_version;        /*   264     4 */

	/* XXX 4 bytes hole, try to pack */
...
	/* size: 288, cachelines: 5 */
	/* sum members: 283, holes: 2, sum holes: 5 */
	/* last cacheline: 32 bytes */
};	/* definitions: 1 */

Fix by rearranging the structures to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:35 +00:00
Blue Swirl 427a66c3a5 tcx: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct TCXState {
	SysBusDevice               busdev;               /*     0  5648 */
	/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
	target_phys_addr_t         addr;                 /*  5648     8 */
	DisplayState *             ds;                   /*  5656     8 */
	uint8_t *                  vram;                 /*  5664     8 */
	uint32_t *                 vram24;               /*  5672     8 */
	uint32_t *                 cplane;               /*  5680     8 */
	ram_addr_t                 vram_offset;          /*  5688     8 */
	/* --- cacheline 89 boundary (5696 bytes) --- */
	ram_addr_t                 vram24_offset;        /*  5696     8 */
	ram_addr_t                 cplane_offset;        /*  5704     8 */
	uint32_t                   vram_size;            /*  5712     4 */
	uint16_t                   width;                /*  5716     2 */
	uint16_t                   height;               /*  5718     2 */
	uint16_t                   depth;                /*  5720     2 */
	uint8_t                    r[256];               /*  5722   256 */
	/* --- cacheline 93 boundary (5952 bytes) was 26 bytes ago --- */
	uint8_t                    g[256];               /*  5978   256 */
	/* --- cacheline 97 boundary (6208 bytes) was 26 bytes ago --- */
	uint8_t                    b[256];               /*  6234   256 */

	/* XXX 2 bytes hole, try to pack */

	/* --- cacheline 101 boundary (6464 bytes) was 28 bytes ago --- */
	uint32_t                   palette[256];         /*  6492  1024 */
	/* --- cacheline 117 boundary (7488 bytes) was 28 bytes ago --- */
	uint8_t                    dac_index;            /*  7516     1 */
	uint8_t                    dac_state;            /*  7517     1 */

	/* size: 7520, cachelines: 118 */
	/* sum members: 7516, holes: 1, sum holes: 2 */
	/* padding: 2 */
	/* last cacheline: 32 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:33 +00:00