08 Nov, 2016

3 commits

  • When we iterate a master's config entries, what we generally care
    about is the entry's stream map index, rather than the entry index
    itself, so it's nice to have the iterator automatically assign the
    former from the latter. Unfortunately, booting with KASAN reveals
    the oversight that using a simple comma operator results in the
    entry index being dereferenced before being checked for validity,
    so we always access one element past the end of the fwspec array.

    Flip things around so that the check always happens before the index
    may be dereferenced.

    Fixes: adfec2e709d2 ("iommu/arm-smmu: Convert to iommu_fwspec")
    Reported-by: Mark Rutland
    Signed-off-by: Robin Murphy
    Acked-by: Will Deacon
    Signed-off-by: Joerg Roedel

    Robin Murphy
     
  • We seem to have forgotten to check that iommu_fwspecs actually belong to
    us before we go ahead and dereference their private data. Oops.

    Fixes: 021bb8420d44 ("iommu/arm-smmu: Wire up generic configuration support")
    Signed-off-by: Robin Murphy
    Signed-off-by: Joerg Roedel

    Robin Murphy
     
  • The 32-bit ARM DMA configuration code predates the IOMMU core's default
    domain functionality, and instead relies on allocating its own domains
    and attaching any devices using the generic IOMMU binding to them.
    Unfortunately, it does this relatively early on in the creation of the
    device, before we've seen our add_device callback, which leads us to
    attempt to operate on a half-configured master.

    To avoid a crash, check for this situation on attach, but refuse to
    play, as there's nothing we can do. This at least allows VFIO to keep
    working for people who update their 32-bit DTs to the generic binding,
    albeit with a few (innocuous) warnings from the DMA layer on boot.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon
    Signed-off-by: Joerg Roedel

    Robin Murphy
     

16 Sep, 2016

