[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140616150403.GO16758@arm.com>
Date: Mon, 16 Jun 2014 16:04:03 +0100
From: Will Deacon <will.deacon@....com>
To: Antonios Motakis <a.motakis@...tualopensystems.com>
Cc: "alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"kvmarm@...ts.cs.columbia.edu" <kvmarm@...ts.cs.columbia.edu>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"tech@...tualopensystems.com" <tech@...tualopensystems.com>,
"a.rigo@...tualopensystems.com" <a.rigo@...tualopensystems.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"christoffer.dall@...aro.org" <christoffer.dall@...aro.org>,
"kim.phillips@...escale.com" <kim.phillips@...escale.com>,
"stuart.yoder@...escale.com" <stuart.yoder@...escale.com>,
"eric.auger@...aro.org" <eric.auger@...aro.org>,
Joerg Roedel <joro@...tes.org>,
Varun Sethi <Varun.Sethi@...escale.com>,
Alexey Kardashevskiy <aik@...abs.ru>,
Shuah Khan <shuah.kh@...sung.com>,
"Upinder Malhi (umalhi)" <umalhi@...co.com>,
"moderated list:ARM SMMU DRIVER"
<linux-arm-kernel@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v6 01/20] iommu/arm-smmu: change IOMMU_EXEC to
IOMMU_NOEXEC
On Thu, Jun 05, 2014 at 06:03:09PM +0100, Antonios Motakis wrote:
> Exposing the XN flag of the SMMU driver as IOMMU_NOEXEC instead of
> IOMMU_EXEC makes it enforceable, since for IOMMUs that don't support
> the XN flag pages will always be executable.
>
> Signed-off-by: Antonios Motakis <a.motakis@...tualopensystems.com>
> ---
> drivers/iommu/arm-smmu.c | 2 +-
> include/linux/iommu.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 647c3c7..d5a2200 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1294,7 +1294,7 @@ static int arm_smmu_alloc_init_pte(struct arm_smmu_device *smmu, pmd_t *pmd,
> }
>
> /* If no access, create a faulting entry to avoid TLB fills */
> - if (prot & IOMMU_EXEC)
> + if (!(prot & IOMMU_NOEXEC))
> pteval &= ~ARM_SMMU_PTE_XN;
It's probably simpler to change the logic so that we initialise pteval
without XN set, then set it if IOMMU_NOEXEC is set (rather than set it
by default, then clear it if NOEXEC is not set).
Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists