1. 24 10月, 2012 22 次提交
  2. 23 10月, 2012 13 次提交
  3. 22 10月, 2012 5 次提交
    • A
      pci: honor PCI_COMMAND_MASTER · 1c380f94
      Avi Kivity 提交于
      Currently we ignore PCI_COMMAND_MASTER completely: DMA succeeds even when
      the bit is clear.
      
      Honor PCI_COMMAND_MASTER by inserting a memory region into the device's
      bus master address space, and tying its enable status to PCI_COMMAND_MASTER.
      
      Tested using
      
        setpci -s 03 COMMAND=3
      
      while a ping was running on a NIC in slot 3.  The kernel (Linux) detected
      the stall and recovered after the command
      
        setpci -s 03 COMMAND=7
      
      was issued.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      1c380f94
    • A
      pci: give each device its own address space · 817dcc53
      Avi Kivity 提交于
      Accesses from different devices can resolve differently
      (depending on bridge settings, iommus, and PCI_COMMAND_MASTER), so
      set up an address space for each device.
      
      Currently iommus are expressed outside the memory API, so this doesn't
      work if an iommu is present.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      817dcc53
    • A
      memory: add address_space_destroy() · 83f3c251
      Avi Kivity 提交于
      Since address spaces can be created dynamically by device hotplug, they
      can also be destroyed dynamically.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      83f3c251
    • A
      dma: make dma access its own address space · b90600ee
      Avi Kivity 提交于
      Instead of accessing the cpu address space, use an address space
      configured by the caller.
      
      Eventually all dma functionality will be folded into AddressSpace,
      but we have to start from something.
      Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      b90600ee
    • A
      memory: per-AddressSpace dispatch · ac1970fb
      Avi Kivity 提交于
      Currently we use a global radix tree to dispatch memory access.  This only
      works with a single address space; to support multiple address spaces we
      make the radix tree a member of AddressSpace (via an intermediate structure
      AddressSpaceDispatch to avoid exposing too many internals).
      
      A side effect is that address_space_io also gains a dispatch table.  When
      we remove all the pre-memory-API I/O registrations, we can use that for
      dispatching I/O and get rid of the original I/O dispatch.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      ac1970fb