From patchwork Thu Jun 5 17:03:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonios Motakis X-Patchwork-Id: 4307471 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B06569F387 for ; Thu, 5 Jun 2014 17:06:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4C25201E4 for ; Thu, 5 Jun 2014 17:06:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A49D201B9 for ; Thu, 5 Jun 2014 17:06:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wsb5q-0002Kl-CN; Thu, 05 Jun 2014 17:04:46 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wsb5k-0002Bf-Jz for linux-arm-kernel@lists.infradead.org; Thu, 05 Jun 2014 17:04:44 +0000 Received: by mail-wi0-f179.google.com with SMTP id bs8so3934697wib.6 for ; Thu, 05 Jun 2014 10:04:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5c33YO4CYXWZbg6o1zsplt8ldvQeYmc2NWF5030Aoas=; b=NlMZ8BVTSHVoKOzoKm2PaywVHNkYyoHcxpaqtifvolyoE1pFcd1PhUQU0OYhfkl+/A aTDDpKjoItlZIb1gxu9l7oHOigJgyyOqvpa9gQa1i7FHlLGmDl/AfF7Nz8/IKdwT+pvv 34UiA64aP1GyHkOCJLg6mcz3u8YVOAxGDJHqeKxRiCh6PMRjjOH6OcklIYZFw5LkREru sZbVpBjI8LmcokbCBn848O3YaLfL9OV9lXcEKdKh7iZ5Y0pgWLZmzxk/UFHbB7QfRWEv 4jxtFKdkRKzj0UoYRMOZemczsQas42mMhjvhvPW4fmdG/9W9XijISPEzqAGR5sJlA/FU JkBg== X-Gm-Message-State: ALoCoQkif0SHWuz7YUrt3qXpMT2hX49IBZh/DWhWXliO5o2riX1fd4YD4TDTs2uQBG+PzT4KN7xE X-Received: by 10.194.243.3 with SMTP id wu3mr84067454wjc.29.1401987857056; Thu, 05 Jun 2014 10:04:17 -0700 (PDT) Received: from localhost.localdomain (home.tvelocity.eu. [82.67.68.96]) by mx.google.com with ESMTPSA id ch16sm8777323wjb.25.2014.06.05.10.04.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Jun 2014 10:04:16 -0700 (PDT) From: Antonios Motakis To: alex.williamson@redhat.com, kvmarm@lists.cs.columbia.edu, iommu@lists.linux-foundation.org Subject: [RFC PATCH v6 03/20] iommu/arm-smmu: add IOMMU_CAP_NOEXEC to the ARM SMMU driver Date: Thu, 5 Jun 2014 19:03:11 +0200 Message-Id: <1401987808-23596-4-git-send-email-a.motakis@virtualopensystems.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1401987808-23596-1-git-send-email-a.motakis@virtualopensystems.com> References: <1401987808-23596-1-git-send-email-a.motakis@virtualopensystems.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140605_100440_806042_B3F1B116 X-CRM114-Status: UNSURE ( 9.44 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: kim.phillips@freescale.com, kvm@vger.kernel.org, eric.auger@linaro.org, open list , Joerg Roedel , will.deacon@arm.com, a.rigo@virtualopensystems.com, stuart.yoder@freescale.com, "moderated list:ARM SMMU DRIVER" , Antonios Motakis , tech@virtualopensystems.com, christoffer.dall@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ARM SMMU supports the IOMMU_NOEXEC protection flag. Add the corresponding IOMMU capability. Signed-off-by: Antonios Motakis --- drivers/iommu/arm-smmu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index d5a2200..15ab2af 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1544,6 +1544,8 @@ static int arm_smmu_domain_has_cap(struct iommu_domain *domain, if (smmu_domain->root_cfg.smmu->features & ARM_SMMU_FEAT_COHERENT_WALK) caps |= IOMMU_CAP_CACHE_COHERENCY; + caps |= IOMMU_CAP_NOEXEC; + return !!(cap & caps); }