iommu/arm-smmu: preserve the far during fault handling
We're currently wiping out the `far' variable in our context fault handler when CONFIG_64BIT is enabled. Fix the bug. Change-Id: I86e57c7de8bfc10118f902d6702d3b9059a8762a Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This commit is contained in:
parent
94c0e12871
commit
923ea2cbed
1 changed files with 4 additions and 5 deletions
|
@ -848,8 +848,8 @@ static phys_addr_t arm_smmu_iova_to_phys_soft(struct iommu_domain *domain,
|
||||||
static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
|
static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
|
||||||
{
|
{
|
||||||
int flags, ret;
|
int flags, ret;
|
||||||
u32 fsr, far, fsynr, resume;
|
u32 fsr, fsynr, resume;
|
||||||
unsigned long iova;
|
unsigned long iova, far;
|
||||||
struct iommu_domain *domain = dev;
|
struct iommu_domain *domain = dev;
|
||||||
struct arm_smmu_domain *smmu_domain = domain->priv;
|
struct arm_smmu_domain *smmu_domain = domain->priv;
|
||||||
struct arm_smmu_cfg *cfg = &smmu_domain->cfg;
|
struct arm_smmu_cfg *cfg = &smmu_domain->cfg;
|
||||||
|
@ -880,11 +880,10 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
|
||||||
flags = fsynr & FSYNR0_WNR ? IOMMU_FAULT_WRITE : IOMMU_FAULT_READ;
|
flags = fsynr & FSYNR0_WNR ? IOMMU_FAULT_WRITE : IOMMU_FAULT_READ;
|
||||||
|
|
||||||
far = readl_relaxed(cb_base + ARM_SMMU_CB_FAR_LO);
|
far = readl_relaxed(cb_base + ARM_SMMU_CB_FAR_LO);
|
||||||
iova = far;
|
|
||||||
#ifdef CONFIG_64BIT
|
#ifdef CONFIG_64BIT
|
||||||
far = readl_relaxed(cb_base + ARM_SMMU_CB_FAR_HI);
|
far |= ((u64)readl_relaxed(cb_base + ARM_SMMU_CB_FAR_HI)) << 32;
|
||||||
iova |= ((unsigned long)far << 32);
|
|
||||||
#endif
|
#endif
|
||||||
|
iova = far;
|
||||||
|
|
||||||
phys_soft = arm_smmu_iova_to_phys_soft(domain, iova);
|
phys_soft = arm_smmu_iova_to_phys_soft(domain, iova);
|
||||||
if (!report_iommu_fault(domain, smmu->dev, iova, flags)) {
|
if (!report_iommu_fault(domain, smmu->dev, iova, flags)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue