From patchwork Wed Apr 15 01:02:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 11489501 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3A11912 for ; Wed, 15 Apr 2020 01:04:53 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C07F72072D for ; Wed, 15 Apr 2020 01:04:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y4Bds0yc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C07F72072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jOWSc-0001Vj-PU; Wed, 15 Apr 2020 01:03:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jOWSb-0001Ty-51 for xen-devel@lists.xenproject.org; Wed, 15 Apr 2020 01:03:25 +0000 X-Inumbo-ID: da691cc7-7eb4-11ea-89ec-12813bfff9fa Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id da691cc7-7eb4-11ea-89ec-12813bfff9fa; Wed, 15 Apr 2020 01:03:02 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 710A020936; Wed, 15 Apr 2020 01:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586912581; bh=M3mtuPpEn22GeE50cx6N0881izwzd4quzv104vMzFfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y4Bds0ycsmoxzcYjuu7OsHu5scVsagsNNWhTxdJxA3UzS4VXkzQVX1gtf16K+pT0C EujAoCXu6f9tdHNkM1m3eLInwHaT1nfmtJzch8OE57qrxMvXxuk6AxUuFyDVwaIA6v dzCI8ezkbrBcBrKW4e2RlvikiZL7jpamaOvpcidQ= From: Stefano Stabellini To: xen-devel@lists.xenproject.org Subject: [PATCH 11/12] xen/arm: if xen_force don't try to setup the IOMMU Date: Tue, 14 Apr 2020 18:02:54 -0700 Message-Id: <20200415010255.10081-11-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Volodymyr_Babchuk@epam.com, sstabellini@kernel.org, julien@xen.org, Stefano Stabellini Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" If xen_force (which means xen,force-assign-without-iommu was requested) don't try to add the device to the IOMMU. Return early instead. Signed-off-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 9bc0b810a7..d0fc497d07 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1884,12 +1884,14 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo, if ( res < 0 ) return res; + if ( xen_force ) + return 0; + res = iommu_add_dt_device(node); if ( res < 0 ) return res; - /* If xen_force, we allow assignment of devices without IOMMU protection. */ - if ( xen_force && !dt_device_is_protected(node) ) + if ( !dt_device_is_protected(node) ) return 0; return iommu_assign_dt_device(kinfo->d, node);