From patchwork Thu Jun 7 23:47:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Goel X-Patchwork-Id: 137905 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp207243lji; Thu, 7 Jun 2018 16:50:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKXtvIQ5mg8KUodWMVRIRX1X9PoXylWmyKxwX9oW2YOZCcZk6zTrgXoshbVB8S8CMLQ1CjI X-Received: by 2002:a24:4964:: with SMTP id z97-v6mr3949577ita.44.1528415427314; Thu, 07 Jun 2018 16:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528415427; cv=none; d=google.com; s=arc-20160816; b=e2oLLpGI8cVM4GwJLrjH0UBA4NsPh1ybluw5++FjQN0IDkWDq5zGigcMUY0VtEg/ab jSlZjCnjb7LlklatBnAlqHFpD6JYePa7fma580YCDXw0TJVuw4o+oLLkmGKCHCwxjE9O XkAHmaOWaxknbInoLpTsYuBzQ8LEYS6CyTTlC+4fL8YPKk8prs5qpO/9qbnR+YoJZr50 5MKWLzLvJXpDlKSgtA3oh62nNKxXKt8Jua8SCkDqR6A92hIiBz5wpyBACeVCCejeEgP0 ZI2vcyxbZF1sm1SlCwfrugNdFoEb7LTvM4HlvRlSdbOLUbgKE3D/6ZxjxRvaBhYep0Xs NPSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=5LyP/lGGt8DlN/I6HtjqiF0mfttSwAM/sjK63r1ipZE=; b=yTReiVR2G5R88lDYax4ib/fOisowS6NN6cEdAZhGnJkfGEXajoUzNL5sF/Ax5jbbPn S/Xf2K6B9cUPspMEtrmjXW1uuJFlC9n+L/hcPflyYEqlKYKz5wWpV/YTSHihwK3ytTkV RrCWzJFYuOkmMUO8gFS8K5a6erHlasGo5CEW8d5myUk62DGT0Mn28wi5QAA9A1O/Dzg7 IU8g512nVI5P+GbICllxJ7eh1TGxPP/fdgPatQL/fUFNHZJFD2FS82IF7HfXVLF4UZC7 4hWuRAFMSs8rTYmERa3PGbAD/9LaeX5BkXPSKMYyWSUBQN7HAiNy1DiMniRls/w76zXq eiVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Dvz1oUkI; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id j142-v6si116234ite.72.2018.06.07.16.50.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Jun 2018 16:50:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Dvz1oUkI; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fR4d6-0007ft-IC; Thu, 07 Jun 2018 23:47:44 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fR4d5-0007fn-EO for xen-devel@lists.xenproject.org; Thu, 07 Jun 2018 23:47:43 +0000 X-Inumbo-ID: d833975a-6aac-11e8-9728-bc764e045a96 Received: from mail-pl0-x242.google.com (unknown [2607:f8b0:400e:c01::242]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d833975a-6aac-11e8-9728-bc764e045a96; Fri, 08 Jun 2018 01:45:23 +0200 (CEST) Received: by mail-pl0-x242.google.com with SMTP id a7-v6so4621314plp.3 for ; Thu, 07 Jun 2018 16:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=njUsJYbyWJ/qjCdKSB3DAiSg+OBoUPAcY1YU70CTmpY=; b=Dvz1oUkIjCot7293h5hzTUJuBTeGn7VqJ9//RFVenFLW3uyxyrgQh2VRdoViPiUmJ2 FvRBtZx5Z3roHzAQuYu7pXtZ8tPuaCc5ozil7S7H/7lb+g4kaVMrMUpeQwTS5ICBDMdw LZcbBNKY1NhahrR+bdAKjrztGlfH1nCq/BLUg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=njUsJYbyWJ/qjCdKSB3DAiSg+OBoUPAcY1YU70CTmpY=; b=Fj9Wg9d32nea0twAn3ttjdDuVHflbU/fEiOlv9jc1o2rhI+9khAFcqRiRWmWWC7WLs SAmaIzhz5raa6avham93MN1ewIq9+VUCXq3/Eqoah05Y+Pf/4TY5sCAzIGg3X/DDmYgd wfStv44c+R/DCfqJ/vpJtQStQnEguAw1rC2Vk2/cenltIdYt1IsXHVcJqVYQsNYLfbV+ XWNRAan8KF3UftaJr8cMtjEQw7DqUqdje/I95dZDIv95/I0kAHfNwItlWI1PfomU3Y8R rAkzeorA9YFC7xptvrEKYHLUjeJZxY1tcW2VKFqMuPCq1NMmS6nwGwnjXAS8i0xcIWzK KB6Q== X-Gm-Message-State: APt69E2ZPK9u1NSa+CIQpmvZi2gE3AjYP2qP4LMoiXgHlfPDDvsfX6sz aJyB+e6mKdaMfnC2iPViQSAa2MMdoUI= X-Received: by 2002:a17:902:ba8a:: with SMTP id k10-v6mr4084656pls.338.1528415260538; Thu, 07 Jun 2018 16:47:40 -0700 (PDT) Received: from sameer-ubuntu-book.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id y20-v6sm46183321pge.46.2018.06.07.16.47.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 16:47:39 -0700 (PDT) From: Sameer Goel To: xen-devel@lists.xenproject.org, julien.grall@arm.com, mjaggi@caviumnetworks.com Date: Thu, 7 Jun 2018 17:47:26 -0600 Message-Id: <20180607234732.20124-1-sameer.goel@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [Xen-devel] [v3 0/6] SMMUv3 driver 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: sstabellini@kernel.org, shankerd@codeaurora.org, Sameer Goel Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This patch adds support for the SMMUv3 driver. List of changes: - Addition of a linux_compat header. - Addition of a common header for arm smmu defines. - Rebase of the SMMUv3 driver to the driver in linux kernel 4.14 rc7. - New config defines for ARM SMMU drivers. Changes in v3 - Changes to variables and file names. - No functional changes. Changes in v2 [3] - Tasklets for evtq and priq. [1] https://lists.xenproject.org/archives/html/xen-devel/2018-03/msg01108.html [2] https://lists.xenproject.org/archives/html/xen-devel/2018-02/msg00713.html [3] https://lists.xenproject.org/archives/html/xen-devel/2018-05/msg01693.html The IORT support will come from [1]. The first revision of this patch can be seen in [2]. Sameer Goel (6): Define WARN_ON_ONCE() macro to mirror Linux functionality passthrough/arm: Modify SMMU driver to use generic device definition Add verbatim copy of arm-smmu-v3.c from Linux xen/iommu: smmu-v3: Add Xen specific code to enable the ported driver drivers/passthrough/arm: Refactor code for arm smmu drivers xen/smmu: Add a new config define for legacy SMMU xen/arch/arm/p2m.c | 1 + xen/arch/arm/xen.lds.S | 1 + xen/arch/x86/xen.lds.S | 1 + xen/drivers/Kconfig | 2 + xen/drivers/passthrough/arm/Kconfig | 14 + xen/drivers/passthrough/arm/Makefile | 3 +- xen/drivers/passthrough/arm/smmu-v3.c | 3667 +++++++++++++++++++++++++ xen/drivers/passthrough/arm/smmu.c | 114 +- xen/drivers/passthrough/arm/smmu.h | 125 + xen/include/xen/lib.h | 13 + xen/include/xen/linux-compat.h | 84 + 11 files changed, 3917 insertions(+), 108 deletions(-) create mode 100644 xen/drivers/passthrough/arm/Kconfig create mode 100644 xen/drivers/passthrough/arm/smmu-v3.c create mode 100644 xen/drivers/passthrough/arm/smmu.h create mode 100644 xen/include/xen/linux-compat.h