Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1769848rwo; Wed, 2 Aug 2023 22:06:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlEeBw0sIR0EebUeYBR8bJNHC/yVGXYw7hJOPRM2l/vmIQyw0Tdl0o+bvIqoViQovW/x7Nc1 X-Received: by 2002:a25:ab07:0:b0:d0a:7e3:fa0 with SMTP id u7-20020a25ab07000000b00d0a07e30fa0mr16411194ybi.53.1691039216433; Wed, 02 Aug 2023 22:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691039216; cv=none; d=google.com; s=arc-20160816; b=cdJNintS2aP2/pYxGw7zTcI8kpkB45wzhzPKPHi18OSLjVfyiCjTxNs/ilcz2OEyYc whi79yrhjlSZPRQL4hR3TJjStwJryNkVE4WNFTWFYgNBVhcvm66befEwJAP89ZePu69r UX7aEGX/vHJAzBTBS4NkfjYN5EyEfj/jL3DRj3BWK9mZ+MhwO0P2WtrHbJ/73Tju4wlb FiltWS9TLlhgznfNYvegKofPD12HjWhu6fCknaRRqcvELfMDkHRoJUm5LcVbLgwAjZ8m hW1lFeq9i2iEv2arqalAKh3j4TeE3R5UXYV2BdFR8DEI4mQDF/p2PmK75kuFK1oCfprh w5lw== 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=RHPB5h70cpj+ML0SlA1qDM/qTVxOmOMu0MWMgOKEcX4=; fh=hdYmtqyQCNDe3R1Iumq8dz39VpjWGW1O+FEAZ6WRddI=; b=HT4quBXmvBAC7GZp7pBLDGcdAv42to+oIbvZFJS1PaxSBv4I2VMNqmI0mwvc09gA1K QvAJC18Qj8tk3ncIu0VNSBJWEz/S4L3gxVr08KFRSmhHcc1UaXso5tbuBqOMxNaCNhfb yj5z2lWcHBVXQaIff08QhVcobZwf1EcfL18vlsb8rH4T53nTLg6udOE8u7VdZy2LBcu0 kIWUAbtmKvQJa0ZjD1wzSC8Rocjc9pdq0wNt7LNBIZC78SK6mJz7EzaFGse+ZlGWwFnm zZhMQmsBirGf7/Y5u0VUu6YcO0hzRM73C6xN8xJzyxyoVEr1E24U6WOoDEc5rGRhcrxS X0Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bM3NNTvH; 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 w3-20020a170902d10300b001bb54abfc0fsi8360045plw.380.2023.08.02.22.06.39; Wed, 02 Aug 2023 22:06:56 -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=bM3NNTvH; 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 S231204AbjHCEFs (ORCPT + 99 others); Thu, 3 Aug 2023 00:05:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbjHCEFp (ORCPT ); Thu, 3 Aug 2023 00:05:45 -0400 Received: from mgamail.intel.com (unknown [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7E8E1AA; Wed, 2 Aug 2023 21:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691035544; x=1722571544; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=WgVb4J59RLF3p1cq5nNgzuJOUGR0j/yT9TP7r6Wj8Zg=; b=bM3NNTvHuQWsxu4zpBJgc2EtYdAsoPdo6J9ItsDcMbF/ZWPsODo65WY6 DBVgDLTbkXEhextcFSc4KHq901jXlMxVGn+51JZAEUdiKyfuQAx0WcmFM U26qatCkvFh+Pd0L07p5OSwyqlI5DxniyBI1tLkLaWsqydnrdEhONPYCU 1o0866hPub/fd2a2R8wJusLpgSIsjtaS4E6XMkkeg2ZIK8jITzVgUE/Lu YkA+Mf8TUtMyPJb0RhvOxQwARDUFc++tEcU16UreQl3yFuM3ryW5rBSJl 8YhQy2LPvkIU5FeqX41UFO9PJhtWPC926E6WqkDXrROwebIjy/UJH+fhR A==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="349360922" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="349360922" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 21:05:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; d="scan'208";a="872767507" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.255.31.34]) ([10.255.31.34]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 21:05:41 -0700 Message-ID: <40d9b0fa-4a36-c3b7-53bb-4333ff89dc45@linux.intel.com> Date: Thu, 3 Aug 2023 12:05:37 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: baolu.lu@linux.intel.com, "cohuck@redhat.com" , "eric.auger@redhat.com" , "nicolinc@nvidia.com" , "kvm@vger.kernel.org" , "mjrosato@linux.ibm.com" , "chao.p.peng@linux.intel.com" , "yi.y.sun@linux.intel.com" , "peterx@redhat.com" , "jasowang@redhat.com" , "shameerali.kolothum.thodi@huawei.com" , "lulu@redhat.com" , "suravee.suthikulpanit@amd.com" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "Duan, Zhenzhong" Subject: Re: [PATCH v4 09/12] iommu/vt-d: Add iotlb flush for nested domain Content-Language: en-US To: "Tian, Kevin" , "Liu, Yi L" , "joro@8bytes.org" , "alex.williamson@redhat.com" , "jgg@nvidia.com" , "robin.murphy@arm.com" References: <20230724111335.107427-1-yi.l.liu@intel.com> <20230724111335.107427-10-yi.l.liu@intel.com> <58ae9095-28f2-a44a-b0e5-be82e1eae9d9@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.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 2023/8/3 12:00, Tian, Kevin wrote: >> From: Baolu Lu >> Sent: Thursday, August 3, 2023 11:25 AM >> >> On 2023/8/2 15:46, Tian, Kevin wrote: >>>> From: Liu, Yi L >>>> Sent: Monday, July 24, 2023 7:14 PM >>>> >>>> + >>>> + spin_lock_irqsave(&dmar_domain->lock, flags); >>>> + list_for_each_entry(info, &dmar_domain->devices, link) >>>> + intel_nested_invalidate(info->dev, dmar_domain, >>>> + req->addr, req->npages); >>>> + spin_unlock_irqrestore(&dmar_domain->lock, flags); >>> >>> Disabling interrupt while invalidating iotlb is certainly unacceptable. >>> >>> Actually there is no need to walk devices. Under dmar_domain there >>> is already a list of attached iommu's. >> >> Walking device is only necessary when invalidating device TLB. For iotlb >> invalidation, it only needs to know the iommu's. >> > > even for device tlb we may think whether there is any better way > to avoid disabling interrupt. It's a slow path, especially in a guest. I ever tried this. But some device drivers call iommu_unmap() in the interrupt critical path. :-( So we have a long way to go. Best regards, baolu