From nobody Sun Feb 8 15:57:35 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (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 38F87314D17 for ; Mon, 26 Jan 2026 09:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769419667; cv=none; b=EWaYZW2OWGVVDcGWsxHXOIz7ZjValEgIq82fS9yhTstRfZQFS7eKunID3Misou0Gc6L93ufGgHjECcOJP8U40JU2sJj5N0njlKROo8iuMFs5Z+G/Ph/6WO9IanGd3EJbQC4MLHYNtlfzdGjdl4ktf5BUgyN1q6vN/aEvO/uyx10= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769419667; c=relaxed/simple; bh=aWvImcQIG2Lxet7GuE/7T19bLGTXrPIqmOHZ8YE7GsQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WLCuWnmFfIxDgffRRxejcDvqWXzN54B5TTMtf9vTd6YZt8FjVsnNSNwOxwj44nJr2PFdSmQ1773TORcYvU5O5Ps+4m88vgRTyCJoSaF1F3/TR6rk68bKlGOrhiQrmyK34ZzFihG4zRXsWAV20W+jM4Bj+vIvPp6tcB9BkWlSY5A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=RGOGKD2c; arc=none smtp.client-ip=209.85.128.73 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--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="RGOGKD2c" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-47edf8ba319so41067885e9.2 for ; Mon, 26 Jan 2026 01:27:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769419657; x=1770024457; 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=dus1eDjKV8+fyJlWa6CeOHr5Q8TfY7EJ7ksMCXuuvE8=; b=RGOGKD2cJDEe0CTcDGvkbUtum9duw3g+s9znv7LUz7k2nKjXjKJeE5vflHP1EWG0by Mo6BHwz3rBXDqp6YpdjKKrKPGIpVz33yQvni16gjG/uzpA8r9Z3+WmB678OpPrJitXkO p6lXxSfN7CMfoCJxsc6T43vz/a1aHkgUY5OEGEEJ7GkeF66b7I6YaTQ/falBLzsGwEYi ibQP0xqwQ0CnXkraQj+r792g0jXEnhUgpgg7BUC2TtY14/inN4ItF+z49Q5RZZSW9d9g t5fl9MRfjT8NGHAmxCXWbw/FMqxIZK7rDP/aq/yMufmw2pg/wB4Mad34Ai5mRFYFV7BX oi/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769419657; x=1770024457; 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=dus1eDjKV8+fyJlWa6CeOHr5Q8TfY7EJ7ksMCXuuvE8=; b=RyBRNo7uZdoDJtNoGt7GNhZGXXK8NKqK+tIbbgS8LjwDt8fpgLLxW0i8UKUP6T+469 xepi8Db6786NjQUG0i32yCewuxutkbGFwwlbzV8qkFNu+t4C8eWQRjksLXteyWK0hFJK vCoDnQMVhVAAPaBqmJ6PQ/aytMbzs1Bk+avHk/0hivxE3QyJX3LsSw2khaEGBTycPVd7 D39K75+j+C1E2DAjiaaBzDA+C6Y2N88g1phHDqSUxf/d2O2/gX+tePMocd4zBrVV3HfJ vrQiPv+/TGpKOG8rpQSYOzteW1WHWYswpfd7DLQz0U7TraMX6fAhZqghpl+6eMS9tmmy guug== X-Gm-Message-State: AOJu0YxcvAwLaHE58ZIlPEiKsbwa7cLUazwqWKsfo/CrloOmIo0j11Wt lR0cWzRuat8miWtq7VcLzWX7TdRv7XQp/h+TJtK+x4uVWlw1DQ/fqveOUMVm+iDnzTs9xXRdpnX OeWBsUkalo5xUk3oIcILBGplP615dO1lweNDIQ2SzVGhCYgUrf0E5XZojttN7snp/dh+1/g4onL R4hPiUmR2t4cCeYYcinf9p9JCd1gRhtOKhKQ== X-Received: from wmlf14.prod.google.com ([2002:a7b:c8ce:0:b0:480:4a03:7b6b]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:528d:b0:477:54cd:200e with SMTP id 5b1f17b1804b1-4805ce3f893mr62195305e9.1.1769419656709; Mon, 26 Jan 2026 01:27:36 -0800 (PST) Date: Mon, 26 Jan 2026 10:26:37 +0100 In-Reply-To: <20260126092630.1800589-12-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260126092630.1800589-12-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=916; i=ardb@kernel.org; h=from:subject; bh=AbBNGoFlUmz8DhotcNagR6+hcZWJ6aqvLIQOSvGP0oY=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIbPc2Ctw67qkcsYnkz6HVyaIFV/R/hlm+kvXoVE7kZW7Y APXosqOUhYGMS4GWTFFFoHZf9/tPD1RqtZ5lizMHFYmkCEMXJwCMJEbfxn+R/2O9dR21crak6f7 +c5MiwrF2xnXXYI4zDR6lOzKa4V2MPzTu6eudlBgRo3JnMb/EVvfGrmcsfoU/mC9Z4jaodsrJ+x jAwA= X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260126092630.1800589-18-ardb+git@google.com> Subject: [PATCH v2 06/10] arm64: mm: Remove bogus stop condition from map_mem() loop From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, Ard Biesheuvel , Ryan Roberts , Anshuman Khandual , Liz Prucka , Seth Jenkins , Kees Cook , linux-hardening@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel The memblock API guarantees that start is not greater than or equal to end, so there is no need to test it. And if were, it is doubtful that breaking out of the loop would be a reasonable course of action here (rather than attempting to map the remaining regions) So let's drop this check. Signed-off-by: Ard Biesheuvel Reviewed-by: Ryan Roberts --- arch/arm64/mm/mmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index d7faa98f427c..377bdc4d84a1 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1158,8 +1158,6 @@ static void __init map_mem(pgd_t *pgdp) =20 /* map all the memory banks */ for_each_mem_range(i, &start, &end) { - if (start >=3D end) - break; /* * The linear map must allow allocation tags reading/writing * if MTE is present. Otherwise, it has the same attributes as --=20 2.52.0.457.g6b5491de43-goog