1. 16 7月, 2013 1 次提交
    • A
      net: add support of mac-programming over macvtap in QEMU side · b1be4280
      Amos Kong 提交于
      Currently macvtap based macvlan device is working in promiscuous
      mode, we want to implement mac-programming over macvtap through
      Libvirt for better performance.
      
      Design:
       QEMU notifies Libvirt when rx-filter config is changed in guest,
       then Libvirt query the rx-filter information by a monitor command,
       and sync the change to macvtap device. Related rx-filter config
       of the nic contains main mac, rx-mode items and vlan table.
      
      This patch adds a QMP event to notify management of rx-filter change,
      and adds a monitor command for management to query rx-filter
      information.
      
      Test:
       If we repeatedly add/remove vlan, and change macaddr of vlan
       interfaces in guest by a loop script.
      
      Result:
       The events will flood the QMP client(management), management takes
       too much resource to process the events.
      
       Event_throttle API (set rate to 1 ms) can avoid the events to flood
       QMP client, but it could cause an unexpected delay (~1ms), guests
       guests normally expect rx-filter updates immediately.
      
       So we use a flag for each nic to avoid events flooding, the event
       is emitted once until the query command is executed. The flag
       implementation could not introduce unexpected delay.
      
      There maybe exist an uncontrollable delay if we let Libvirt do the
      real change, guests normally expect rx-filter updates immediately.
      But it's another separate issue, we can investigate it when the
      work in Libvirt side is done.
      
      Michael S. Tsirkin: tweaked to enable events on start
      Michael S. Tsirkin: fixed not to crash when no id
      Michael S. Tsirkin: fold in patch:
         "additional fixes for mac-programming feature"
      Amos Kong: always notify QMP client if mactable is changed
      Amos Kong: return NULL list if no net client supports rx-filter query
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAmos Kong <akong@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      b1be4280
  2. 10 7月, 2013 2 次提交
  3. 08 7月, 2013 8 次提交
    • D
      pci: Fold host_buses list into PCIHostState functionality · 7588e2b0
      David Gibson 提交于
      The host_buses list is an odd structure - a list of pointers to PCI root
      buses existing in parallel to the normal qdev tree structure.  This patch
      removes it, instead putting the link pointers into the PCIHostState
      structure, which have a 1:1 relationship to PCIHostBus structures anyway.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      7588e2b0
    • D
      pci: Remove domain from PCIHostBus · 2b8cc89a
      David Gibson 提交于
      There are now no users of the domain field of PCIHostBus, so remove it
      from the structure, and as a parameter from the pci_host_bus_register()
      function which sets it.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      2b8cc89a
    • D
      pci: Simpler implementation of primary PCI bus · 9bc47305
      David Gibson 提交于
      Currently pci_find_primary_bus() searches the list of root buses for one
      with domain 0.  But since host buses are always registered with domain 0,
      this just amounts to finding the only PCI host bus.  The only remaining
      users of pci_find_primary_bus() are in pci-hotplug-old.c, which implements
      the old style pci_add/pci_del commands.
      
      Therefore, this patch redefines pci_find_primary_bus() to find the only
      PCI root bus, returning an error if there are multiple roots.  The callers
      in pci-hotplug-old.c are updated correspondingly, to produce sensible
      error messages.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      9bc47305
    • D
      pci: Add root bus parameter to pci_nic_init() · 29b358f9
      David Gibson 提交于
      At present, pci_nic_init() and pci_nic_init_nofail() assume that they will
      only create a NIC under the primary PCI root.  As we add support for
      multiple PCI roots, that may no longer be the case.  This patch adds a root
      bus parameter to pci_nic_init() (and updates callers accordingly) to allow
      the machine init code using it to specify the right PCI root for NICs
      created by old-style -net nic parameters.  NICs created new-style, with
      -device can of course be put anywhere.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      29b358f9
    • D
      pci: Add root bus argument to pci_get_bus_devfn() · 85c6e4fa
      David Gibson 提交于
      pci_get_bus_devfn() interprets a full PCI address string to give a PCIBus *
      and device/function number within that bus.  Currently it assumes it is
      working on an address under the primary PCI root bus.  This patch extends
      it to allow the caller to specify a root bus.  This might seem a little odd
      since the supplied address can (theoretically) include a PCI domain number.
      However, attempting to use a non-zero domain number there is currently an
      error, so that shouldn't really cause problems.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      85c6e4fa
    • D
      pci: Replace pci_find_domain() with more general pci_root_bus_path() · 568f0690
      David Gibson 提交于
      pci_find_domain() is used in a number of places where we want an id for a
      whole PCI domain (i.e. the subtree under a PCI root bus).  The trouble is
      that many platforms may support multiple independent host bridges with no
      hardware supplied notion of domain number.
      
      This patch, therefore, replaces calls to pci_find_domain() with calls to
      a new pci_root_bus_path() returning a string.  The new call is implemented
      in terms of a new callback in the host bridge class, so it can be defined
      in some way that's well defined for the platform.  When no callback is
      available we fall back on the qbus name.
      
      Most current uses of pci_find_domain() are for error or informational
      messages, so the change in identifiers should be harmless.  The exception
      is pci_get_dev_path(), whose results form part of migration streams.  To
      maintain compatibility with old migration streams, the PIIX PCI host is
      altered to always supply "0000" for this path, which matches the old domain
      number (since the code didn't actually support domains other than 0).
      
      For the pseries (spapr) PCI bridge we use a different platform-unique
      identifier (pseries machines can routinely have dozens of PCI host
      bridges).  Theoretically that breaks migration streams, but given that we
      don't yet have migration support for pseries, it doesn't matter.
      
      Any other machines that have working migration support including PCI
      devices will need to be updated to maintain migration stream compatibility.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      568f0690
    • D
      pci: Use helper to find device's root bus in pci_find_domain() · c473d18d
      David Gibson 提交于
      Currently pci_find_domain() performs two functions - it locates the PCI
      root bus above the given bus, then looks up that root bus's domain number.
      This patch adds a helper function to perform the first task, finding the
      root bus for a given PCI device.  This is then used in pci_find_domain().
      This changes pci_find_domain()'s signature slightly, taking a PCIDevice
      instead of a PCIBus - since all callers passed something of the form
      dev->bus, this simplifies things slightly.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      c473d18d
    • D
      pci: Abolish pci_find_root_bus() · 1ef7a2a2
      David Gibson 提交于
      pci_find_root_bus() takes a domain parameter.  Currently PCI root buses
      with domain other than 0 can't be created, so this is more or less a long
      winded way of retrieving the main PCI root bus.  Numbered domains don't
      actually properly cover the (non x86) possibilities for multiple PCI root
      buses, so this patch for now enforces the domain == 0 restriction in other
      places to replace pci_find_root_bus() with an explicit
      pci_find_primary_bus().
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      1ef7a2a2
  4. 04 7月, 2013 10 次提交
    • D
      pci: Move pci_read_devaddr to pci-hotplug-old.c · 6ac363b5
      David Gibson 提交于
      pci_read_devaddr() is only used by the legacy functions for the old PCI
      hotplug interface in pci-hotplug-old.c.  So we move the function there,
      and make it static.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      6ac363b5
    • D
      pci: Cleanup configuration for pci-hotplug.c · 79ca616f
      David Gibson 提交于
      pci-hotplug.c and the CONFIG_PCI_HOTPLUG variable which controls its
      compilation are misnamed.  They're not about PCI hotplug in general, but
      rather about the pci_add/pci_del interface which are now deprecated in
      favour of the more general device_add/device_del interface.  This patch
      therefore renames them to pci-hotplug-old.c and CONFIG_PCI_HOTPLUG_OLD.
      
      CONFIG_PCI_HOTPLUG=y was listed twice in {i386,x86_64}-softmmu.make for no
      particular reason, so we clean that up too.  In addition it was included in
      ppc64-softmmu.mak for which the old hotplug interface was never used and is
      unsuitable, so we remove that too.
      
      Most of pci-hotplug.c was additionaly protected by #ifdef TARGET_I386.  The
      small piece which wasn't is only called from the pci_add and pci_del hooks
      in hmp-commands.hx, which themselves were protected by #ifdef TARGET_I386.
      This patch therefore also removes the #ifdef from pci-hotplug-old.c,
      and changes the ifdefs in hmp-commands.hx to use CONFIG_PCI_HOTPLUG_OLD.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      79ca616f
    • M
      pvpanic: fix fwcfg for big endian hosts · fea7d596
      Michael S. Tsirkin 提交于
      Convert port number to little endian when
      exposing it in fw cfg.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      fea7d596
    • M
      pvpanic: initialization cleanup · bc3e6a0d
      Michael S. Tsirkin 提交于
      Avoid use of static variables: PC systems
      initialize pvpanic device through pvpanic_init,
      so we can simply create the fw_cfg file at that point.
      This also makes it possible to skip device
      creation completely if fw_cfg is not there, e.g. for xen -
      so the ports it reserves are not discoverable by guests.
      
      Also, make pvpanic_init void since callers ignore return
      status anyway.
      
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Paul Durrant <Paul.Durrant@citrix.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      bc3e6a0d
    • M
      MAINTAINERS: s/Marcelo/Paolo/ · c6d559d9
      Michael S. Tsirkin 提交于
      Marcelo doesn't maintain kvm anymore,
      Paolo is taking over the job.
      Update MAINTAINERS to stop flooding Marcelo with mail.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      c6d559d9
    • A
      e1000: cleanup process_tx_desc · a0ae17a6
      Andrew Jones 提交于
      Coverity complains about two overruns in process_tx_desc(). The
      complaints are false positives, but we might as well eliminate
      them. The problem is that "hdr" is defined as an unsigned int,
      but then used to offset an array of size 65536, and another of
      size 256 bytes. hdr will actually never be greater than 255
      though, as it's assigned only once and to the value of
      tp->hdr_len, which is an uint8_t. This patch simply gets rid of
      hdr, replacing it with tp->hdr_len, which makes it consistent
      with all other tp member use in the function.
      
      v2:
       - also cleanup coding style issues in the touched lines
      Signed-off-by: NAndrew Jones <drjones@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      a0ae17a6
    • M
      pc_piix: cleanup init compat handling · fcbe0a70
      Michael S. Tsirkin 提交于
      Make sure 1.4 calls 1.5, 1.3 calls 1.4 etc.
      This way it's enough to add enough new compat hook
      in a single place in piix.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      fcbe0a70
    • M
      pc: pass PCI hole ranges to Guests · f8c457b8
      Michael S. Tsirkin 提交于
      Guest currently has to jump through lots of hoops to guess the PCI hole
      ranges.  It's fragile, and makes us change BIOS each time we add a new
      chipset.  Let's report the window in a ROM file, to make BIOS do exactly
      what QEMU intends.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      f8c457b8
    • M
      pci: store PCI hole ranges in guestinfo structure · 3459a625
      Michael S. Tsirkin 提交于
      Will be used to pass hole ranges to guests.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      3459a625
    • M
      range: add Range structure · 620ac82e
      Michael S. Tsirkin 提交于
      Sometimes we need to pass ranges around, add a
      handy structure for this purpose.
      
      Note: memory.c defines its own concept of AddrRange structure for
      working with 128 addresses.  It's necessary there for doing range math.
      This is not needed for most users: struct Range is
      much simpler, and is only used for passing the range around.
      
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      620ac82e
  5. 03 7月, 2013 6 次提交
  6. 01 7月, 2013 13 次提交