Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp745605rdb; Thu, 8 Feb 2024 22:44:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXhfEaStUfh4O/Vtled08kDQNjtKuA8BfgTqaJOvcqLlauiHRnsSk+mauZEnnvnAki6v3TMJVvF0LpGee5+chICg1c7UlayGtUCHErluQ== X-Google-Smtp-Source: AGHT+IHgDqq5+BJJYGp9MJ0A2PlbqZTLwtWLvuT4pJ4NQvzAzNp8ApslLCA2iaWax2PY9jTzTXBy X-Received: by 2002:a05:6870:330b:b0:219:f071:416c with SMTP id x11-20020a056870330b00b00219f071416cmr704463oae.16.1707461044597; Thu, 08 Feb 2024 22:44:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707461044; cv=pass; d=google.com; s=arc-20160816; b=uSGu56bo3hfgi+at2/TyF8SDXMdFIqrspnQ3TUFCfD3APpGH7Zs18JuJ062Y/laCDi JTasbDyLipzOV9MI/TIhYRN/BNEDUmQgOTgDOmT8+dqF2doJGS3CjGR7Gf//NmbcJfic CoE2pufYpZRlTgGDbwrZ9XPduLqPuc0DEiCU5pUk2ZcoCGpTus6yTsDUv4fWBNchrOBg RG50ko+nbCFnVHh5Pu3mW3qQ/DB4cFgpHCThokdaV0l8ove0xHYb6sFNf8RYi7n3JahU m6OLjsPW0xeGA/3jSTzSnAYPSDhiY1N5p6XJ0pleUltuuOpD3TiidHKQgEoCjPLITiqw G6ow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=aiDskYNDSZSOn6XUam3Spbfa8LOLFmIuslP1GEOFtcg=; fh=VK12XoiTMnUTxSi9k+eNNr0SU+ngU8J8r+/towz9hTM=; b=rr7yX5DB7VkmUANzA4HoNRyk/hsgUo/HLd/onuNyGBUcLLH67wlN+MOt6b8dCIW0dq Z83mvEiRjI3xiyk4Gw4YgrFTbSOHNFk2zTctrvnJfUjebhxyohdD7GWJWY8NjovTsyn7 P9CJBs/EzRBdzu/bBH+BwdexjpEPXhjqqESRqLOd+btHyv7JibZb2AcO15PQFrwdhXPe Ohy9eweBxsM3X0Jwh/saTR8et/zwavu9wwX5OcN9JlQqUJ6o7Cemu2U0jceOyEzCIHEP HAlxLD7mcP5a+sJ28fctTBU7qSOqkoVNC77YYGHOBuTny06ixw4UKa83K3R6ayeLSPwn xhaQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nztmOa5r; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58939-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58939-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCVjk2dK5k/v6fNDWs8Ru+DC8ggU37FIvtntuldhTrIMtiepkPN5jGWicb52xU+rCrat706cMefQfTWZrJQJqoK7M4rQnv31nOladTNC+A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s191-20020a6377c8000000b005cfbe985481si1250474pgc.46.2024.02.08.22.44.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 22:44:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58939-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nztmOa5r; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58939-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58939-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ED12728BC79 for ; Fri, 9 Feb 2024 02:40:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F0A41C27; Fri, 9 Feb 2024 02:40:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nztmOa5r" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED62617FF; Fri, 9 Feb 2024 02:40:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.88 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707446418; cv=none; b=hnanu/6q1uJubYFA3/HRQiTFVss8UfVQmoVbN3orLbWad/+2WN3WnFnFhy5y4iyE6TIlf5yJyZ7oXstOdUFBU4Y9C11uY8rD8QzVeT1WuYPQ8ob1a8X/WmPaiGhVHejr0GaxY12ikH8HGN1PYjtPTtkIfyT+JDuRPaA8/A0szRE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707446418; c=relaxed/simple; bh=YZDhCIFPXKcT25aeuggls+0rWNxO4AGLXeMC9qcXN2M=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=lgnJ++/bhZIuOf02PlhMcG/hHQf4AGMbnIYRdHSQzOP3/ex/fFSQR4Qvd+2q7AIHPd6U5r+3RzQMybpwcFQJNXrK2qqS/RCUw8ZVpab+wipHOHaSQMBrO/zOrZDdZGrhHNHYrBdi3nb9uUXhb6/eaKc1SumbOe2RF8ejz6NkAec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nztmOa5r; arc=none smtp.client-ip=192.55.52.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707446417; x=1738982417; h=message-id:date:mime-version:from:subject:to:cc: references:in-reply-to:content-transfer-encoding; bh=YZDhCIFPXKcT25aeuggls+0rWNxO4AGLXeMC9qcXN2M=; b=nztmOa5rkcJuE2/Fx8XI5LP1mkvObUTfDtqrJldX24FmRmGMzNxnSeTL QfX4iHMy4thHygcJUIe1YGurKild099YAnvT7oe8EelOLKfwmEII5dqvP pXqGPw29tpVsCF4JN4QlqNm+1LT92otNCpADGSgkAbJiqu4143CaHh8r6 YAvsPJKndOcsDA/j+50b7aJ/LjVrD3UVCyJvtXrgXDOLGNE4uyAywaPeu C7g0++Qrh7m67pSKBhGmwMAj3yA+RwaC6EzluJm0Bg5nj/x9o5gMO7159 pri+gKWLRcXd6NfGTm+U6qtM4O/AKqMm6Dg10YtapvlseCF0KdOhillAD w==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="436494544" X-IronPort-AV: E=Sophos;i="6.05,255,1701158400"; d="scan'208";a="436494544" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 18:40:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,255,1701158400"; d="scan'208";a="6488655" Received: from lshui-mobl1.ccr.corp.intel.com (HELO [10.249.170.42]) ([10.249.170.42]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 18:40:12 -0800 Message-ID: <2b665c89-db75-4d5e-98d8-3c113684f532@linux.intel.com> Date: Fri, 9 Feb 2024 10:40:11 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Baolu Lu Subject: Re: [PATCH rc 3/8] iommu/vt-d: Add missing iotlb flush for parent domain To: "Tian, Kevin" , "Liu, Yi L" , "joro@8bytes.org" , "jgg@nvidia.com" Cc: baolu.lu@linux.intel.com, "alex.williamson@redhat.com" , "robin.murphy@arm.com" , "eric.auger@redhat.com" , "nicolinc@nvidia.com" , "kvm@vger.kernel.org" , "chao.p.peng@linux.intel.com" , "yi.y.sun@linux.intel.com" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "Duan, Zhenzhong" , "joao.m.martins@oracle.com" References: <20240208082307.15759-1-yi.l.liu@intel.com> <20240208082307.15759-4-yi.l.liu@intel.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/2/8 16:38, Tian, Kevin wrote: >> From: Liu, Yi L >> Sent: Thursday, February 8, 2024 4:23 PM >> >> +/* >> + * Flush the relevant caches in nested translation if the domain >> + * also serves as a parent >> + */ >> +static void parent_domain_flush(struct dmar_domain *domain, >> + unsigned long pfn, >> + unsigned long pages, int ih) >> +{ >> + struct dmar_domain *s1_domain; >> + >> + spin_lock(&domain->s1_lock); >> + list_for_each_entry(s1_domain, &domain->s1_domains, s2_link) { >> + struct iommu_domain_info *info; >> + unsigned long i; >> + >> + xa_for_each(&s1_domain->iommu_array, i, info) >> + __iommu_flush_iotlb_psi(info->iommu, info->did, >> + pfn, pages, ih); >> + } > As Jason suggested before this xarray lacks of proper locking. > > but given it's rc fix I'm fine with it. @Baolu we do need fix it soon so > this problem won't further expand like here. Yes. I planned to fix the locking issue in a separated series. Best regards, baolu