[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DS0PR11MB7529E0EEFC3E33549875549CC35CA@DS0PR11MB7529.namprd11.prod.outlook.com>
Date: Tue, 20 Jun 2023 06:22:20 +0000
From: "Liu, Yi L" <yi.l.liu@...el.com>
To: Baolu Lu <baolu.lu@...ux.intel.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
"joro@...tes.org" <joro@...tes.org>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"jgg@...dia.com" <jgg@...dia.com>,
"robin.murphy@....com" <robin.murphy@....com>
CC: "cohuck@...hat.com" <cohuck@...hat.com>,
"eric.auger@...hat.com" <eric.auger@...hat.com>,
"nicolinc@...dia.com" <nicolinc@...dia.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"mjrosato@...ux.ibm.com" <mjrosato@...ux.ibm.com>,
"chao.p.peng@...ux.intel.com" <chao.p.peng@...ux.intel.com>,
"yi.y.sun@...ux.intel.com" <yi.y.sun@...ux.intel.com>,
"peterx@...hat.com" <peterx@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"shameerali.kolothum.thodi@...wei.com"
<shameerali.kolothum.thodi@...wei.com>,
"lulu@...hat.com" <lulu@...hat.com>,
"suravee.suthikulpanit@....com" <suravee.suthikulpanit@....com>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"Duan, Zhenzhong" <zhenzhong.duan@...el.com>
Subject: RE: [PATCH v3 07/10] iommu/vt-d: Add iotlb flush for nested domain
> From: Baolu Lu <baolu.lu@...ux.intel.com>
> Sent: Thursday, June 8, 2023 4:08 PM
>
> On 2023/6/8 15:14, Liu, Yi L wrote:
> >>> + * stage-1 page table cache
> >>> + * invalidation
> >>> + * @IOMMU_VTD_QI_FLAGS_LEAF: The LEAF flag indicates whether only the
> >>> + * leaf PTE caching needs to be invalidated
> >>> + * and other paging structure caches can be
> >>> + * preserved.
> >>> + */
> >> what about "Drain Reads" and "Drain Writes"? Is the user allowed/required
> >> to provide those hints?
> > All other comments got. For these two hints, the two flags are from the IOTLB
> > Invalidation descriptor. Per below description, the hardware that supports nested
> > should support drain and does not require software to ask for it. So it appears no
> > need to define them in uapi.
> >
> > "Hardware implementation with Major Version 2 or higher (VER_REG),
> > always performs required drain without software explicitly requesting
> > a drain in IOTLB invalidation. This field is deprecated and hardware
> > will always report it as 1 to maintain backward compatibility with
> > software"
>
> Make sense. Perhaps we can also remove below code in
> __iommu_flush_iotlb():
>
> /* Note: set drain read/write */
> #if 0
> /*
> * This is probably to be super secure.. Looks like we can
> * ignore it without any impact.
> */
> if (cap_read_drain(iommu->cap))
> val |= DMA_TLB_READ_DRAIN;
> #endif
This seems dead code. But it is there for a long time since below commit.
ba39592764ed20cee09aae5352e603a27bf56b0d
Regards,
Yi Liu
Powered by blists - more mailing lists