12 commits

  • For non-aperture-based IOMMUs, the domain geometry seems to have become
    the de-facto way of indicating the input address space size. That is
    quite a useful thing from the users' perspective, so let's do the same.

    Reviewed-by: Eric Auger
    Tested-by: Lorenzo Pieralisi
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • With everything else now in place, fill in an of_xlate callback and the
    appropriate registration to plumb into the generic configuration
    machinery, and watch everything just work.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • In the final step of preparation for full generic configuration support,
    swap our fixed-size master_cfg for the generic iommu_fwspec. For the
    legacy DT bindings, the driver simply gets to act as its own 'firmware'.
    Farewell, arbitrary MAX_MASTER_STREAMIDS!

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Stream Match Registers are one of the more awkward parts of the SMMUv2
    architecture; there are typically never enough to assign one to each
    stream ID in the system, and configuring them such that a single ID
    matches multiple entries is catastrophically bad - at best, every
    transaction raises a global fault; at worst, they go *somewhere*.

    To address the former issue, we can mask ID bits such that a single
    register may be used to match multiple IDs belonging to the same device
    or group, but doing so also heightens the risk of the latter problem
    (which can be nasty to debug).

    Tackle both problems at once by replacing the simple bitmap allocator
    with something much cleverer. Now that we have convenient in-memory
    representations of the stream mapping table, it becomes straightforward
    to properly validate new SMR entries against the current state, opening
    the door to arbitrary masking and SMR sharing.

    Another feature which falls out of this is that with IDs shared by
    separate devices being automatically accounted for, simply associating a
    group pointer with the S2CR offers appropriate group allocation almost
    for free, so hook that up in the process.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • We iterate over the SMEs associated with a master config quite a lot in
    various places, and are about to do so even more. Let's wrap the idiom
    in a handy iterator macro before the repetition gets out of hand.

    Tested-by: Lorenzo Pieralisi
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Simplify things somewhat by stashing our arm_smmu_device instance in
    drvdata, so that it's readily available to our driver model callbacks.
    Then we can excise the private list entirely, since the driver core
    already has a perfectly good list of SMMU devices we can use in the one
    instance we actually need to. Finally, make a further modest code saving
    with the relatively new of_device_get_match_data() helper.

    Tested-by: Lorenzo Pieralisi
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • To be able to support the generic bindings and handle of_xlate() calls,
    we need to be able to associate SMMUs and stream IDs directly with
    devices *before* allocating IOMMU groups. Furthermore, to support real
    default domains with multi-device groups we also have to handle domain
    attach on a per-device basis, as the "whole group at a time" assumption
    fails to properly handle subsequent devices added to a group after the
    first has already triggered default domain creation and attachment.

    To that end, use the now-vacant dev->archdata.iommu field for easy
    config and SMMU instance lookup, and unify config management by chopping
    down the platform-device-specific tree and probing the "mmu-masters"
    property on-demand instead. This may add a bit of one-off overhead to
    initially adding a new device, but we're about to deprecate that binding
    in favour of the inherently-more-efficient generic ones anyway.

    For the sake of simplicity, this patch does temporarily regress the case
    of aliasing PCI devices by losing the duplicate stream ID detection that
    the previous per-group config had. Stay tuned, because we'll be back to
    fix that in a better and more general way momentarily...

    Tested-by: Lorenzo Pieralisi
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Making S2CRs first-class citizens within the driver with a high-level
    representation of their state offers a neat solution to a few problems:

    Firstly, the information about which context a device's stream IDs are
    associated with is already present by necessity in the S2CR. With that
    state easily accessible we can refer directly to it and obviate the need
    to track an IOMMU domain in each device's archdata (its earlier purpose
    of enforcing correct attachment of multi-device groups now being handled
    by the IOMMU core itself).

    Secondly, the core API now deprecates explicit domain detach and expects
    domain attach to move devices smoothly from one domain to another; for
    SMMUv2, this notion maps directly to simply rewriting the S2CRs assigned
    to the device. By giving the driver a suitable abstraction of those
    S2CRs to work with, we can massively reduce the overhead of the current
    heavy-handed "detach, free resources, reallocate resources, attach"
    approach.

    Thirdly, making the software state hardware-shaped and attached to the
    SMMU instance once again makes suspend/resume of this register group
    that much simpler to implement in future.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • In order to consider SMR masking, we really want to be able to validate
    ID/mask pairs against existing SMR contents to prevent stream match
    conflicts, which at best would cause transactions to fault unexpectedly,
    and at worst lead to silent unpredictable behaviour. With our SMMU
    instance data holding only an allocator bitmap, and the SMR values
    themselves scattered across master configs hanging off devices which we
    may have no way of finding, there's essentially no way short of digging
    everything back out of the hardware. Similarly, the thought of power
    management ops to support suspend/resume faces the exact same problem.

    By massaging the software state into a closer shape to the underlying
    hardware, everything comes together quite nicely; the allocator and the
    high-level view of the data become a single centralised state which we
    can easily keep track of, and to which any updates can be validated in
    full before being synchronised to the hardware itself.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Rather than assuming fixed worst-case values for stream IDs and SMR
    masks, keep track of whatever implemented bits the hardware actually
    reports. This also obviates the slightly questionable validation of SMR
    fields in isolation - rather than aborting the whole SMMU probe for a
    hardware configuration which is still architecturally valid, we can
    simply refuse masters later if they try to claim an unrepresentable ID
    or mask (which almost certainly implies a DT error anyway).

    Acked-by: Will Deacon
    Tested-by: Lorenzo Pieralisi
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Fill in the last bits of machinery required to drive a stage 1 context
    bank in v7 short descriptor format. By default we'll prefer to use it
    only when the CPUs are also using the same format, such that we're
    guaranteed that everything will be strictly 32-bit.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • There is no need to call devm_free_irq when driver detach.
    devres_release_all which is called after 'drv->remove' will
    release all managed resources.

    Signed-off-by: Peng Fan
    Reviewed-by: Robin Murphy
    Cc: Will Deacon
    Signed-off-by: Will Deacon

    Peng Fan
     

