You need to sign in or sign up before continuing.
  1. 29 3月, 2013 1 次提交
  2. 27 3月, 2013 1 次提交
  3. 08 3月, 2013 1 次提交
  4. 01 3月, 2013 1 次提交
    • P
      hw: include hw header files with full paths · 83c9f4ca
      Paolo Bonzini 提交于
      Done with this script:
      
      cd hw
      for i in `find . -name '*.h' | sed 's/^..//'`; do
        echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,'
      done | sed -i -f - `find . -type f`
      
      This is so that paths remain valid as files are moved.
      
      Instead, files in hw/dataplane are referenced with the relative path.
      We know they are not going to move to include/, and they are the only
      include files that are in subdirectories _and_ move.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      83c9f4ca
  5. 30 1月, 2013 1 次提交
    • L
      PIIX3: reset the VM when the Reset Control Register's RCPU bit gets set · 1ec4ba74
      Laszlo Ersek 提交于
        Traditional PCI config space access is achieved by writing a 32 bit
        value to io port 0xcf8 to identify the bus, device, function and config
        register. Port 0xcfc then contains the register in question. But if you
        write the appropriate pair of magic values to 0xcf9, the machine will
        reboot. Spectacular! And not standardised in any way (certainly not part
        of the PCI spec), so different chipsets may have different requirements.
        Booo.
      
      In the PIIX3 spec, IO port 0xcf9 is specified as the Reset Control
      Register. Bit 1 (System Reset, SRST) would normally differentiate between
      soft reset and hard reset, but we ignore the difference beyond allowing
      the guest to read it back.
      
      RHBZ reference: 890459
      
      This patch introduces the following overlap between the preexistent
      "pci-conf-idx" region and the "piix3-reset-control" region just being
      added. Partial output from "info mtree":
      
        I/O
        0000000000000000-000000000000ffff (prio 0, RW): io
          0000000000000cf8-0000000000000cfb (prio 0, RW): pci-conf-idx
          0000000000000cf9-0000000000000cf9 (prio 1, RW): piix3-reset-control
      
      I sanity-checked the patch by booting a RHEL-6.3 guest and found no
      problems. I summoned gdb and set a breakpoint on rcr_write() in order to
      gather a bit more confidence. Relevant frames of the stack:
      
        kvm_handle_io (port=3321, data=0x7f3f5f3de000, direction=1, size=1,
                       count=1)                                 [kvm-all.c:1422]
          cpu_outb (addr=3321, val=6 '\006')                      [ioport.c:289]
            ioport_write (index=0, address=3321, data=6)           [ioport.c:83]
              ioport_writeb_thunk (opaque=0x7f3f622c4680, addr=3321, data=6)
                                                                  [ioport.c:212]
                memory_region_iorange_write (iorange=0x7f3f622c4680, offset=0,
                                             width=1, data=6)     [memory.c:439]
                  access_with_adjusted_size (addr=0, value=0x7f3f531fbac0,
                                             size=1, access_size_min=1,
                                             access_size_max=4,
                                             access=0x7f3f5f6e0f90
                                                 <memory_region_write_accessor>,
                                             opaque=0x7f3f6227b668)
                                                                  [memory.c:364]
                    memory_region_write_accessor (opaque=0x7f3f6227b668, addr=0,
                                                  value=0x7f3f531fbac0, size=1,
                                                  shift=0, mask=255)
                                                                  [memory.c:334]
                      rcr_write (opaque=0x7f3f6227afb0, addr=0, val=6, len=1)
                                                             [hw/piix_pci.c:498]
      
      The dispatch happens in ioport_write(); "index=0" means byte-wide access:
      
          static void ioport_write(int index, uint32_t address, uint32_t data)
          {
              static IOPortWriteFunc * const default_func[3] = {
                  default_ioport_writeb,
                  default_ioport_writew,
                  default_ioport_writel
              };
              IOPortWriteFunc *func = ioport_write_table[index][address];
              if (!func)
                  func = default_func[index];
              func(ioport_opaque[address], address, data);
          }
      
      The "ioport_write_table" and "ioport_opaque" arrays describe the flattened
      IO port space. The first array is less interesting (it selects a thunk
      function). The "ioport_opaque" array is interesting because it decides how
      writing to the port is implemented ultimately.
      
      4-byte wide access to 0xcf8 (pci-conf-idx):
      
        (gdb) print ioport_write_table[2][0xcf8]
        $1 = (IOPortWriteFunc *) 0x7f3f5f6d99ba <ioport_writel_thunk>
      
        (gdb) print \
              ((struct MemoryRegionIORange*)ioport_opaque[0xcf8])->mr->ops.write
        $2 = (void (*)(void *, hwaddr, uint64_t, unsigned int))
             0x7f3f5f5575cb <pci_host_config_write>
      
      1-byte wide access to 0xcf9 (piix3-reset-control):
      
        (gdb) print ioport_write_table[0][0xcf9]
        $3 = (IOPortWriteFunc *) 0x7f3f5f6d98d0 <ioport_writeb_thunk>
      
        (gdb) print \
              ((struct MemoryRegionIORange*)ioport_opaque[0xcf9])->mr->ops.write
        $4 = (void (*)(void *, hwaddr, uint64_t, unsigned int))
             0x7f3f5f6b42f1 <rcr_write>
      
      The higher priority of "piix3-reset-control" ensures that the 0xcf9
      entries in ioport_write_table / ioport_opaque will always belong to it,
      independently of its relative registration order versus "pci-conf-idx".
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      1ec4ba74
  6. 19 12月, 2012 1 次提交
  7. 17 12月, 2012 1 次提交
  8. 26 11月, 2012 1 次提交
  9. 23 10月, 2012 1 次提交
    • A
      Rename target_phys_addr_t to hwaddr · a8170e5e
      Avi Kivity 提交于
      target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
      reserved) and its purpose doesn't match the name (most target_phys_addr_t
      addresses are not target specific).  Replace it with a finger-friendly,
      standards conformant hwaddr.
      
      Outstanding patchsets can be fixed up with the command
      
        git rebase -i --exec 'find -name "*.[ch]"
                              | xargs s/target_phys_addr_t/hwaddr/g' origin
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a8170e5e
  10. 17 10月, 2012 1 次提交
    • A
      i440fx: avoid destroying memory regions within a transaction · 2725aec7
      Avi Kivity 提交于
      Calling memory_region_destroy() within a transaction is illegal, since
      the memory API is allowed to continue to dispatch to a region until the
      transaction commits.  440fx does that however when managing PAM registers.
      
      This bug is benign, since the regions are all aliases (which the memory
      core tends to throw anyway), and since we don't do concurrent dispatch yet,
      but instead of relying on that, tighten ship ahead of the coming concurrency
      storm.
      
      Fix by having a predefined set of regions, of which one will be enabled at
      any time.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      2725aec7
  11. 22 8月, 2012 3 次提交
  12. 19 7月, 2012 2 次提交
    • J
      pci: Add INTx routing notifier · 0ae16251
      Jan Kiszka 提交于
      This per-device notifier shall be triggered by any interrupt router
      along the path of a device's legacy interrupt signal on routing changes.
      For simplicity reasons and as this is a slow path anyway, no further
      details on the routing changes are provided. Instead, the callback is
      expected to use pci_device_route_intx_to_irq to check the effect of the
      change.
      
      Will be used by KVM PCI device assignment and VFIO.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      0ae16251
    • M
      pci: Add pci_device_route_intx_to_irq · 3afa9bb4
      Michael S. Tsirkin 提交于
      Device assigned on KVM needs to know the mode
      (enabled/inverted/disabled) and the IRQ number that a given device
      triggers in the attached interrupt controller.
      
      Add a PCI IRQ path discovery function that walks from a given device to
      the host bridge, and gets this information.  For
      this purpose, a host bridge callback function is introduced:
      route_intx_to_irq. It is so far only implemented by the PIIX3, other
      host bridges can be added later on as required.
      
      Will be used for KVM PCI device assignment and VFIO.
      
      Based on patch by Jan Kiszka, with minor tweaks.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      3afa9bb4
  13. 11 4月, 2012 1 次提交
  14. 03 4月, 2012 2 次提交
  15. 15 2月, 2012 1 次提交
  16. 04 2月, 2012 2 次提交
    • A
      qom: move properties from qdev to object · 57c9fafe
      Anthony Liguori 提交于
      This is mostly code movement although not entirely.  This makes properties part
      of the Object base class which means that we can now start using Object in a
      meaningful way outside of qdev.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      57c9fafe
    • A
      qdev: register all types natively through QEMU Object Model · 39bffca2
      Anthony Liguori 提交于
      This was done in a mostly automated fashion.  I did it in three steps and then
      rebased it into a single step which avoids repeatedly touching every file in
      the tree.
      
      The first step was a sed-based addition of the parent type to the subclass
      registration functions.
      
      The second step was another sed-based removal of subclass registration functions
      while also adding virtual functions from the base class into a class_init
      function as appropriate.
      
      Finally, a python script was used to convert the DeviceInfo structures and
      qdev_register_subclass functions to TypeInfo structures, class_init functions,
      and type_register_static calls.
      
      We are almost fully converted to QOM after this commit.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      39bffca2
  17. 28 1月, 2012 3 次提交
  18. 21 12月, 2011 1 次提交
  19. 20 12月, 2011 1 次提交
  20. 19 12月, 2011 1 次提交
  21. 15 12月, 2011 1 次提交
  22. 05 12月, 2011 1 次提交
  23. 25 9月, 2011 1 次提交
  24. 04 9月, 2011 2 次提交
  25. 26 8月, 2011 1 次提交
  26. 25 8月, 2011 2 次提交
  27. 22 8月, 2011 1 次提交
    • A
      440fx: fix PAM, PCI holes · ae0a5466
      Avi Kivity 提交于
      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: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ae0a5466
  28. 08 8月, 2011 1 次提交
  29. 29 7月, 2011 1 次提交
  30. 17 7月, 2011 1 次提交
  31. 19 6月, 2011 1 次提交