Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4015160ioo; Wed, 25 May 2022 12:54:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFPhKoQkCz/7gOnx/Yb6J6Gc7XSsahpnhtqMQR83JIfFPwLsKv2tWvNjRM0xJSICbkARuE X-Received: by 2002:a05:6402:4001:b0:42b:212:57c3 with SMTP id d1-20020a056402400100b0042b021257c3mr33724123eda.109.1653508469829; Wed, 25 May 2022 12:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653508469; cv=none; d=google.com; s=arc-20160816; b=de34qmfidRNSQ6D5Gt6uBMGnMz05KObGTApPIAJA7yUiEyY+u3eWokGe3BXQLMICK5 PbZksqXVmUcsFqP4nJmz1HNrPKeVrF50G9epWM7KA+jZfOWsb2FE2qkk8noj90shjyW8 Y9US6UDu4p/pEU8hQX5edpnTxxKaVR/iRBps6CGSEZFPO75imMqbsNeT6AezCk6Hjg3K jYbqXCMdLowAY57lzwRaIywxcSBpLaxn63I1vbofTPpKeIDIq/4g0Fa1b533hqsViPCZ R7B+oosJEkH9TlywfV7LUX7bbJ3ldQ6ku1XmSZOojKb6wa3/bLQbzDjgfRzbjvmLqVoy HE9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=joRdFOrikAvLBCPLRckLtagnr5zAnbbJe1mok1pXiSw=; b=D6FfGBTmpax5FeyM3oR+GKZN2Yp8nCdgaqODl82eUBWYMMZAaexD8knRrT66ikCXOX 8XBsq85xsynh1490zHodobHMDVFsy0XR1FF5GiERj5eFqrBCfzEiBzSWSuSNgc9rXG65 Rppm4tfY/0FB8bzUVzz25dqnw7QQ962F+QuQuolRZt524dF3g3emh2s0nxgK20A/GRS3 XtD4Ge246SHhp9XEtL0tdbEx+/tts6TCdOpPMFd+t/9eCaQKgLLQtL89BMFY5WJRkksQ W5+e88Ls0AV63CH2dhhSRLTlUz1KXlMxZIl/dxc8JT+7A+Zba49/FVgb662LBnJ4D3Dx 2DQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZUCXEQxR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z14-20020a056402274e00b0042ae7984dafsi28526463edd.46.2022.05.25.12.54.01; Wed, 25 May 2022 12:54:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZUCXEQxR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235766AbiEYLHP (ORCPT + 99 others); Wed, 25 May 2022 07:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232745AbiEYLHN (ORCPT ); Wed, 25 May 2022 07:07:13 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C6E3B298 for ; Wed, 25 May 2022 04:07:10 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id t13so10442078wrg.9 for ; Wed, 25 May 2022 04:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=joRdFOrikAvLBCPLRckLtagnr5zAnbbJe1mok1pXiSw=; b=ZUCXEQxRycox4CR+XIe37Y/zMHlkCMd0dT68FX0waAx1GkzWURFMnfELqyxuQGZR/T mg+fiyemIz0D8Y/JwhX8LiTotWRgJ7/381Qc3jxsJ1kyAh0jrdY0i3I0MMjN2PYCfY4X tmjLRKQ9uh1RJsyLlfHrUmtCu6tsXRxb5dpf8pG4/mOhvcewaJs1AqWTCYkEQn9dGe5f k/M7rP1GoX9dH2gH2aRjUUMrrg/meRnh/kJNy+C0uerR6Mc2VSgpkGDTV7QjUckM+4jZ oHGOsxAUkFsW+xnn2zbXR7/5EbdF3sifZs6Th0VlQ0bQubEelqdaIh9fVg0nROLEwZus pUwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=joRdFOrikAvLBCPLRckLtagnr5zAnbbJe1mok1pXiSw=; b=YAWQ0S0E+QRi0c8skIZO34UxpkVfhegDynVzGgMg+DbaeogFeq0qduSx5OJyKk4Tmb pjMBvtI3/Dqu/KeYaOBCc1GM6nJt2iX04AIV1PZMgB/IYxOmI56TxexM8x97PYHjhpmY MPlttg3G4izXryH7mth27eofuwuIAMnLByBQ/aUCU/rA3C2WhnEfbx3aWqk4JKGSvU40 sXYAYTbaOcX1UBlODxz5sVOEYWnU5vWK4CjRN67mUswghwxovnRHelKEKyYzwIhtBEZQ xzSr32sioCtOBhRiSsKA9X9iLKC9MMfWz0Xk0Ce+wlBSHsvcWX6DIVnQL5fMGR4jHr2y WNNg== X-Gm-Message-State: AOAM532laM2IeBOShpju2rcB0mv1mCEdmP2MaCRaisVw/goWhnAcEgtH nCxHM7a9a5iMtJlWwEb1vtfqFA== X-Received: by 2002:adf:d1c9:0:b0:20f:c3dc:e980 with SMTP id b9-20020adfd1c9000000b0020fc3dce980mr18878297wrd.552.1653476828879; Wed, 25 May 2022 04:07:08 -0700 (PDT) Received: from myrica (cpc92880-cmbg19-2-0-cust679.5-4.cable.virginm.net. [82.27.106.168]) by smtp.gmail.com with ESMTPSA id i7-20020a5d55c7000000b0020c5253d8d3sm1797656wrw.31.2022.05.25.04.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 04:07:08 -0700 (PDT) Date: Wed, 25 May 2022 12:06:43 +0100 From: Jean-Philippe Brucker To: Robin Murphy Cc: Baolu Lu , Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Jean-Philippe Brucker , Dave Jiang , Vinod Koul , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Jacob jun Pan Subject: Re: [PATCH v7 03/10] iommu/sva: Add iommu_sva_domain support Message-ID: References: <20220519072047.2996983-1-baolu.lu@linux.intel.com> <20220519072047.2996983-4-baolu.lu@linux.intel.com> <567dffd4-8f15-ffb2-da69-4f47017c35fd@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <567dffd4-8f15-ffb2-da69-4f47017c35fd@arm.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 25, 2022 at 11:07:49AM +0100, Robin Murphy wrote: > > Did you mean @handler and @handler_token staffs below? > > > > struct iommu_domain { > >         unsigned type; > >         const struct iommu_domain_ops *ops; > >         unsigned long pgsize_bitmap;    /* Bitmap of page sizes in use */ > >         iommu_fault_handler_t handler; > >         void *handler_token; > >         struct iommu_domain_geometry geometry; > >         struct iommu_dma_cookie *iova_cookie; > > }; > > > > Is it only for DMA domains? From the point view of IOMMU faults, it > > seems to be generic. > > Yes, it's the old common iommu_set_fault_handler() stuff (which arguably is > more of a "notifier" than a "handler"), but I assume that that's irrelevant > if SVA is using IOPF instead? Yes IOMMU drivers call either the newer iommu_report_device_fault() or the old report_iommu_fault(), and only the former can support IOPF/SVA. I've tried to merge them before but never completed it. I think the main issue was with finding the endpoint that caused the fault from the fault handler. Some IOMMU drivers just pass the IOMMU device to report_iommu_fault(). I'll probably pick that up at some point. Thanks, Jean