1. 01 5月, 2020 1 次提交
  2. 19 2月, 2020 1 次提交
  3. 24 1月, 2020 1 次提交
  4. 17 1月, 2020 1 次提交
  5. 07 1月, 2020 2 次提交
  6. 06 1月, 2020 1 次提交
  7. 23 12月, 2019 4 次提交
  8. 23 8月, 2019 1 次提交
  9. 23 7月, 2019 1 次提交
  10. 01 7月, 2019 3 次提交
    • K
      iommu/amd: Only free resources once on init error · 5c90501a
      Kevin Mitchell 提交于
      When amd_iommu=off was specified on the command line, free_X_resources
      functions were called immediately after early_amd_iommu_init. They were
      then called again when amd_iommu_init also failed (as expected).
      
      Instead, call them only once: at the end of state_next() whenever
      there's an error. These functions should be safe to call any time and
      any number of times. However, since state_next is never called again in
      an error state, the cleanup will only ever be run once.
      
      This also ensures that cleanup code is run as soon as possible after an
      error is detected rather than waiting for amd_iommu_init() to be called.
      Signed-off-by: NKevin Mitchell <kevmitch@arista.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      5c90501a
    • K
      iommu/amd: Move gart fallback to amd_iommu_init · bf4bff46
      Kevin Mitchell 提交于
      The fallback to the GART driver in the case amd_iommu doesn't work was
      executed in a function called free_iommu_resources, which didn't really
      make sense. This was even being called twice if amd_iommu=off was
      specified on the command line.
      
      The only complication is that it needs to be verified that amd_iommu has
      fully relinquished control by calling free_iommu_resources and emptying
      the amd_iommu_list.
      Signed-off-by: NKevin Mitchell <kevmitch@arista.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      bf4bff46
    • K
      iommu/amd: Make iommu_disable safer · 3ddbe913
      Kevin Mitchell 提交于
      Make it safe to call iommu_disable during early init error conditions
      before mmio_base is set, but after the struct amd_iommu has been added
      to the amd_iommu_list. For example, this happens if firmware fails to
      fill in mmio_phys in the ACPI table leading to a NULL pointer
      dereference in iommu_feature_disable.
      
      Fixes: 2c0ae172 ('iommu/amd: Convert iommu initialization to state machine')
      Signed-off-by: NKevin Mitchell <kevmitch@arista.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      3ddbe913
  11. 05 6月, 2019 1 次提交
  12. 26 4月, 2019 1 次提交
  13. 12 4月, 2019 1 次提交
    • J
      iommu/amd: Set exclusion range correctly · 3c677d20
      Joerg Roedel 提交于
      The exlcusion range limit register needs to contain the
      base-address of the last page that is part of the range, as
      bits 0-11 of this register are treated as 0xfff by the
      hardware for comparisons.
      
      So correctly set the exclusion range in the hardware to the
      last page which is _in_ the range.
      
      Fixes: b2026aa2 ('x86, AMD IOMMU: add functions for programming IOMMU MMIO space')
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      3c677d20
  14. 30 3月, 2019 1 次提交
  15. 11 2月, 2019 1 次提交
  16. 28 11月, 2018 1 次提交
  17. 12 11月, 2018 1 次提交
  18. 06 10月, 2018 1 次提交
  19. 05 10月, 2018 1 次提交
  20. 06 7月, 2018 3 次提交
  21. 13 2月, 2018 1 次提交
  22. 12 1月, 2018 1 次提交
  23. 27 9月, 2017 1 次提交
  24. 19 8月, 2017 2 次提交
  25. 16 8月, 2017 7 次提交
    • B
      iommu/amd: Disable iommu only if amd_iommu=off is specified · 20b46dff
      Baoquan He 提交于
      It's ok to disable iommu early in normal kernel or in kdump kernel when
      amd_iommu=off is specified. While we should not disable it in kdump kernel
      when on-flight dma is still on-going.
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      20b46dff
    • B
      iommu/amd: Don't copy GCR3 table root pointer · daae2d25
      Baoquan He 提交于
      When iommu is pre_enabled in kdump kernel, if a device is set up with
      guest translations (DTE.GV=1), then don't copy GCR3 table root pointer
      but move the device over to an empty guest-cr3 table and handle the
      faults in the PPR log (which answer them with INVALID). After all these
      PPR faults are recoverable for the device and we should not allow the
      device to change old-kernels data when we don't have to.
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      daae2d25
    • B
      iommu/amd: Allocate memory below 4G for dev table if translation pre-enabled · b336781b
      Baoquan He 提交于
      AMD pointed out it's unsafe to update the device-table while iommu
      is enabled. It turns out that device-table pointer update is split
      up into two 32bit writes in the IOMMU hardware. So updating it while
      the IOMMU is enabled could have some nasty side effects.
      
      The safe way to work around this is to always allocate the device-table
      below 4G, including the old device-table in normal kernel and the
      device-table used for copying the content of the old device-table in kdump
      kernel. Meanwhile we need check if the address of old device-table is
      above 4G because it might has been touched accidentally in corrupted
      1st kernel.
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      b336781b
    • B
      iommu/amd: Do sanity check for address translation and irq remap of old dev table entry · 53019a9e
      Baoquan He 提交于
      Firstly split the dev table entry copy into address translation part
      and irq remapping part. Because these two parts could be enabled
      independently.
      
      Secondly do sanity check for address translation and irq remap of old
      dev table entry separately.
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      53019a9e
    • B
      iommu/amd: Copy old trans table from old kernel · 3ac3e5ee
      Baoquan He 提交于
      Here several things need be done:
      - If iommu is pre-enabled in a normal kernel, just disable it and print
        warning.
      
      - If any one of IOMMUs is not pre-enabled in kdump kernel, just continue
        as it does in normal kernel.
      
      - If failed to copy dev table of old kernel, continue to proceed as
        it does in normal kernel.
      
      - Only if all IOMMUs are pre-enabled and copy dev table is done well, free
        the dev table allocated in early_amd_iommu_init() and make amd_iommu_dev_table
        point to the copied one.
      
      - Disable and Re-enable event/cmd buffer,  install the copied DTE table
        to reg, and detect and enable guest vapic.
      
      - Flush all caches
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      3ac3e5ee
    • B
      iommu/amd: Add function copy_dev_tables() · 45a01c42
      Baoquan He 提交于
      Add function copy_dev_tables to copy the old DEV table entries of the panicked
      kernel to the new allocated device table. Since all iommus share the same device
      table the copy only need be done one time. Here add a new global old_dev_tbl_cpy
      to point to the newly allocated device table which the content of old device
      table will be copied to. Besides, we also need to:
      
        - Check whether all IOMMUs actually use the same device table with the same size
      
        - Verify that the size of the old device table is the expected size.
      
        - Reserve the old domain id occupied in 1st kernel to avoid touching the old
          io-page tables. Then on-flight DMA can continue looking it up.
      
      And also define MACRO DEV_DOMID_MASK to replace magic number 0xffffULL, it can be
      reused in copy_dev_tables().
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      45a01c42
    • B
      Revert "iommu/amd: Suppress IO_PAGE_FAULTs in kdump kernel" · 9494ea90
      Baoquan He 提交于
      This reverts commit 54bd6357.
      
      We still need the IO_PAGE_FAULT message to warn error after the
      issue of on-flight dma in kdump kernel is fixed.
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      9494ea90