19 Aug, 2016

1 commit

  • Enabling stalling faults can result in hardware deadlock on poorly
    designed systems, particularly those with a PCI root complex upstream of
    the SMMU.

    Although it's not really Linux's job to save hardware integrators from
    their own misfortune, it *is* our job to stop userspace (e.g. VFIO
    clients) from hosing the system for everybody else, even if they might
    already be required to have elevated privileges.

    Given that the fault handling code currently executes entirely in IRQ
    context, there is nothing that can sensibly be done to recover from
    things like page faults anyway, so let's rip this code out for now and
    avoid the potential for deadlock.

    Cc:
    Fixes: 48ec83bcbcf5 ("iommu/arm-smmu: Add initial driver support for ARM SMMUv3 devices")
    Reported-by: Matt Evans
    Signed-off-by: Will Deacon

    Will Deacon
     

07 Jul, 2016

1 commit


01 Jul, 2016

1 commit

  • The PCIe ACS capability will affect the layout of iommu groups.
    Generally speaking, if the path from root port to the PCIe device
    is ACS enabled, the iommu will create a single iommu group for this
    PCIe device. If all PCIe devices on the path are ACS enabled then
    Linux can determine this path is ACS enabled.

    Linux use two PCIe configuration registers to determine the ACS
    status of PCIe devices:
    ACS Capability Register and ACS Control Register.

    The first register is used to check the implementation of ACS function
    of a PCIe device, the second register is used to check the enable status
    of ACS function. If one PCIe device has implemented and enabled the ACS
    function then Linux will determine this PCIe device enabled ACS.

    From the Chapter:6.12 of PCI Express Base Specification Revision 3.1a,
    we can find that when a PCIe device implements ACS function, the enable
    status is set to disabled by default and can be enabled by ACS-aware
    software.

    ACS will affect the iommu groups topology, so, the iommu driver is
    ACS-aware software. This patch adds a call to pci_request_acs() to the
    arm-smmu driver to enable the ACS function in PCIe devices that support
    it, when they get probed.

    Reviewed-by: Robin Murphy
    Reviewed-by: Eric Auger
    Signed-off-by: Wei Chen
    Signed-off-by: Will Deacon

    Wei Chen
     

28 May, 2016

