Message ID | 16-v3-d794f8d934da+411a-smmuv3_newapi_p1_jgg@nvidia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B93D8C4167B for <linux-arm-kernel@archiver.kernel.org>; Tue, 5 Dec 2023 19:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gVH0YdBY/ixmgjwR4uMWA1mVs3Eb+Su+wegOazSJPYM=; b=qx1H73Q4GwfFjV +vKn4/4DFsyOvXKzmBdSG7jZqjEWe/QLVPsMW7nfxPkexSL+NcQVfBJnB1/ZEbw3JbbLORpWxv/t3 rH19hb+JQaEslZP7EKRPjGcYxnX7uwwLOwDm4JuYoJteqzTLISCiGlBN4EXD2AwQBz7Gb6xkrvjn+ +XDVD+GuStv5RRKDhj7TBWJ7qB13G4rq6GKGLU/M0QR2a1tWqF8GkkBVzp9mJn2EtiTj7eNzETYNq qH73A3P82iv2Atpfx/L+udtj8OBOCwnEbFRnhEFbhNgTwtnD6B8Nbd6IZrBluYoXFUwG5uoYKq65K D7wuVhZ/nXv5pEJ7KIWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rAat5-008FHo-24; Tue, 05 Dec 2023 19:15:19 +0000 Received: from mail-mw2nam12on2061f.outbound.protection.outlook.com ([2a01:111:f400:fe5a::61f] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rAast-008Ewd-12 for linux-arm-kernel@lists.infradead.org; Tue, 05 Dec 2023 19:15:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Un4Aehrv3CK7Kwbmy34NvZy0jhoX2t2S3P8fkwbYkd7O9cQD2f2eroVfqJBrGo3NjUng5wVcpRdAGLzUIC2AnOgqUI6Ss8pua54t1gfzYDJp7t5kMJRZS8S+J77nKDF3U2TGMcl5ZyAiMto2tM0xK3GwTwU54CuBoAVZGDosVm7FZkHM7q3TIEQwzmsH/RP/xFaMqicWAHVjaj/y3uCkE2413TZh7iO6ugGp+pWg47B2fhiYGxZzanAadrPThoAb6m+H50WtHZ/t9IkdHOiIL4gZTII/LOpEAH8hdF70S4Cg7OvORHzTELRQv+RSWbodtmmcoVE3nbJElnvhydJz/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pK/GNUSu1UOKPQvkjCoArpNvNirvau5mQhuKi2rQ1OA=; b=acqTYi8TArBRMNSs/xlRV5s7lbMeQd9VIDE0AP8xxoicvY5gVWzevn4U88NeOtXtr7ulgR2xopVgxyM9sSOO9UFvaBicLTjlhYTyEhA/R1NQFjFIdqVZiiZ6PszcWdebsOuSlmgTWv8ys+wlZt0GgB05gXZSqpxOFP4Fhr/NDMgOamJauqHHhJd+YIKHReIeCGlhetzuwVN7jQGAGJYLSV/qA0Cy+N9sN+0jLXND9E8PJprjr/SI6YRAIXhWLHhvCtAgZOvuGyn4mrMoobm5ck/aTkL355GU2bBz0E4Jlti+IwO7fKk5EjexALOx2GM3jvwd8BLCB7iPZXmBweFTjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pK/GNUSu1UOKPQvkjCoArpNvNirvau5mQhuKi2rQ1OA=; b=eMz6gY8NjF0dE0FOMKE4A7JRof0mvxXDBArEblw2mrCHABSBosU9Oh0a7gm0qZqKVJIGT2RA2p7L04GwTs+Q9QxuRMMtYobE9R820OjxYCQPgjcGvXpMF+GFC4Qmu3Xc7d1Bj5NNM8h821A46vG2/Og7fz9E6d4zeraaUEDZBKziu017MtZbBge9yhMku1Gy6XJtNp3J/f1yhO8+udNKEdPS8VeYVNBw8TYaKu7eOntd2ejXZCbqoJpgBX3AwYa3aAOfFekiuuCdfQ5FAKcBQVy72xj7aRNp6FI33Z2MsI88gGBOZZl+mtH939XwiJn9Ql6Q9PPy/YIkGW4QrnDBIg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by PH7PR12MB6588.namprd12.prod.outlook.com (2603:10b6:510:210::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Tue, 5 Dec 2023 19:14:57 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::60d4:c1e3:e1aa:8f93]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::60d4:c1e3:e1aa:8f93%4]) with mapi id 15.20.7046.034; Tue, 5 Dec 2023 19:14:57 +0000 From: Jason Gunthorpe <jgg@nvidia.com> To: iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>, linux-arm-kernel@lists.infradead.org, Robin Murphy <robin.murphy@arm.com>, Will Deacon <will@kernel.org> Cc: Eric Auger <eric.auger@redhat.com>, Moritz Fischer <mdf@kernel.org>, Michael Shavit <mshavit@google.com>, Nicolin Chen <nicolinc@nvidia.com>, patches@lists.linux.dev, Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Subject: [PATCH v3 16/19] iommu/arm-smmu-v3: Add a global static BLOCKED domain Date: Tue, 5 Dec 2023 15:14:48 -0400 Message-ID: <16-v3-d794f8d934da+411a-smmuv3_newapi_p1_jgg@nvidia.com> In-Reply-To: <0-v3-d794f8d934da+411a-smmuv3_newapi_p1_jgg@nvidia.com> References: X-ClientProxiedBy: MN2PR16CA0022.namprd16.prod.outlook.com (2603:10b6:208:134::35) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|PH7PR12MB6588:EE_ X-MS-Office365-Filtering-Correlation-Id: d59cce8a-293d-465a-9d11-08dbf5c6754e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g38+u7h/DTCt/R7p6uTbl0/eHZedmNixdGvCD7izMOiM0uvAI6A9VTGWPJw0TP1x3hMAW/v0ABkDcTwymq94uzTCSiyrar7i/xbp3nytE1MZMFTGuSV/Xo+JpcXQ/yeId+BWi4BOtiTI4FJR0rfA9ap3LjP6KK+XNYKEVmQnpqiNEiKYg60h6/d62Io1pDfcAX6twuzhQ+Qlc8HYnVXwqLnSLOxY3K/P2bDcyY/v3O7UGk1WPfh0g24euGDOhqTUwdyKPaYMaeaNk2jGAFEBj0RGg7L2u/NACT0GNY0kQNLUxxJAS7tY3Z2pBTpV2bQDW3Rm9vBVF6dBgbFnOZyEMpXrHzMsXf9zeHVMevIJord7+RvgeRjIcufOfb6tgpVAVPw289yrRxN/gvLZ3gETaAuV4XF+bc+i0U+ZzLpT1BJmvnMRjU0ktC1ZbTSvZpN3q9sipKqc7aPjT9r/YhqyA1I/d9yMrBLTSRO5rsZjt81GSA+bXIqHNfOcwawa5j6DmwAP5MQMvSy6tkevd7gXR/ADwKfp/L0d4vP8hrpic/n0M+dohcnhENM2/sSVVPoj X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(366004)(136003)(396003)(346002)(376002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(478600001)(6512007)(6506007)(8936002)(6486002)(2616005)(26005)(6666004)(54906003)(66476007)(110136005)(66556008)(8676002)(66946007)(4326008)(316002)(83380400001)(38100700002)(7416002)(36756003)(15650500001)(5660300002)(2906002)(86362001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C9KHOWNsEO4LMgMVIinpcZwGbnOJnT0uRGqWzMRGdK5YPoq1OGqP1LFGYnkdhyn7Hwas9iJbEn1vp5RiML1Ec8JuYCVbS2BVL42Q8t4zOc39rGK6lShhDFmy2PYiVXIqtA1RM1w2m6NEEPjK/A501asyJ2Aq09SpWtdYJrtNocSdlbihHVGqgVybtDwBlSLJb/2WhAWGYU2T8zoG9+fFrEY9qjjRKgybB6jjBkKp4asIhr/lbK3VV7sDs/bI0v24gmFQNek/oHb6MnB4z4LYY7Z1ZBQWai9iqoBG+Y0WSwoG+oDezPnf1XK3l7CQ1eNFKIK7Vy+BHnAf+bcIwz4t0oZJH0ivCUvkz9yVlSj38aXpBTJw6TlvEV04XzQedGKfcGAY8fDFdlsgkJSE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4/mqudmG5dy4uqaTfxmFGpdNrg5ncJEUX26fxFVE1wsEvLwNMVld776VWFY5RZz0f/lvqjA/1U+/JxZxxldmu7iRM7QPbDM+/880soZPTUMXJYFTTmQOVEfBsEEzaorpoJimdNUDPG0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d59cce8a-293d-465a-9d11-08dbf5c6754e X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2023 19:14:52.4605 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZICc4Zi1jRwkNPmw5UqsG8NDBgoacYN4U6uxe0n/FwViNir8SAwqMIS+iME4tywH X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6588 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231205_111507_400369_B468491C X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Update SMMUv3 to the modern iommu API (part 1/3)
|
expand
|
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 9899caeabc8744..386bf954542e7d 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2647,6 +2647,24 @@ static struct iommu_domain arm_smmu_identity_domain = { .ops = &arm_smmu_identity_ops, }; +static int arm_smmu_attach_dev_blocked(struct iommu_domain *domain, + struct device *dev) +{ + struct arm_smmu_ste ste; + + arm_smmu_make_abort_ste(&ste); + return arm_smmu_attach_dev_ste(dev, &ste); +} + +static const struct iommu_domain_ops arm_smmu_blocked_ops = { + .attach_dev = arm_smmu_attach_dev_blocked, +}; + +static struct iommu_domain arm_smmu_blocked_domain = { + .type = IOMMU_DOMAIN_BLOCKED, + .ops = &arm_smmu_blocked_ops, +}; + static int arm_smmu_map_pages(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t pgsize, size_t pgcount, int prot, gfp_t gfp, size_t *mapped) @@ -3041,6 +3059,7 @@ static void arm_smmu_remove_dev_pasid(struct device *dev, ioasid_t pasid) static struct iommu_ops arm_smmu_ops = { .identity_domain = &arm_smmu_identity_domain, + .blocked_domain = &arm_smmu_blocked_domain, .capable = arm_smmu_capable, .domain_alloc = arm_smmu_domain_alloc, .probe_device = arm_smmu_probe_device,