From patchwork Fri Apr 23 09:51:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Kumar Gautam X-Patchwork-Id: 12220017 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 843BAC433B4 for ; Fri, 23 Apr 2021 09:54:35 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 32044613E4 for ; Fri, 23 Apr 2021 09:54:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32044613E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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=fQgqpp5+6DjJFplkSi6BQ/zI2TrbL84wdwSVik8X3KI=; b=eH6zn/6Pk4WpmV/DX2pJvp/p18 C4w7inCB7GZNrat2WG6AEDCpgOOueArfVllo6PLdu7uQrLlXZ0Tot+vTBEz0Kwfyq/pOymrwEdNsQ YlkCG4QsHoh/iiG5X63DdBGu0Xqi2UGzykbSWNfMaqBZalPtEaYcNQaU3pwKKxMqpdgXGnmgVPooM UqOZRaCVJsxFFmJrPbWOogoF8hUfhfXmHYlmnx/lwheRO56ydBsS584ozmeBo1tT33sTu3UhIvndi NQHAAHcbHIxHQNMK8HpsjPMGiQQuJvl4dJ5qbbAn6tCy371dtR9bV+MxbmeIstssIr6G3nqV9b5n7 cxkIVzQw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZsU0-001DFC-SJ; Fri, 23 Apr 2021 09:52:21 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZsTo-001DEf-0c for linux-arm-kernel@desiato.infradead.org; Fri, 23 Apr 2021 09:52:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8CZNjVqUZ10qsX/pA96MsMzuym+uruykSXsfiDiiIa4=; b=vyJeBUy31REiJRfMU4HFalD7XM n6W0yMVP7k1AU+cH2Z7qujeaPHTZ7r1/lg7uZzrVetDH29Ftgmtmf2CpqpIGf1Ar/FPdPTwrChuH4 /VhZvf7MszEZZB/8zQUnCeG4HN8nqX/j6KzMoQmB2bVV45/q0WZc4JDkar/B0dj+EysbKMkPzjnO7 fXf/PfTjFom3g70udDKw1DNUGKRbut11bNL1nYKtIS7O8jkKWa2jPSj6rZr55fisZGvVq/zWD4vw8 M/zRARuM+8tQG2ee13/nH0HiLozeWyoV97f19MXAxIAcVpnI1beFw26eVfpiyKZ7ju/vhG3eG1tAu e3x83UXg==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZsTl-00EIdI-GE for linux-arm-kernel@lists.infradead.org; Fri, 23 Apr 2021 09:52:06 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7F48513A1; Fri, 23 Apr 2021 02:52:03 -0700 (PDT) Received: from usa.arm.com (a074945.blr.arm.com [10.162.16.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DB7363F774; Fri, 23 Apr 2021 02:51:58 -0700 (PDT) From: Vivek Gautam To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org Cc: joro@8bytes.org, will.deacon@arm.com, mst@redhat.com, robin.murphy@arm.com, jean-philippe@linaro.org, eric.auger@redhat.com, kevin.tian@intel.com, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, Lorenzo.Pieralisi@arm.com, shameerali.kolothum.thodi@huawei.com, Vivek Gautam , Alex Williamson , Lorenzo Pieralisi Subject: [PATCH RFC v1 01/11] uapi/virtio-iommu: Add page request grp-id and flags information Date: Fri, 23 Apr 2021 15:21:37 +0530 Message-Id: <20210423095147.27922-2-vivek.gautam@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210423095147.27922-1-vivek.gautam@arm.com> References: <20210423095147.27922-1-vivek.gautam@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210423_025205_601288_9998FF3D X-CRM114-Status: GOOD ( 10.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add fault information for group-id and necessary flags for page request faults that can be handled by page fault handler in virtio-iommu driver. Signed-off-by: Vivek Gautam Cc: Joerg Roedel Cc: Will Deacon Cc: Robin Murphy Cc: Jean-Philippe Brucker Cc: Eric Auger Cc: Alex Williamson Cc: Kevin Tian Cc: Jacob Pan Cc: Liu Yi L Cc: Lorenzo Pieralisi Cc: Shameerali Kolothum Thodi --- include/uapi/linux/virtio_iommu.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/uapi/linux/virtio_iommu.h b/include/uapi/linux/virtio_iommu.h index f8bf927a0689..accc3318ce46 100644 --- a/include/uapi/linux/virtio_iommu.h +++ b/include/uapi/linux/virtio_iommu.h @@ -307,14 +307,27 @@ struct virtio_iommu_req_invalidate { #define VIRTIO_IOMMU_FAULT_F_DMA_UNRECOV 1 #define VIRTIO_IOMMU_FAULT_F_PAGE_REQ 2 +#define VIRTIO_IOMMU_FAULT_PRQ_F_PASID_VALID (1 << 0) +#define VIRTIO_IOMMU_FAULT_PRQ_F_LAST_PAGE (1 << 1) +#define VIRTIO_IOMMU_FAULT_PRQ_F_PRIV_DATA (1 << 2) +#define VIRTIO_IOMMU_FAULT_PRQ_F_NEEDS_PASID (1 << 3) + +#define VIRTIO_IOMMU_FAULT_UNREC_F_PASID_VALID (1 << 0) +#define VIRTIO_IOMMU_FAULT_UNREC_F_ADDR_VALID (1 << 1) +#define VIRTIO_IOMMU_FAULT_UNREC_F_FETCH_ADDR_VALID (1 << 2) + struct virtio_iommu_fault { __u8 reason; __u8 reserved[3]; __le16 flt_type; __u8 reserved2[2]; + /* flags is actually permission flags */ __le32 flags; + /* flags for PASID and Page request handling info */ + __le32 pr_evt_flags; __le32 endpoint; __le32 pasid; + __le32 grpid; __u8 reserved3[4]; __le64 address; __u8 reserved4[8];