• Add functions implementing MSI-X support. First user will be virtio-pci.
    Note that platform must set a flag to declare MSI supported: this
    is a safety measure to avoid breaking platforms which should support
    MSI-X but currently lack this in the interrupt controller emulation.
    For PC this will be set by APIC.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Michael S. Tsirkin authored
     
    Browse Code »
  • Add "cmask" table of constant register masks: if a bit is not writeable
    and is set in cmask table, this bit is checked on load.  An attempt to
    load an image that would change such a register causes load to fail.
    Use this table to make sure that load does not modify registers that
    guest can not change (directly or indirectly).
    
    Note: we can't just assume that read-only registers never change,
    because the guest could change a register indirectly.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Michael S. Tsirkin authored
     
    Browse Code »
  • Add routines to manage PCI capability list. First user will be MSI-X.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Michael S. Tsirkin authored
     
    Browse Code »
  • Add inline routines for convenient access to pci devices
    with correct (little) endianness. Will be used by MSI-X support.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Michael S. Tsirkin authored
     
    Browse Code »
  • Change much of hw/pci to use symbolic constants and a table-driven
    design: add a mask table with writable bits set and readonly bits unset.
    Detect change by comparing original and new registers.
    
    This makes it easy to support capabilities where read-only/writeable
    bit layout differs between devices, depending on capabilities present.
    
    As a result, writing a single byte in BAR registers now works as
    it should. Writing to upper limit registers in the bridge
    also works as it should. Code is also shorter.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Michael S. Tsirkin authored
     
    Browse Code »


  • Maximum alignment for Win32 is 16, so don't try
    to set it to 32. Otherwise the compiler complains:
    
    exec.c:102: warning: alignment of 'code_gen_prologue'
    is greater than maximum object file alignment.  Using 16
    
    Signed-off-by: Stefan Weil <weil@mail.berlios.de>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Stefan Weil authored
     
    Browse Code »
  • Signed-off-by: Stefan Weil <weil@mail.berlios.de>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Stefan Weil authored
     
    Browse Code »
  • `sdl-config --cflags` defines main = SDL_main
    on some platforms. One of these platforms is
    Windows with mingw32.
    
    For those platforms, the solution already developed
    for __APPLE__ is now applied.
    
    A compiler warning (missing return value) is fixed, too.
    
    Maybe __APPLE__ no longer needs a separate check.
    
    Signed-off-by: Stefan Weil <weil@mail.berlios.de>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Stefan Weil authored
     
    Browse Code »
  • Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • virtio-net needs this - for the same purpose that it currently uses the
    return value from qemu_sendv_packet().
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • 2.6.30 adds a new TUNSETSNDBUF ioctl() which allows a send buffer limit
    for the tap device to be specified. When this limit is reached, a tap
    write() will return EAGAIN and poll() will indicate the fd isn't
    writable.
    
    This allows people to tune their setups so as to avoid e.g. UDP packet
    loss when the sending application in the guest out-runs the NIC in the
    host.
    
    There is no obviously sensible default setting - a suitable value
    depends mostly on the capabilities of the physical NIC through which the
    packets are being sent.
    
    Also, note that when using a bridge with netfilter enabled, we currently
    never get EAGAIN because netfilter causes the packet to be immediately
    orphaned. Set /proc/sys/net/bridge/bridge nf-call-iptables to zero to
    disable this behaviour.
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • net_tap_fd_init() already returns TAPState, so this is a sensible
    cleanup in its own right.
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • If a write() on tapfd returns EAGAIN, return zero so that the packet
    gets queued (in the case of async send) and enable polling tapfd for
    writing.
    
    When tapfd becomes writable, disable write polling and flush any queued
    packets.
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • Add a helper to enable/disable the read polling on tapfd.
    
    We need this, because we want to start write polling on the tapfd too
    and enable/disable both types of polling independently.
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • If tap has any packets queued at host_net_remove time, it needs to purge
    them in order to prevent a sent callback being invoked for it.
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • If net client sends packets asynchronously, it needs to purge its queued
    packets in cleanup() so as to prevent sent callbacks being invoked with
    a freed client.
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Anthony Liguori authored
     
    Browse Code »
  • APIC reset handler already resets cpu, no need to reset it twice.
    Also register cpu_reset handler directly to make it impossible to
    add additional code to main_cpu_reset() by mistake.
    
    Signed-off-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Gleb Natapov authored
     
    Browse Code »
  • Make drive_init() accept addr=, put the value into struct DriveInfo.
    Use it in all the places that create virtio-blk-pci devices:
    pc_init1(), bamboo_init(), mpc8544ds_init().
    
    Don't support addr= in third argument of monitor command pci_add and
    second argument of drive_add, because that clashes with their first
    arguments.  Admittedly unelegant.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Markus Armbruster authored
     
    Browse Code »
  • Simply pass the PCI address through qemu_pci_hot_add_nic() to
    pci_nic_init() and through qemu_pci_hot_add_storage() to pci_create().
    
    Before, pci_device_hot_add() passed along the PCI bus to use, and
    ignored any user-specified slot.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Markus Armbruster authored
     
    Browse Code »
  • Make net_client_init() accept addr=, put the value into struct
    NICinfo.  Use it in pci_nic_init(), and remove arguments bus and
    devfn.
    
    Don't support addr= in third argument of monitor command pci_add,
    because that clashes with its first argument.  Admittedly unelegant.
    
    Machines "malta" and "r2d" have a default NIC with a well-known PCI
    address.  Deal with that the same way as the NIC model: make
    pci_nic_init() take an optional default to be used when the user
    doesn't specify one.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Markus Armbruster authored
     
    Browse Code »
  • Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Markus Armbruster authored
     
    Browse Code »
  • use NULL instead of 0 for pci_register_device() argument
    for consistency. Any other caller uses NULL.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Isaku Yamahata authored
     
    Browse Code »
  • add qemu-monitor.texi to .gitignore.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Isaku Yamahata authored
     
    Browse Code »
  • When virtio-net was merged in from qemu-kvm.git, the VNET_HDR related
    features were dropped from the code.
    
    However, VIRTIO_NET_F_MRG_RXBUF appears to have accidentally been
    dropped too. Re-instate that now.
    
    Reported-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • introruce piix4_device_hot_add() for piix4 specific code
    and make qemu_system_device_hot_add() generic.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Isaku Yamahata authored
     
    Browse Code »
  • Otherwise, after migration, we end up with a much larger RSS size then we
    ought to have.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Anthony Liguori authored
     
    Browse Code »
  • This should fix compilation problem in case of CONFIG_USER_ONLY.
    
    Currently INIT/SIPI is handled in the context of CPU that sends IPI.
    This patch changes this to handle them like all other events in a main
    cpu exec loop. When KVM will gain thread per vcpu capability it will
    be much more clear to handle those event by cpu thread itself and not
    modify one cpu's state from the context of the other.
    
    Signed-off-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Gleb Natapov authored
     
    Browse Code »
  • To reset internal irq handling data structures.
    
    Signed-off-by: Gleb Natapov <gleb@redhat.com>
    Signed-off-by: Yaniv Kamay <ykamay@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Gleb Natapov authored
     
    Browse Code »
  • Support a new feature flag for indirect ring entries. These are ring
    entries which point to a table of buffer descriptors.
    
    The idea here is to increase the ring capacity by allowing a larger
    effective ring size whereby the ring size dictates the number of
    requests that may be outstanding, rather than the size of those
    requests.
    
    This should be most effective in the case of block I/O where we can
    potentially benefit by concurrently dispatching a large number of
    large requests. Even in the simple case of single segment block
    requests, this results in a threefold increase in ring capacity.
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • Change the vring descriptor helpers to take the physical
    address of the descriptor table rather than a virtqueue.
    
    This is needed in order to allow these helpers to be used
    with an indirect descriptor table.
    
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Mark McLoughlin authored
     
    Browse Code »
  • Fix the pcap dumps on Win32 and other systems where O_BINARY is required.
    
    Signed-off-by: Filip Navara <filip.navara@gmail.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Filip Navara authored
     
    Browse Code »
  • The code how it is today, is totally painful to read and keep.
    To begin with, the code is duplicated with the option rom loading
    code that linux_boot and vga are already using.
    
    This patch introduces a "bootable" state in NICInfo structure,
    that we can use to keep track of whether or not a given nic should
    be bootable, avoiding the introduction of yet another global state.
    
    With that in hands, we move the code in vl.c to hw/pc.c, and use
    the already existing infra structure to load those option roms.
    
    Error checking code suggested by Mark McLoughlin
    
    Signed-off-by: Glauber Costa <glommer@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Glauber Costa authored
     
    Browse Code »
  • This eliminates the results unused warnings.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Anthony Liguori authored
     
    Browse Code »