[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41dd5505-8a3a-4718-b906-936059620940@linux.intel.com>
Date: Wed, 9 Jul 2025 09:25:46 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>, Kevin Tian <kevin.tian@...el.com>,
Jann Horn <jannh@...gle.com>, Vasant Hegde <vasant.hegde@....com>,
Dave Hansen <dave.hansen@...el.com>, Alistair Popple <apopple@...dia.com>,
Peter Zijlstra <peterz@...radead.org>, Uladzislau Rezki <urezki@...il.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Andy Lutomirski <luto@...nel.org>, Yi Lai <yi1.lai@...el.com>,
iommu@...ts.linux.dev, security@...nel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH 1/1] iommu/sva: Invalidate KVA range on kernel TLB flush
On 7/8/25 22:06, Jason Gunthorpe wrote:
> On Tue, Jul 08, 2025 at 09:27:55AM -0300, Jason Gunthorpe wrote:
>> On Tue, Jul 08, 2025 at 01:42:53PM +0800, Baolu Lu wrote:
>>>> +void iommu_sva_invalidate_kva_range(unsigned long start, unsigned long end)
>>>> +{
>>>> + struct iommu_mm_data *iommu_mm;
>>>> +
>>>> + might_sleep();
>>>
>>> Yi Lai <yi1.lai@...el.com> reported an issue here. This interface could
>>> potentially be called in a non-sleepable context.
>>
>> Oh thats really bad, the notifiers inside the iommu driver are not
>> required to be called in a sleepable context either and I don't really
>> want to change that requirement.
>
> Actually, I have got confused here with the hmm use of notifiers.
>
> The iommu drivers use arch_invalidate_secondary_tlbs so they are
> already in atomic contexts.
>
> So your idea to use a spinlock seems correct.
Okay, then let me post an updated version.
Thanks,
baolu
Powered by blists - more mailing lists