Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932516AbaJUMX0 (ORCPT ); Tue, 21 Oct 2014 08:23:26 -0400 Received: from mail-ob0-f172.google.com ([209.85.214.172]:36885 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932499AbaJUMXV (ORCPT ); Tue, 21 Oct 2014 08:23:21 -0400 MIME-Version: 1.0 X-Originating-IP: [2a01:e35:2434:4600:6596:22b6:3872:9902] In-Reply-To: References: <1413205748-6300-1-git-send-email-a.motakis@virtualopensystems.com> <1413205748-6300-3-git-send-email-a.motakis@virtualopensystems.com> From: Antonios Motakis Date: Tue, 21 Oct 2014 14:23:00 +0200 Message-ID: Subject: Re: [PATCH 2/5] vfio: introduce the VFIO_DMA_MAP_FLAG_NOEXEC flag To: Andy Lutomirski Cc: kvm-arm , Linux IOMMU , Alex Williamson , Will Deacon , VirtualOpenSystems Technical Team , Christoffer Dall , Eric Auger , Kim Phillips , Marc Zyngier , "open list:VFIO DRIVER" , "open list:ABI/API" , open list Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 20, 2014 at 11:37 PM, Andy Lutomirski wrote: > On Mon, Oct 13, 2014 at 6:09 AM, Antonios Motakis > wrote: >> We introduce the VFIO_DMA_MAP_FLAG_NOEXEC flag to the VFIO dma map call, >> and expose its availability via the capability VFIO_DMA_NOEXEC_IOMMU. >> This way the user can control whether the XN flag will be set on the >> requested mappings. The IOMMU_NOEXEC flag needs to be available for all >> the IOMMUs of the container used. > > Since you sent this to the linux-api list, I'll bite: what's the XN > flag? I know what PROT_EXEC does when you mmap something, and I > presume that vfio is mmappable, but I don't actually have any clue > what this patch does. > > I assume that this does not have anything to do with a non-CPU DMA > master executing code in main memory, because that makes rather little > sense. (Or maybe it really does, in which case: weird.) It does actually. For example, the ARM PL330 DMA controller will fetch from memory code with DMA instructions, and it will respect this flag. It is not code that can be executed on the CPU of course, but it is executable on the DMAC. > > --Andy -- Antonios Motakis Virtual Open Systems -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/