From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 1D12BC2D0BF for ; Tue, 17 Dec 2019 01:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F207424655 for ; Tue, 17 Dec 2019 01:40:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726390AbfLQBkJ (ORCPT ); Mon, 16 Dec 2019 20:40:09 -0500 Received: from mga04.intel.com ([192.55.52.120]:50019 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726016AbfLQBkI (ORCPT ); Mon, 16 Dec 2019 20:40:08 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Dec 2019 17:40:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,323,1571727600"; d="scan'208";a="227319975" Received: from allen-box.sh.intel.com (HELO [10.239.159.136]) ([10.239.159.136]) by orsmga002.jf.intel.com with ESMTP; 16 Dec 2019 17:40:04 -0800 Cc: baolu.lu@linux.intel.com, "Raj, Ashok" , "Kumar, Sanjay K" , "jacob.jun.pan@linux.intel.com" , "Tian, Kevin" , "Sun, Yi Y" , Peter Xu , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 5/6] iommu/vt-d: Flush PASID-based iotlb for iova over first level To: "Liu, Yi L" , Joerg Roedel , David Woodhouse , Alex Williamson References: <20191211021219.8997-1-baolu.lu@linux.intel.com> <20191211021219.8997-6-baolu.lu@linux.intel.com> <6a5f6695-d1fd-e7d1-3ea3-f222a1ef0e54@linux.intel.com> From: Lu Baolu Message-ID: <2b024c1e-79bd-6827-47e6-ae9457054c79@linux.intel.com> Date: Tue, 17 Dec 2019 09:39:12 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi, On 12/17/19 9:37 AM, Lu Baolu wrote: > You are right. I will change it accordingly. The logic should look > like: > > if (domain attached to physical device) >     flush_piotlb_with_RID2PASID() > else if (domain_attached_to_mdev_device) >     flush_piotlb_with_default_pasid() > Both! so no "else" here. Best regards, baolu > Does this work for you? Thanks for catching this!