1 commit

  • Most users of IS_ERR_VALUE() in the kernel are wrong, as they
    pass an 'int' into a function that takes an 'unsigned long'
    argument. This happens to work because the type is sign-extended
    on 64-bit architectures before it gets converted into an
    unsigned type.

    However, anything that passes an 'unsigned short' or 'unsigned int'
    argument into IS_ERR_VALUE() is guaranteed to be broken, as are
    8-bit integers and types that are wider than 'unsigned long'.

    Andrzej Hajda has already fixed a lot of the worst abusers that
    were causing actual bugs, but it would be nice to prevent any
    users that are not passing 'unsigned long' arguments.

    This patch changes all users of IS_ERR_VALUE() that I could find
    on 32-bit ARM randconfig builds and x86 allmodconfig. For the
    moment, this doesn't change the definition of IS_ERR_VALUE()
    because there are probably still architecture specific users
    elsewhere.

    Almost all the warnings I got are for files that are better off
    using 'if (err)' or 'if (err < 0)'.
    The only legitimate user I could find that we get a warning for
    is the (32-bit only) freescale fman driver, so I did not remove
    the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
    For 9pfs, I just worked around one user whose calling conventions
    are so obscure that I did not dare change the behavior.

    I was using this definition for testing:

    #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
    unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))

    which ends up making all 16-bit or wider types work correctly with
    the most plausible interpretation of what IS_ERR_VALUE() was supposed
    to return according to its users, but also causes a compile-time
    warning for any users that do not pass an 'unsigned long' argument.

    I suggested this approach earlier this year, but back then we ended
    up deciding to just fix the users that are obviously broken. After
    the initial warning that caused me to get involved in the discussion
    (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
    asked me to send the whole thing again.

    [ Updated the 9p parts as per Al Viro - Linus ]

    Signed-off-by: Arnd Bergmann
    Cc: Andrzej Hajda
    Cc: Andrew Morton
    Link: https://lkml.org/lkml/2016/1/7/363
    Link: https://lkml.org/lkml/2016/5/27/486
    Acked-by: Srinivas Kandagatla # For nvmem part
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     

21 May, 2016

1 commit

  • Pull devicetree updates from Rob Herring:

    - Rewrite of the unflattening code to avoid recursion and lessen the
    stack usage.

    - Rewrite of the phandle args parsing code to get rid of the fixed args
    size. This is needed for IOMMU code.

    - Sync to latest dtc which adds more dts style checking. These
    warnings are enabled with "W=1" compiles.

    - Tegra documentation updates related to the above warnings.

    - A bunch of spelling and other doc fixes.

    - Various vendor prefix additions.

    * tag 'devicetree-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (52 commits)
    devicetree: Add Creative Technology vendor id
    gpio: dt-bindings: add ibm,ppc4xx-gpio binding
    of/unittest: Remove unnecessary module.h header inclusion
    drivers/of: Fix build warning in populate_node()
    drivers/of: Fix depth when unflattening devicetree
    of: dynamic: changeset prop-update revert fix
    drivers/of: Export of_detach_node()
    drivers/of: Return allocated memory from of_fdt_unflatten_tree()
    drivers/of: Specify parent node in of_fdt_unflatten_tree()
    drivers/of: Rename unflatten_dt_node()
    drivers/of: Avoid recursively calling unflatten_dt_node()
    drivers/of: Split unflatten_dt_node()
    of: include errno.h in of_graph.h
    of: document refcount incrementation of of_get_cpu_node()
    Documentation: dt: soc: fix spelling mistakes
    Documentation: dt: power: fix spelling mistake
    Documentation: dt: pinctrl: fix spelling mistake
    Documentation: dt: opp: fix spelling mistake
    Documentation: dt: net: fix spelling mistakes
    Documentation: dt: mtd: fix spelling mistake
    ...

    Linus Torvalds
     

10 May, 2016

1 commit

  • Now that we can accurately reflect the context format we choose for each
    domain, do that instead of imposing the global lowest-common-denominator
    restriction and potentially ending up with nothing. We currently have a
    strict 1:1 correspondence between domains and context banks, so we don't
    need to entertain the possibility of multiple formats _within_ a domain.

    Signed-off-by: Will Deacon
    [rm: split from original patch, added SMMUv3]
    Signed-off-by: Robin Murphy
    Signed-off-by: Joerg Roedel

    Robin Murphy
     

09 May, 2016

1 commit


04 May, 2016

9 commits

  • According MMU-500r2 TRM, section 3.7.1 Auxiliary Control registers,
    You can modify ACTLR only when the ACR.CACHE_LOCK bit is 0.

    So before clearing ARM_MMU500_ACTLR_CPRE of each context bank,
    need clear CACHE_LOCK bit of ACR register first.

    Since CACHE_LOCK bit is only present in MMU-500r2 onwards,
    need to check the major number of IDR7.

    Reviewed-by: Robin Murphy
    Signed-off-by: Peng Fan
    Signed-off-by: Will Deacon

    Peng Fan
     
  • The 64KB Translation Granule Supplement to the SMMUv1 architecture
    allows an SMMUv1 implementation to support 64KB pages for stage 2
    translations, using a constrained VMSAv8 descriptor format limited
    to 40-bit addresses. Now that we can freely mix and match context
    formats, we can actually handle having 4KB pages via an AArch32
    context but 64KB pages via an AArch64 context, so plumb it in.

    It is assumed that any implementations will have hardware capabilities
    matching the format constraints, thus obviating the need for excessive
    sanity-checking; this is the case for MMU-401, the only ARM Ltd.
    implementation.

    CC: Eric Auger
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • The way the driver currently forces an AArch32 or AArch64 context format
    based on the kernel config and SMMU architecture version is suboptimal,
    in that it makes it very hard to support oddball mix-and-match cases
    like the SMMUv1 64KB supplement, or situations where the reduced table
    depth of an AArch32 short descriptor context may be desirable under an
    AArch64 kernel. It also only happens to work on current implementations
    which do support all the relevant formats.

    Introduce an explicit notion of context format, so we can manage that
    independently and get rid of the inflexible #ifdeffery.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • With {read,write}q_relaxed now able to fall back to the common
    nonatomic-hi-lo helper, make use of that so that we don't have to
    open-code our own. In the process, also convert the other remaining
    split accesses, and repurpose the custom accessor to smooth out the
    couple of troublesome instances where we really want to avoid
    nonatomic writes (and a 64-bit access is unnecessary in the 32-bit
    context formats we would use on a 32-bit CPU).

    This paves the way for getting rid of some of the assumptions currently
    baked into the driver which make it really awkward to use 32-bit context
    formats with SMMUv2 under a 64-bit kernel.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • MMU-500 erratum #841119 is tickled by a particular set of circumstances
    interacting with the next-page prefetcher. Since said prefetcher is
    quite dumb and actually detrimental to performance in some cases (by
    causing unwanted TLB evictions for non-sequential access patterns), we
    lose very little by turning it off, and what we gain is a guarantee that
    the erratum is never hit.

    As a bonus, the same workaround will also prevent erratum #826419 once
    v7 short descriptor support is implemented.

    CC: Catalin Marinas
    CC: Will Deacon
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • With a framework for implementation-specific funtionality in place, the
    currently-FDT-dependent ThunderX workaround gets to be the first user.

    Acked-by: Tirumalesh Chalamarla
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • As the inevitable reality of implementation-specific errata workarounds
    begin to accrue alongside our integration quirk handling, it's about
    time the driver had a decent way of keeping track. Extend the per-SMMU
    data so we can identify specific implementations in an efficient and
    firmware-agnostic manner.

    Acked-by: Tirumalesh Chalamarla
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Due to erratum #27704, the CN88xx SMMUv2 implementation supports only
    shared ASID and VMID numberspaces.

    This patch ensures that ASID and VMIDs are unique across all SMMU
    instances on affected Cavium systems.

    Signed-off-by: Tirumalesh Chalamarla
    Signed-off-by: Akula Geethasowjanya
    [will: commit message, comments and formatting]
    Signed-off-by: Will Deacon

    Tirumalesh Chalamarla
     
  • This patch adds support for 16-bit VMIDs on implementations of SMMUv2
    that support it.

    Signed-off-by: Tirumalesh Chalamarla
    [will: commit messsage and comments]
    Signed-off-by: Will Deacon

    Tirumalesh Chalamarla
     

21 Apr, 2016

2 commits

  • Until we get fully plumbed into of_iommu_configure, our default
    IOMMU_DOMAIN_DMA domains just bypass translation. Since we achieve that
    by leaving the stream table entries set to bypass instead of pointing at
    a translation context, the context bank we allocate for the domain is
    completely wasted. Context banks are typically a rather limited
    resource, so don't hog ones we don't need.

    Reported-by: Eric Auger
    Tested-by: Eric Auger
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon
    Signed-off-by: Joerg Roedel

    Robin Murphy
     
  • Commit cbf8277ef456 ("iommu/arm-smmu: Treat IOMMU_DOMAIN_DMA as bypass
    for now") ignores requests to attach a device to the default domain
    since, without IOMMU-basked DMA ops available everywhere, the default
    domain will just lead to unexpected transaction faults being reported.

    Unfortunately, the way this was implemented on SMMUv2 causes a
    regression with VFIO PCI device passthrough under KVM on AMD Seattle.
    On this system, the host controller device is associated with both a
    pci_dev *and* a platform_device, and can therefore end up with duplicate
    SMR entries, resulting in a stream-match conflict at runtime.

    This patch amends the original fix so that attaching to IOMMU_DOMAIN_DMA
    is rejected even before configuring the SMRs. This restores the old
    behaviour for now, but we'll need to look at handing host controllers
    specially when we come to supporting the default domain fully.

    Reported-by: Eric Auger
    Tested-by: Eric Auger
    Tested-by: Yang Shi
    Signed-off-by: Will Deacon
    Signed-off-by: Joerg Roedel

    Will Deacon
     

20 Apr, 2016

1 commit


18 Feb, 2016

5 commits

  • Until all upstream devices have their DMA ops swizzled to point at the
    SMMU, we need to treat the IOMMU_DOMAIN_DMA domain as bypass to avoid
    putting devices into an empty address space when detaching from VFIO.

    Signed-off-by: Will Deacon

    Will Deacon
     
  • The ARM SMMU attach_dev implementations returns -EEXIST if the device
    being attached is already attached to a domain. This doesn't play nicely
    with the default domain, resulting in splats such as:

    WARNING: at drivers/iommu/iommu.c:1257
    Modules linked in:

    CPU: 3 PID: 1939 Comm: virtio-net-tx Tainted: G S 4.5.0-rc4+ #1
    Hardware name: FVP Base (DT)
    task: ffffffc87a9d0000 ti: ffffffc07a278000 task.ti: ffffffc07a278000
    PC is at __iommu_detach_group+0x68/0xe8
    LR is at __iommu_detach_group+0x48/0xe8

    This patch fixes the problem by forcefully detaching the device from
    its old domain, if present, when attaching to a new one. The unused
    ->detach_dev callback is also removed the iommu_ops structures.

    Signed-off-by: Will Deacon

    Will Deacon
     
  • Borrow the disable_bypass parameter from the SMMUv3 driver as a handy
    debugging/security feature so that unmatched stream IDs (i.e. devices
    not attached to an IOMMU domain) may be configured to fault.

    Rather than introduce unsightly inconsistency, or repeat the existing
    unnecessary use of module_param_named(), fix that as well in passing.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • With DMA mapping ops provided by the iommu-dma code, only a minimal
    contribution from the IOMMU driver is needed to create a suitable
    DMA-API domain for them to use. Implement this for the ARM SMMUs.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • The IOMMU API has no concept of privilege so assumes all devices and
    mappings are equal, and indeed most non-CPU master devices on an AMBA
    interconnect make little use of the attribute bits on the bus thus by
    default perform unprivileged data accesses.

    Some devices, however, believe themselves more equal than others, such
    as programmable DMA controllers whose 'master' thread issues bus
    transactions marked as privileged instruction fetches, while the data
    accesses of its channel threads (under the control of Linux, at least)
    are marked as unprivileged. This poses a problem for implementing the
    DMA API on an IOMMU conforming to ARM VMSAv8, under which a page that is
    unprivileged-writeable is also implicitly privileged-execute-never.
    Given that, there is no one set of attributes with which iommu_map() can
    implement, say, dma_alloc_coherent() that will allow every possible type
    of access without something running into unexecepted permission faults.

    Fortunately the SMMU architecture provides a means to mitigate such
    issues by overriding the incoming attributes of a transaction; make use
    of that to strip the privileged/unprivileged status off incoming
    transactions, leaving just the instruction/data dichotomy which the
    IOMMU API does at least understand; Four states good, two states better.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     

17 Dec, 2015

1 commit

  • When invalidating an IOVA range potentially spanning multiple pages,
    such as when removing an entire intermediate-level table, we currently
    only issue an invalidation for the first IOVA of that range. Since the
    architecture specifies that address-based TLB maintenance operations
    target a single entry, an SMMU could feasibly retain live entries for
    subsequent pages within that unmapped range, which is not good.

    Make sure we hit every possible entry by iterating over the whole range
    at the granularity provided by the pagetable implementation.

    Signed-off-by: Robin Murphy
    [will: added missing semicolons...]
    Signed-off-by: Will Deacon

    Robin Murphy