Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932463AbcLGPPR (ORCPT ); Wed, 7 Dec 2016 10:15:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42208 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932192AbcLGPPP (ORCPT ); Wed, 7 Dec 2016 10:15:15 -0500 Subject: Re: [RFC v3 05/10] iommu: Do not map reserved regions To: Robin Murphy , eric.auger.pro@gmail.com, christoffer.dall@linaro.org, marc.zyngier@arm.com, alex.williamson@redhat.com, will.deacon@arm.com, joro@8bytes.org, tglx@linutronix.de, jason@lakedaemon.net, linux-arm-kernel@lists.infradead.org References: <1479215363-2898-1-git-send-email-eric.auger@redhat.com> <1479215363-2898-6-git-send-email-eric.auger@redhat.com> Cc: drjones@redhat.com, kvm@vger.kernel.org, punit.agrawal@arm.com, linux-kernel@vger.kernel.org, diana.craciun@nxp.com, iommu@lists.linux-foundation.org, pranav.sawargaonkar@gmail.com From: Auger Eric Message-ID: Date: Wed, 7 Dec 2016 16:15:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 07 Dec 2016 15:15:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1540 Lines: 49 Hi Robin On 06/12/2016 18:36, Robin Murphy wrote: > On 15/11/16 13:09, Eric Auger wrote: >> As we introduced IOMMU_RESV_NOMAP and IOMMU_RESV_MSI regions, >> let's prevent those new regions from being mapped. >> >> Signed-off-by: Eric Auger >> --- >> drivers/iommu/iommu.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c >> index 6ee529f..a4530ad 100644 >> --- a/drivers/iommu/iommu.c >> +++ b/drivers/iommu/iommu.c >> @@ -343,6 +343,9 @@ static int iommu_group_create_direct_mappings(struct iommu_group *group, >> start = ALIGN(entry->start, pg_size); >> end = ALIGN(entry->start + entry->length, pg_size); >> >> + if (entry->prot & IOMMU_RESV_MASK) > > This seems to be the only place that this mask is used, and frankly I > think it's less clear than simply "(IOMMU_RESV_NOMAP | IOMMU_RESV_MSI)" > would be, at which point we may as well drop the mask and special value > trickery altogether. Plus, per my previous comment, if it were to be "if > (entry->type != )" instead, that's about as obvious > as it can get. OK I will add this new type entry in the reserved window struct. thanks Eric > > Robin. > >> + continue; >> + >> for (addr = start; addr < end; addr += pg_size) { >> phys_addr_t phys_addr; >> >> > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >