Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3883130iog; Tue, 28 Jun 2022 04:56:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1shBfJCgVX7vpH4QvFeMGodMIbgt3A31XmRJHyZMRkirw1a5mLJjex/iPZzGAMQz31UXe37 X-Received: by 2002:a50:ed8a:0:b0:435:6582:6864 with SMTP id h10-20020a50ed8a000000b0043565826864mr22567219edr.417.1656417361031; Tue, 28 Jun 2022 04:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656417361; cv=none; d=google.com; s=arc-20160816; b=SZJMNtMQocq5FVoqevp9hJcPl18H97okeBIIkiWuBxWVVMEI6O4m/QWw/STwXHi06v hxEiHNWK7M5P+idJFjoG8luTZk/n/g5+rcFuYZ81zmlD6V1VT8kAVPTsFjPyKH7Azw1W uregAP5JwApvgKGYdlEzd4Cae0QhUQNfiRvZmGK7TSnHnvKzZEL0ESDgclMmz5bwuaFp xyuydiY8v6ZpuAOSI6Kvp5KWhxnPHsbrBqM6D5X8IXuTEqg0GkEiUZGRs9ZlYKoBYVNz w6yn4RUXsYFKGJJR1grBSDS8NBigrlN5mt+uXkx4eMv3513Gz5jnerZGSjGx71/3QAKU Sccg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=X5DqyGEky1+yW67un537NwteUX6utCstM7QIfQT72s8=; b=rB426gdC13zDhFClfQmY2D48Yi3UIanYvxEa2bltIeofQx6dAuANYBZrydg8Wal7Cb 69AwrSAmKLDyUTgrc0LF4Or7BKMFMqxz5HrXm2Hb0gyPV62V+7tVNJn9xF4BZ0euXGIe 8brGgfrlFL8DxoDd+Cs5f/AbHED+G0imI838gjaD+w+gQG4k7XK6+1hT2sWU+je+dtBU QrfL6tcS294GtgTZaZos08KZ927sROhf9NPhFge0DLk9YmXMIHmVg238NMlFMAKrS3hR 4ATDcHBscKfApxrhhYbKvUqPzMU5B94St5Sfc4BZ2dgkOMqCvBW9ycmlFhdkfc790Vag +tow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g++m3x6m; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot15-20020a170906cccf00b00725ea31cfbfsi13409607ejb.406.2022.06.28.04.55.30; Tue, 28 Jun 2022 04:56:01 -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=@intel.com header.s=Intel header.b=g++m3x6m; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345215AbiF1LeL (ORCPT + 99 others); Tue, 28 Jun 2022 07:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344431AbiF1LeF (ORCPT ); Tue, 28 Jun 2022 07:34:05 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FB0C2FFCA for ; Tue, 28 Jun 2022 04:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656416044; x=1687952044; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=WyQ7Lhg64UA7faLJ8umQR8gY+ay9xEU5cNZImGlhWOk=; b=g++m3x6mmFxR0QSm6D15pTqOF+Bz7OH4dxd+KDBmDMAeF1IwxolEjvx2 unj9GxSg6s0ecAnT6VWQhXU3wFzAaLoPIb+3G87x8oJl5j1k2b9Qw1LyD ihTZrgmcJGmg5wP9i+AeVuhcU976MHMKU1zOfZx6Gs3lQPuCv4uxdJGjh KfLSAZklpY3je0MHU+0tt22m1Qfu6VER1Ps8cQzsniu5tilogNFFiFN5V SRxbBKahkWSNiefbUQQJ4hlsdI1kyGYXBR+CRZ6PVtK133lqn6W+3y9i/ Vdr1J7r74wM/ozri+vQY3irsM43iKBkXTHfyJn5FPPd/Rhk6WLWgIBVci Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10391"; a="270465406" X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="270465406" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 04:34:03 -0700 X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="646877561" Received: from ltang11-mobl1.ccr.corp.intel.com (HELO [10.249.169.64]) ([10.249.169.64]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 04:33:59 -0700 Message-ID: <89130952-155c-38f0-3318-1c071562661f@linux.intel.com> Date: Tue, 28 Jun 2022 19:33:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: baolu.lu@linux.intel.com, Eric Auger , "Liu, Yi L" , "Pan, Jacob jun" , "iommu@lists.linux-foundation.org" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , Jean-Philippe Brucker Subject: Re: [PATCH v9 04/11] iommu: Add sva iommu_domain support Content-Language: en-US To: "Tian, Kevin" , Joerg Roedel , Jason Gunthorpe , Christoph Hellwig , "Raj, Ashok" , Will Deacon , Robin Murphy , Jean-Philippe Brucker , "Jiang, Dave" , Vinod Koul References: <20220621144353.17547-1-baolu.lu@linux.intel.com> <20220621144353.17547-5-baolu.lu@linux.intel.com> <42825be5-e24c-0f95-f49d-5f50d608506d@linux.intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 2022/6/28 16:50, Tian, Kevin wrote: >> From: Baolu Lu >> Sent: Tuesday, June 28, 2022 1:41 PM >>>> 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; >>>> + union { >>>> + struct { /* IOMMU_DOMAIN_DMA */ >>>> + iommu_fault_handler_t handler; >>>> + void *handler_token; >>>> + }; >>> why is it DMA domain specific? What about unmanaged >>> domain? Unrecoverable fault can happen on any type >>> including SVA. Hence I think above should be domain type >>> agnostic. >> The report_iommu_fault() should be replaced by the new >> iommu_report_device_fault(). Jean has already started this work. >> >> https://lore.kernel.org/linux-iommu/Yo4Nw9QyllT1RZbd@myrica/ >> >> Currently this is only for DMA domains, hence Robin suggested to make it >> exclude with the SVA domain things. >> >> https://lore.kernel.org/linux-iommu/f3170016-4d7f-e78e-db48- >> 68305f683349@arm.com/ > Then it's worthy a comment that those two fields are for > some legacy fault reporting stuff and DMA type only. The iommu_fault and SVA fields are exclusive. The former is used for unrecoverable DMA remapping faults, while the latter is only interested in the recoverable page faults. I will update the commit message with above explanation. Does this work for you? Best regards, baolu