From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C9373E3161 for ; Tue, 10 Mar 2026 20:00:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773172852; cv=none; b=at1Ru0AS0Ki1fyDg6XoDKqgrJk/O1U/KXFxtQppHJl6gTVAvdAMVCbg/d+KUrwdjVOCOIncBz0Zy1ALCAcR/OMNtkJZWIbPlwZe3qSKvaiter5SM71YIIeSjYT3l0cpwoZdRHR+vQQfkh/8O0QCdxWos6qaY+vHaogRkv79RuT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773172852; c=relaxed/simple; bh=CRgrUdtpUgdkaRQjebipTE+C+YCciQQD0TojrtBETB8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=egJBiUNDe26u/yMH6vUT2eZw+dDNpFtpPgMRZCrVAxG0Wtbv4vs+DNiVLTCTwRayZa+VciVvsQmoBVh14jKQhaUpMhDrA54G7hsvmGaRb9JdTntmm2F9MCUJshEpWOv4Zjd+P6HyP4BbcCGmlJuh7MFQhY6wjycFsfEWZPWPBKk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=u6UlQ2d9; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="u6UlQ2d9" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2aea4ebb048so6105ad.1 for ; Tue, 10 Mar 2026 13:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1773172850; x=1773777650; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CRgrUdtpUgdkaRQjebipTE+C+YCciQQD0TojrtBETB8=; b=u6UlQ2d9kj7DzeV5fPPeyV6YjBaajC4Y/10M+RIt67zJp/T+DHXFprbNcxNI//4Dgo 4D2o3CIV4ibVYhgE33vsmHrwq72e1aB5Bcx9U64YiMD9yFScHSPz+jQLRCLYLjyPcDGs yWJU+Lo565I0bueE3HKWW+HgswTejHKCOhk9sN9q1WxzBQO+VgT7cJnlDoosqCPDy+jL SajF5/peb/sSt5YNw1p4pULrTpyBT6fO4smLrbec8V1dzzmWv0e81DHf4s5dVtrkPEcm 5+tgTJukediSO+FrcY0ynO0uuZPmG9i6fyx/bUVNwhhNvKX3IVE5xYQpEXyGVYRgB2bY txvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773172850; x=1773777650; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CRgrUdtpUgdkaRQjebipTE+C+YCciQQD0TojrtBETB8=; b=qbfs0IiXDof1VFKvMIgg0dwoq4hT295dEzvj60TN9YnChKuQU1+htz8x/kwJQCRs1W i08Od5xXVwrFpOcd2qOrdOFLXLW1U5DQnVk3ZNe09WY7h79g4i7em5ya1pxUgiEDHBt4 ib/BOcDVY2wnkxTnrrY6KEBDDFrJb8/71RMhotgRw/Gw8+DI3cEpCA6BWDU3Pv7AIhnk Svz5dHW/8ziNuSN1vY2SFuNItVs7x41mHofQr5iRLYUlwJI7J6Q0wxRYcg28RuTFkjSp nh9r5vw6p9PyOgObvFWh0dha6vueFVlEh1pQdc3V6jQpXe3R3mO1/kU6J86hBjVC24kG nAkQ== X-Forwarded-Encrypted: i=1; AJvYcCVrADfOhI5hz/OV2vAiRe6Fpl2xJk5PE6gO3jexCi1e8lBtiRJem0Qca8+mHPa0UiZWp3ri5gX5ZlE9ZV8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw5p3Z7zsNbJafrTGmJhPOj36eOtQnRBjCot094kRusabcOZDHY 7m4SlHMmVO+BhampHuvGti0+gJS1fKYMlFa1gtX3muRRgqWVbs9F2yOlnKB+01yrkA== X-Gm-Gg: ATEYQzxosSu3fIlV2cASdbb2HoSJkRcwsB1KplKe48QwRpUm78TRSL56IA92sR85XLD X6gp7dc3p2GZ7BbS4nh1CPqTiKCS1Jai7qWQbarACK5OYQV43G/UKl8r4vc3ESxO5Zsn73aBMjj To0iOEM+C+OF8xHfG0YleYY4dR6wtCOw8NOXcha2CyC++aFRH9VdwnpD/pUiTPmZvZPEwEzO7jF CP2mcHE5IP8YVty7gkK1SOF15fEIxj7tO18Q8tYumn4S4wPbFYaj9uku2v2Ii1HtjtWRai9JFNS RFfhuuCEOZJvc/Jy0r5a4e8rWdhVJL+pbB1zldsEtmUx1880wVkbyyF8/bOY2ups7oqRqKSDmop h4paTEH+qUrrhHRt1qniQ4y5S4FnGaPqrUeFexixB2/qlIeNq6fN12EGpiFRYOJCeS3sl9VDfVO jxKKlPo4uahBgzKgHPQtyCzpzxYylt4qi3MN/tIqbsx9Munk5LqQVdbr8ChsoZcg== X-Received: by 2002:a17:903:234d:b0:2a3:cd98:f07 with SMTP id d9443c01a7336-2aeae708648mr72605ad.3.1773172849749; Tue, 10 Mar 2026 13:00:49 -0700 (PDT) Received: from google.com (168.136.83.34.bc.googleusercontent.com. [34.83.136.168]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-359f110991esm3573204a91.13.2026.03.10.13.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2026 13:00:49 -0700 (PDT) Date: Tue, 10 Mar 2026 20:00:45 +0000 From: Samiullah Khawaja To: Jason Gunthorpe Cc: Baolu Lu , Nicolin Chen , will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, bhelgaas@google.com, rafael@kernel.org, lenb@kernel.org, praan@google.com, kees@kernel.org, smostafa@google.com, Alexander.Grest@microsoft.com, kevin.tian@intel.com, miko.lenczewski@arm.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, vsethi@nvidia.com Subject: Re: [PATCH v1 2/2] iommu/arm-smmu-v3: Recover ATC invalidate timeouts Message-ID: References: <20260305153911.GT972761@nvidia.com> <6416b7fe-0190-4c7b-9a62-5da7d5eea794@linux.intel.com> <20260306130006.GF1651202@nvidia.com> <20260306194312.GL1651202@nvidia.com> <20260306200321.GN1651202@nvidia.com> <20260306202652.GP1651202@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20260306202652.GP1651202@nvidia.com> On Fri, Mar 06, 2026 at 04:26:52PM -0400, Jason Gunthorpe wrote: >On Fri, Mar 06, 2026 at 08:22:08PM +0000, Samiullah Khawaja wrote: > >> But do you think doing the timeout logic without fencing would be good >> enough? > >It is what ARM and AMD do, so I wouldn't object to it. I think without any back pressure to the caller, a device will be able to fill the invalidation queue with device IOTLB invalidations that get stuck until the HW timeout occurs. > >> Currently VT-d blocks itself, until it gets an Invalidation Timeout >> from HW, and system ends up in a hardlockup since interrupts are >> disabled. >> >> Are you concerned that if fencing is done without an RAS flow, the >> device might not be able to detect the failure (if it really needs ATS >> to work)? > >Yes, and then the device is badly locked because nothing will fix the >IOMMU fence. > >VFIO might fix it if it is restarted, but other approahces like >rmmod/insmod won't restore the broken device. > >So I'd rather see a more complete solution before we add fencing to >the iommu drivers. Minimally userspace doing a rmmod, flr, insmod >should be able to restore the device. > >Then auto-FLR through RAS could sit on top of that. > >> I am thinking, we can do translated fence and timeout change for VT-d. >> And the device can use existing RAS mechanism to recover itself. This >> way we atleast make sure that caller of flush can reuse the memory/IOVAs >> without UAFs. > >Without a larger framework to unfence I think this will get devices >stuck.. > >Jason