From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34D292877E5; Tue, 5 May 2026 08:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777969353; cv=none; b=TjtyReEpoESMADz/9rvBbBgHcmeXRywr4YHW4ObcUSuk3E17EhnfpgKYii5Op08ea3aQ6rGMoGJdhUW/NnpywkhcdIXJqdrP6Z0U0y6ZPX76ERW7ifWX8eGjWjYtW4oHrHVoM3HesgKJ7uOm8/PXrCz8aTxhdHE6bjUu3pmbgWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777969353; c=relaxed/simple; bh=p628Pfp1wDvlmIpYJ1E03FuKc46jBo2Suz4LTSq9Ef8=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=iykLX1QmzBxh9fxi4YCpSe1AAQwnsiP/MqXiAfDJVzR6VVf8ztgMUTi3JfRoccaUyW/hEl3JdIMsjY3gz7Ucfi+9e0fiHqgDuWkky/PVhsj2G6cHLTuhoue4Go+Zql6rnnBkSaEEkwF/NDpSp+4WL+xOPqOSrk6SrcvtAmadQKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=BLC5MlbL; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=S/w43rLB; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BLC5MlbL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="S/w43rLB" Date: Tue, 05 May 2026 08:22:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777969350; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NfJ1YduhltV+uaN4L6tWu1N+7FQbIUL59Zqc4X2ZkGQ=; b=BLC5MlbLbTtsTdDUzIrgvGle47013JfO2P/gEVbfxVRGNqTkmkoWfpuFBPyo8A2zvRwx3V pemz6g+A+NPc5JyB1R8Bjwqi6yzFBzlJHw84q5SxCgDxKOjZIfJSQbcIQct+T6VyvElDww HHlPE6rIYYWt8VzlQNE8unryG5ndPjS0HOivgYPoJq/fK4UdIsAcNPJ5NdQvx8l74M2Lxv KOWINWXnEYKVQSJtb7ytgRyZdIK+mB2t6SfsOanNI0UErzijCu1/1s/+DH2EOPJ25AnbS4 AfRCnZXsR0Myknv/jI3vs5u5CG1I8o5KF8I63OcWtFnbiX48GuTdaCpmNu9vlA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777969350; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NfJ1YduhltV+uaN4L6tWu1N+7FQbIUL59Zqc4X2ZkGQ=; b=S/w43rLBt5Tlyfy2AJR2F2D4w9Nnj9xNeQTvWXi6LzsE3IlB0iWK0QJRapaesXJcLpCvzi HeHF3ogJfKcy7ZBA== From: "tip-bot2 for Juergen Gross" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/xen: Fix a potential problem in xen_e820_resolve_conflicts() Cc: Juergen Gross , Ingo Molnar , xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260505080653.197775-1-jgross@suse.com> References: <20260505080653.197775-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177796934897.424702.11107616066849971102.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 5f8719945244dd65b5fa06195f4600db62581610 Gitweb: https://git.kernel.org/tip/5f8719945244dd65b5fa06195f4600db625= 81610 Author: Juergen Gross AuthorDate: Tue, 05 May 2026 10:06:53 +02:00 Committer: Ingo Molnar CommitterDate: Tue, 05 May 2026 10:17:00 +02:00 x86/xen: Fix a potential problem in xen_e820_resolve_conflicts() When fixing a conflict in xen_e820_resolve_conflicts(), the loop over the E820 map entries needs to be restarted, as the E820 map will have been modified by the fix. Otherwise entries might be skipped by accident. Fixes: be35d91c8880 ("xen: tolerate ACPI NVS memory overlapping with Xen allo= cated memory") Signed-off-by: Juergen Gross Signed-off-by: Ingo Molnar Cc: xen-devel@lists.xenproject.org Link: https://patch.msgid.link/20260505080653.197775-1-jgross@suse.com --- arch/x86/xen/setup.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index ac8021c..bb95a05 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -695,17 +695,22 @@ static void __init xen_e820_resolve_conflicts(phys_addr= _t start, return; =20 end =3D start + size; - entry =3D xen_e820_table.entries; + mapcnt =3D 0; =20 - for (mapcnt =3D 0; mapcnt < xen_e820_table.nr_entries; mapcnt++) { + while (mapcnt < xen_e820_table.nr_entries) { + entry =3D xen_e820_table.entries + mapcnt; if (entry->addr >=3D end) return; =20 if (entry->addr + entry->size > start && - entry->type =3D=3D E820_TYPE_NVS) + entry->type =3D=3D E820_TYPE_NVS) { xen_e820_swap_entry_with_ram(entry); + /* E820 map has been changed, restart loop! */ + mapcnt =3D 0; + continue; + } =20 - entry++; + mapcnt++; } } =20