From nobody Wed Oct 1 22:19:49 2025 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (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 8A94026C39B for ; Sun, 28 Sep 2025 19:07:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759086477; cv=none; b=bd26PYgh4up4mFBdXT42ea8TTiAun+ugawCxZRyFkVmqQA3vo6IhD+isxrVyKvHJdIOxGyDe/5/eagp7h+q/tptPSAHXsySH0ZnNPYIHEZGskllhASf+xt/1H05CIc4N/fi0FJ5vt+YQmbZTD4Uaf3Us9Hvmz/eFVcupjo20vgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759086477; c=relaxed/simple; bh=jkmwgnL7BhvDTNRmHeg8Vg8AsLanY9NZX4iIKwYAEYk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=qxxTmiHONPOj78/zPuHBCKIccipkOE3a0DMkFN87oQMEOKSUuHAKnG7nY3NExzLi9jn5YQwm6ersWKVGIJ1N6avpt722Ysq6Z4Iy032Jlo760sn7RpdtMFPQ7RvM59Jggca+xdic9bsXDGcQHhulq3cKsixi6+fPiazDJHIrC2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--skhawaja.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Xx9LuwPF; arc=none smtp.client-ip=209.85.210.202 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=flex--skhawaja.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Xx9LuwPF" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-77f2466eeb5so3163480b3a.2 for ; Sun, 28 Sep 2025 12:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1759086475; x=1759691275; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ucXCpHZHap8YpvFOrTnapJK/l5FI9kkW9aB4eroyCmw=; b=Xx9LuwPFaKX0yyMZ+zf91gKq7rJuYCKk5S8f5LV7Q9JP3M2rH5mqYs6s6KpkoUpCnf 0TZJg85adPtuYPGaOt4t8RNx2dqkEyQcJ+vY/yF6PhvOioD6JA4HIPM38RZjN8reFkIf voq+j4fq5jEYk5UlEehUDBl26ThH05NL34cMUCrPtjBagWvyv41HUjHg1r7TIdZJ4xB7 EomL/kRlyQdb5/kFk/dBguhOH/bi7NJONFaryKUWSL60i4NvKYkzxTW54GXJzLzIrj1S Hc4DjUt7WL+TLc40x9x/fbpo+nOdFMJHPkPv6BQeQsY3D9xoNa5IO08quFXmzvMoElIa BbSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759086475; x=1759691275; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ucXCpHZHap8YpvFOrTnapJK/l5FI9kkW9aB4eroyCmw=; b=HS6uEgGjw2wKjjCDxZThNnSNfEV9REAnISng6ehjQ8zqBqVFLZP0PemZJeFZNlaQDW Cg4JVz4L2I87ypy81ZdQq38XpcNxWIaDJpFpwMQr7tqVb2wW8L3J7oxx7VAlO/tCIsPr os3KZF/+Mm1TWEVJwO3nllrgCLA7ZUe1HBeXCDe01KfGswMXtZTp1TNivVmlHHJxrsqK cpa54wFhoSmj313iKFegfnNMdmKeMYsTVGAmjZnJZL+hM0eLcyB7nCkF93F9Y4TzuELe lwbsvw+sJSH+T9aF/9AWLbufQkmkgMT/CYcUWcpAviL/QrHisAL8UOAgL7dNaX2Ib+4N JqUQ== X-Forwarded-Encrypted: i=1; AJvYcCWeeTq67xpy8oX9iXpovtXKLTS5ESW8CgtTgg1dSJzzm09DT/670hpLpNCuI2BJP2eBlHDT0z/3TxP6eQM=@vger.kernel.org X-Gm-Message-State: AOJu0YzQmdMaNKHPMGz9PqCY1a+IMqv8M/NanWXFiroNNXS3NUptYT1k yXs9z3FGpxhPjghmQrvWEGsN9pjRziaNLCsZ9W54aMTO9DVQygkZIsgWu8kh3PH/Lta1eUBnadQ SxUkvpbBhZsRGnA== X-Google-Smtp-Source: AGHT+IHCtCjCjURftUd42BI8Xn94s+m6l5b6UgXQA8KkQXHy6gXqsx21JjwsoB3Xl8hB9g8pCQfv/F4XvBfXyg== X-Received: from pfbhk3.prod.google.com ([2002:a05:6a00:8783:b0:781:65e:cee5]) (user=skhawaja job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:240d:b0:76e:885a:c32c with SMTP id d2e1a72fcca58-780fceda55bmr14907781b3a.26.1759086474819; Sun, 28 Sep 2025 12:07:54 -0700 (PDT) Date: Sun, 28 Sep 2025 19:06:17 +0000 In-Reply-To: <20250928190624.3735830-1-skhawaja@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250928190624.3735830-1-skhawaja@google.com> X-Mailer: git-send-email 2.51.0.536.g15c5d4f767-goog Message-ID: <20250928190624.3735830-10-skhawaja@google.com> Subject: [RFC PATCH 09/15] iommu/vt-d: Add live update freeze callback From: Samiullah Khawaja To: David Woodhouse , Lu Baolu , Joerg Roedel , Will Deacon , Pasha Tatashin , Jason Gunthorpe , iommu@lists.linux.dev Cc: Samiullah Khawaja , Robin Murphy , Pratyush Yadav , Kevin Tian , linux-kernel@vger.kernel.org, Saeed Mahameed , Adithya Jayachandran , Parav Pandit , Leon Romanovsky , William Tu , Vipin Sharma , dmatlack@google.com, zhuyifei@google.com, Chris Li , praan@google.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The iommu_ser needs to be updated during freeze to set the physical address of the iommu_units and devices array as the virtual addresses will not be valid after kexec in the next kernel. Signed-off-by: Samiullah Khawaja --- drivers/iommu/intel/liveupdate.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/iommu/intel/liveupdate.c b/drivers/iommu/intel/liveupd= ate.c index fb214736aa3c..a7d9b07aaada 100644 --- a/drivers/iommu/intel/liveupdate.c +++ b/drivers/iommu/intel/liveupdate.c @@ -258,10 +258,21 @@ static void intel_liveupdate_finish(struct liveupdate= _subsystem *handle, u64 dat pr_warn("Not implemented\n"); } =20 +static int intel_liveupdate_freeze(struct liveupdate_subsystem *handle, u6= 4 *data) +{ + struct iommu_ser *ser =3D __va(*data); + + ser->iommu_units_phys =3D __pa(ser->iommu_units); + ser->devices_phys =3D __pa(ser->devices); + + return 0; +} + static struct liveupdate_subsystem_ops intel_liveupdate_subsystem_ops =3D { .prepare =3D intel_liveupdate_prepare, .finish =3D intel_liveupdate_finish, .cancel =3D intel_liveupdate_cancel, + .freeze =3D intel_liveupdate_freeze, }; =20 static struct liveupdate_subsystem intel_liveupdate_subsystem =3D { --=20 2.51.0.536.g15c5d4f767-goog