“94855f4af08002253fca10aab4bffc187e5c982f”上不存在“paddle/fluid/operators/rmsprop_op.cc”
  1. 11 12月, 2018 8 次提交
  2. 23 11月, 2018 1 次提交
    • S
      iommu/vt-d: Handle domain agaw being less than iommu agaw · 3569dd07
      Sohil Mehta 提交于
      The Intel IOMMU driver opportunistically skips a few top level page
      tables from the domain paging directory while programming the IOMMU
      context entry. However there is an implicit assumption in the code that
      domain's adjusted guest address width (agaw) would always be greater
      than IOMMU's agaw.
      
      The IOMMU capabilities in an upcoming platform cause the domain's agaw
      to be lower than IOMMU's agaw. The issue is seen when the IOMMU supports
      both 4-level and 5-level paging. The domain builds a 4-level page table
      based on agaw of 2. However the IOMMU's agaw is set as 3 (5-level). In
      this case the code incorrectly tries to skip page page table levels.
      This causes the IOMMU driver to avoid programming the context entry. The
      fix handles this case and programs the context entry accordingly.
      
      Fixes: de24e553 ("iommu/vt-d: Simplify domain_context_mapping_one")
      Cc: <stable@vger.kernel.org>
      Cc: Ashok Raj <ashok.raj@intel.com>
      Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
      Cc: Lu Baolu <baolu.lu@linux.intel.com>
      Reviewed-by: NLu Baolu <baolu.lu@linux.intel.com>
      Reported-by: NRamos Falcon, Ernesto R <ernesto.r.ramos.falcon@intel.com>
      Tested-by: NRicardo Neri <ricardo.neri-calderon@linux.intel.com>
      Signed-off-by: NSohil Mehta <sohil.mehta@intel.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      3569dd07
  3. 31 10月, 2018 1 次提交
  4. 27 10月, 2018 1 次提交
  5. 11 10月, 2018 2 次提交
  6. 08 10月, 2018 1 次提交
  7. 06 10月, 2018 1 次提交
  8. 05 10月, 2018 2 次提交
    • J
      iommu/amd: Move iommu_init_pci() to .init section · 24d2c521
      Joerg Roedel 提交于
      The function is only called from another __init function, so
      it should be moved to .init too.
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      24d2c521
    • S
      iommu/amd: Clear memory encryption mask from physical address · b3e9b515
      Singh, Brijesh 提交于
      Boris Ostrovsky reported a memory leak with device passthrough when SME
      is active.
      
      The VFIO driver uses iommu_iova_to_phys() to get the physical address for
      an iova. This physical address is later passed into vfio_unmap_unpin() to
      unpin the memory. The vfio_unmap_unpin() uses pfn_valid() before unpinning
      the memory. The pfn_valid() check was failing because encryption mask was
      part of the physical address returned. This resulted in the memory not
      being unpinned and therefore leaked after the guest terminates.
      
      The memory encryption mask must be cleared from the physical address in
      iommu_iova_to_phys().
      
      Fixes: 2543a786 ("iommu/amd: Allow the AMD IOMMU to work with memory encryption")
      Reported-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: <iommu@lists.linux-foundation.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: kvm@vger.kernel.org
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: <stable@vger.kernel.org> # 4.14+
      Signed-off-by: NBrijesh Singh <brijesh.singh@amd.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      b3e9b515
  9. 01 10月, 2018 12 次提交
    • R
      iommu/arm-smmu: Support non-strict mode · 44f6876a
      Robin Murphy 提交于
      All we need is to wire up .flush_iotlb_all properly and implement the
      domain attribute, and iommu-dma and io-pgtable will do the rest for us.
      The only real subtlety is documenting the barrier semantics we're
      introducing between io-pgtable and the drivers for non-strict flushes.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      44f6876a
    • R
      iommu/io-pgtable-arm-v7s: Add support for non-strict mode · b2dfeba6
      Robin Murphy 提交于
      As for LPAE, it's simply a case of skipping the leaf invalidation for a
      regular unmap, and ensuring that the one in split_blk_unmap() is paired
      with an explicit sync ASAP rather than relying on one which might only
      eventually happen way down the line.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      b2dfeba6
    • Z
      iommu/arm-smmu-v3: Add support for non-strict mode · 9662b99a
      Zhen Lei 提交于
      Now that io-pgtable knows how to dodge strict TLB maintenance, all
      that's left to do is bridge the gap between the IOMMU core requesting
      DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE for default domains, and showing the
      appropriate IO_PGTABLE_QUIRK_NON_STRICT flag to alloc_io_pgtable_ops().
      Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com>
      [rm: convert to domain attribute, tweak commit message]
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      9662b99a
    • Z
      iommu/io-pgtable-arm: Add support for non-strict mode · b6b65ca2
      Zhen Lei 提交于
      Non-strict mode is simply a case of skipping 'regular' leaf TLBIs, since
      the sync is already factored out into ops->iotlb_sync at the core API
      level. Non-leaf invalidations where we change the page table structure
      itself still have to be issued synchronously in order to maintain walk
      caches correctly.
      
      To save having to reason about it too much, make sure the invalidation
      in arm_lpae_split_blk_unmap() just performs its own unconditional sync
      to minimise the window in which we're technically violating the break-
      before-make requirement on a live mapping. This might work out redundant
      with an outer-level sync for strict unmaps, but we'll never be splitting
      blocks on a DMA fastpath anyway.
      Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com>
      [rm: tweak comment, commit message, split_blk_unmap logic and barriers]
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      b6b65ca2
    • Z
      iommu: Add "iommu.strict" command line option · 68a6efe8
      Zhen Lei 提交于
      Add a generic command line option to enable lazy unmapping via IOVA
      flush queues, which will initally be suuported by iommu-dma. This echoes
      the semantics of "intel_iommu=strict" (albeit with the opposite default
      value), but in the driver-agnostic fashion of "iommu.passthrough".
      Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com>
      [rm: move handling out of SMMUv3 driver, clean up documentation]
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      [will: dropped broken printk when parsing command-line option]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      68a6efe8
    • Z
      iommu/dma: Add support for non-strict mode · 2da274cd
      Zhen Lei 提交于
      With the flush queue infrastructure already abstracted into IOVA
      domains, hooking it up in iommu-dma is pretty simple. Since there is a
      degree of dependency on the IOMMU driver knowing what to do to play
      along, we key the whole thing off a domain attribute which will be set
      on default DMA ops domains to request non-strict invalidation. That way,
      drivers can indicate the appropriate support by acknowledging the
      attribute, and we can easily fall back to strict invalidation otherwise.
      
      The flush queue callback needs a handle on the iommu_domain which owns
      our cookie, so we have to add a pointer back to that, but neatly, that's
      also sufficient to indicate whether we're using a flush queue or not,
      and thus which way to release IOVAs. The only slight subtlety is
      switching __iommu_dma_unmap() from calling iommu_unmap() to explicit
      iommu_unmap_fast()/iommu_tlb_sync() so that we can elide the sync
      entirely in non-strict mode.
      Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com>
      [rm: convert to domain attribute, tweak comments and commit message]
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      2da274cd
    • W
      iommu/arm-smmu: Ensure that page-table updates are visible before TLBI · 7d321bd3
      Will Deacon 提交于
      The IO-pgtable code relies on the driver TLB invalidation callbacks to
      ensure that all page-table updates are visible to the IOMMU page-table
      walker.
      
      In the case that the page-table walker is cache-coherent, we cannot rely
      on an implicit DSB from the DMA-mapping code, so we must ensure that we
      execute a DSB in our tlb_add_flush() callback prior to triggering the
      invalidation.
      
      Cc: <stable@vger.kernel.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Fixes: 2df7a25c ("iommu/arm-smmu: Clean up DMA API usage")
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      7d321bd3
    • Z
      iommu/arm-smmu-v3: Implement flush_iotlb_all hook · 07fdef34
      Zhen Lei 提交于
      .flush_iotlb_all is currently stubbed to arm_smmu_iotlb_sync() since the
      only time it would ever need to actually do anything is for callers
      doing their own explicit batching, e.g.:
      
      	iommu_unmap_fast(domain, ...);
      	iommu_unmap_fast(domain, ...);
      	iommu_iotlb_flush_all(domain, ...);
      
      where since io-pgtable still issues the TLBI commands implicitly in the
      unmap instead of implementing .iotlb_range_add, the "flush" only needs
      to ensure completion of those already-in-flight invalidations.
      
      However, we're about to start using it in anger with flush queues, so
      let's get a proper implementation wired up.
      Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      [rm: document why it wasn't a bug]
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      07fdef34
    • Z
      iommu/arm-smmu-v3: Avoid back-to-back CMD_SYNC operations · 901510ee
      Zhen Lei 提交于
      Putting adjacent CMD_SYNCs into the command queue is nonsensical, but
      can happen when multiple CPUs are inserting commands. Rather than leave
      the poor old hardware to chew through these operations, we can instead
      drop the subsequent SYNCs and poll for completion of the first. This
      has been shown to improve IO performance under pressure, where the
      number of SYNC operations reduces by about a third:
      
      	CMD_SYNCs reduced:	19542181
      	CMD_SYNCs total:	58098548	(include reduced)
      	CMDs total:		116197099	(TLBI:SYNC about 1:1)
      Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      901510ee
    • Z
      iommu/arm-smmu-v3: Fix unexpected CMD_SYNC timeout · 0f02477d
      Zhen Lei 提交于
      The condition break condition of:
      
      	(int)(VAL - sync_idx) >= 0
      
      in the __arm_smmu_sync_poll_msi() polling loop requires that sync_idx
      must be increased monotonically according to the sequence of the CMDs in
      the cmdq.
      
      However, since the msidata is populated using atomic_inc_return_relaxed()
      before taking the command-queue spinlock, then the following scenario
      can occur:
      
      CPU0			CPU1
      msidata=0
      			msidata=1
      			insert cmd1
      insert cmd0
      			smmu execute cmd1
      smmu execute cmd0
      			poll timeout, because msidata=1 is overridden by
      			cmd0, that means VAL=0, sync_idx=1.
      
      This is not a functional problem, since the caller will eventually either
      timeout or exit due to another CMD_SYNC, however it's clearly not what
      the code is supposed to be doing. Fix it, by incrementing the sequence
      count with the command-queue lock held, allowing us to drop the atomic
      operations altogether.
      Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com>
      [will: dropped the specialised cmd building routine for now]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      0f02477d
    • R
      iommu/io-pgtable-arm: Fix race handling in split_blk_unmap() · 85c7a0f1
      Robin Murphy 提交于
      In removing the pagetable-wide lock, we gained the possibility of the
      vanishingly unlikely case where we have a race between two concurrent
      unmappers splitting the same block entry. The logic to handle this is
      fairly straightforward - whoever loses the race frees their partial
      next-level table and instead dereferences the winner's newly-installed
      entry in order to fall back to a regular unmap, which intentionally
      echoes the pre-existing case of recursively splitting a 1GB block down
      to 4KB pages by installing a full table of 2MB blocks first.
      
      Unfortunately, the chump who implemented that logic failed to update the
      condition check for that fallback, meaning that if said race occurs at
      the last level (where the loser's unmap_idx is valid) then the unmap
      won't actually happen. Fix that to properly account for both the race
      and recursive cases.
      
      Fixes: 2c3d273e ("iommu/io-pgtable-arm: Support lockless operation")
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      [will: re-jig control flow to avoid duplicate cmpxchg test]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      85c7a0f1
    • J
      iommu/arm-smmu-v3: Fix a couple of minor comment typos · 657135f3
      John Garry 提交于
      Fix some comment typos spotted.
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      657135f3
  10. 29 9月, 2018 1 次提交
  11. 27 9月, 2018 1 次提交
    • T
      s390: vfio-ap: base implementation of VFIO AP device driver · 1fde5734
      Tony Krowiak 提交于
      Introduces a new AP device driver. This device driver
      is built on the VFIO mediated device framework. The framework
      provides sysfs interfaces that facilitate passthrough
      access by guests to devices installed on the linux host.
      
      The VFIO AP device driver will serve two purposes:
      
      1. Provide the interfaces to reserve AP devices for exclusive
         use by KVM guests. This is accomplished by unbinding the
         devices to be reserved for guest usage from the zcrypt
         device driver and binding them to the VFIO AP device driver.
      
      2. Implements the functions, callbacks and sysfs attribute
         interfaces required to create one or more VFIO mediated
         devices each of which will be used to configure the AP
         matrix for a guest and serve as a file descriptor
         for facilitating communication between QEMU and the
         VFIO AP device driver.
      
      When the VFIO AP device driver is initialized:
      
      * It registers with the AP bus for control of type 10 (CEX4
        and newer) AP queue devices. This limitation was imposed
        due to:
      
        1. A desire to keep the code as simple as possible;
      
        2. Some older models are no longer supported by the kernel
           and others are getting close to end of service.
      
        3. A lack of older systems on which to test older devices.
      
        The probe and remove callbacks will be provided to support
        the binding/unbinding of AP queue devices to/from the VFIO
        AP device driver.
      
      * Creates a matrix device, /sys/devices/vfio_ap/matrix,
        to serve as the parent of the mediated devices created, one
        for each guest, and to hold the APQNs of the AP devices bound to
        the VFIO AP device driver.
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Tested-by: NMichael Mueller <mimu@linux.ibm.com>
      Tested-by: NFarhan Ali <alifm@linux.ibm.com>
      Acked-by: NDavid Hildenbrand <david@redhat.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Message-Id: <20180925231641.4954-5-akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      1fde5734
  12. 26 9月, 2018 1 次提交
  13. 25 9月, 2018 8 次提交