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 9777043CEFA for ; Tue, 30 Jun 2026 14:51:48 +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=1782831111; cv=none; b=o6tgdd5/IQIlPne6/M+e6NRRUVkxwuliCprtqoI+BboLUYfLGc/7Xl6FZ2Qw7A4fWwh/W6sBMg/DisEzqnWgicQJ/Ua+hKyh5e8GvR+o7SFNNwmWD8PrCYK6lt9BGLBiF48ynMfocXvIjguAC38Iripe1qVWEK4ci/0Tpm/oTyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782831111; c=relaxed/simple; bh=E4G4LPQQ3Dkwous6BybFpxhhimjU64PRxq0Qq1ULgIk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XtdN0h/DHy6o+akKFDJ5/9oe1DAVbRos0+MdM5cvsDtk5fyusxawZgrkQEsf8X/NRF8pSyICCLV+bpnYtQrDSrpY2K/IK1SJsuc4ws70CWlby9KjURkrX4gS7Nn/r3OSJfcssX9v4lEHmUn8vhHtT2Pi54XknUY3LVkjho/9ZpQ= 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=m8qWks1u; 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="m8qWks1u" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2c9b1db4964so54675ad.0 for ; Tue, 30 Jun 2026 07:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782831107; x=1783435907; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=5yhTYmczFL2uCxVu8k1+oZGQNpSYllSaCHFjNudZdlY=; b=m8qWks1uZrFBAwtdPhExOW5q9tYlhy5g5Kb15Uki+MRwjQWWXAwvSGYhFsqrBkr/9l cd/a/WPoWXFGaiXhScvgPindWJ1czbrpMU3s29NVYTC1hOyMZt81NQg6lsx4Us2/Y1pO bPD8yZse3v8bKZtvEDh5rwTRxENEk+/rhAD/AkY0cpc1kwDamEzSbBYAe3Ev5rvbiHwn aObXNA6R6zCcR3eKhbgSfp2EiTFt/bpfJQxi4KH49p/IKsW9Cfbj4VNzZzlBkSQA8Vte qDyULteM2dyGpMCSC7DYLQpocZBxuIf0YQXitZCxT8tr707Q7KbF5P6md8bRbD4EkNXM uUig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782831107; x=1783435907; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=5yhTYmczFL2uCxVu8k1+oZGQNpSYllSaCHFjNudZdlY=; b=YthZi1aUEhw4dCI3rBIGABPTD7AqNXGGSTa0wZtHHKlbV4obvF5zAr/7L4O6iaE0pO o2tfGfRaupuAAcPvIus6IJGbXyCSmzHOavVPQXJEddQGwSwWmx1LJt/7haPw65ABn8Fx Aagonpv1jC4B9mg7v+fv0CKDQIQ57Hk+qLpdry8nWrUvmiDUoABaJqSnwXWxhgoiDaK5 jVRSa+z3HG54wNZXV5LuAnmv5j+6K5l8kZHeF0xjzF8gEMcOiK1+uFupo+npcexlJqNt W2fZZUHYeU2nGkE7HWzKLnbk49arqB8r7o8QHXgzNEb2Sy7x1J4ZTfH0W/yOxpr4MBJq b5Bw== X-Forwarded-Encrypted: i=1; AHgh+RqO3JLcIUVrgM2uO7Z56Qn1c0WaqFkAAP7vhumk249WELtjoG8kivRHX89SZvlKO4GxRbRbvWuk9/R+vjw=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3k0GHcsDQ89VSjjr3Rcyf3x5PgKt9/uycUR9n7RsD3dF0FMXg 0x17610ounxBs5WBUB/6d1izgJxSPbwb+KnaFdQ7kZf6CKRkv5BoY06OgOr9wsgKxA== X-Gm-Gg: AfdE7cn5kQHlNlv0BUBxwQpFYyXV05JAV7DDWAH9ohV1o0WsWULbfXq0vEiQZ53RETY YLMiTSx1aMCag26wI9D6BvuWNR0yq9lQwC9KJeZvmlrWKslRMo+GNbJDdT73E92DZIlLeO/RyQJ GVzyVyFASJgwJJ3WFleYvxoqtMyYShC2InvtvkXcaSJWGHCUOxuE0zdtM8bL2rMDehjxdge2pnO S91zdqnWRwJJcW213Y+DGjxMjg6GTZaBJatJYbKonSkZoxT68AbSgN7QJmXxlbmjHuQYxfI/iD0 4XLvmcgD52PT1sBeuzeUzOq9tidHH+BvOfswazo//HZU8flkCDUqrHqZszfzDFFzYveUb4nC8t+ y6vqKPCiawR/O1S5OhXLdHdEWiGiKRw+iYkIUT1/6gv+CxcHqMDEVS/gJarITrIzXHusZzCK9bg 0F2DJsKPB6OM3/YdQLSFP1Mbi51QstYJxM0ki7YYXu/OMn8Lg= X-Received: by 2002:a17:903:ac6:b0:2ca:4f33:e87a with SMTP id d9443c01a7336-2ca5d8db7b3mr287655ad.17.1782831106989; Tue, 30 Jun 2026 07:51:46 -0700 (PDT) Received: from google.com (10.129.124.34.bc.googleusercontent.com. [34.124.129.10]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca382d64c6sm15636325ad.82.2026.06.30.07.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 07:51:46 -0700 (PDT) Date: Tue, 30 Jun 2026 14:51:40 +0000 From: Pranjal Shrivastava To: Mostafa Saleh Cc: Nicolin Chen , will@kernel.org, robin.murphy@arm.com, jgg@nvidia.com, joro@8bytes.org, kees@kernel.org, baolu.lu@linux.intel.com, kevin.tian@intel.com, miko.lenczewski@arm.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, stable@vger.kernel.org, jamien@nvidia.com Subject: Re: [PATCH rc v7 0/7] iommu/arm-smmu-v3: Fix device crash on kdump kernel Message-ID: References: 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 Content-Disposition: inline In-Reply-To: On Tue, Jun 30, 2026 at 01:17:30PM +0000, Mostafa Saleh wrote: > On Mon, Jun 29, 2026 at 11:15:33PM -0700, Nicolin Chen wrote: > > When transitioning to a kdump kernel, the primary kernel might have crashed > > while endpoint devices were actively bus-mastering DMA. Currently, the SMMU > > driver aggressively resets the hardware during probe by clearing CR0_SMMUEN > > and setting the Global Bypass Attribute (GBPA) to ABORT. > > > > In a kdump scenario, this aggressive reset is highly destructive: > > a) If GBPA is set to ABORT, in-flight DMA will be aborted, generating fatal > > PCIe AER or SErrors that may panic the kdump kernel > > Can you please clarify more on those errors, what conditions will > trigger that? > For example, patch 4 disables the EVTQ to avoid events as there might > be a lot, why are they not fatal also? > > > b) If GBPA is set to BYPASS, in-flight DMA targeting some IOVAs will bypass > > the SMMU and corrupt the physical memory at those 1:1 mapped IOVAs. > > > > To safely absorb in-flight DMA, the kdump kernel must leave SMMUEN=1 intact > > and avoid modifying STRTAB_BASE. This allows HW to continue translating in- > > flight DMA using the crashed kernel's page tables until the endpoint device > > drivers probe and quiesce their respective hardware. > > > > However, the ARM SMMUv3 architecture specification states that updating the > > SMMU_STRTAB_BASE register while SMMUEN == 1 is UNPREDICTABLE or ignored. > > > > This leaves a kdump kernel no choice but to adopt the stream table from the > > crashed kernel. > > In many cases the patches assume that the CDs/STE might be corrupted, > but still attempt to retrieve them with some validation > (log2size/split...) > However, the base address might be broken, TLBs state is unknown... > > IMO, although that might improve the status quo, there are still > heuristics, in addition to noticeable complexity to transition the > stream tables. I wonder if FW can deal with AER in that case before > booting the kdump kernel. I guess we're reading the base address from the HW register itself so that should be fine? CDs are in-memory so that's why they could be corrupted? About the TLB state, I'm not sure what might pollute it, since this is a kexec, I don't expect any non-kernel entity to gain program control before the kdump kernel.. Hence, IMO, we can't configure FW to deal with AER here.. Thanks, Praan