From mboxrd@z Thu Jan 1 00:00:00 1970 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 274E63BA239 for ; Sun, 3 May 2026 13:04:58 +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=1777813500; cv=none; b=qqsX8F0CA2VgPYcwhKkQh2YxZqTfzK8C9vnCIirf2Ibt5AwnvMn0JXRRwEOr/m42M6Wjbv2skVmUQtadVq83mu2kh23yqNST/fgZ5gf6gTH5kZTdILfucxOyX/d7ee+8E7j88HjTt5KEzFJPXxKxvR41KQVPkbXi6HREyCTNbEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777813500; c=relaxed/simple; bh=pxhKz2GR35ZUdIIXc+m7zMs2NauF6khJP/vNBnuI3Vs=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=lfVzEv2RBTdcdwXZiS6f5DwT+A59TeXcprQut844YsEg3+sL6dZ/csRkV+tHtzj5E8zNpv/hE40HLaPcS6opLXFKD19Pxt1S58Y5CQtiFvrtfdi+ROs6zPWZx0GOapFJhgb6WiHW6vxN8oEI/hxmhNi9qwDE8JBF0wbS2Z9bXzQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Pa95i0NK; 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--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Pa95i0NK" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-488d1b5bca0so16159285e9.2 for ; Sun, 03 May 2026 06:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777813497; x=1778418297; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=r93yiCbs+QMjz28EZSPiqp6dKzu7WenXmSUTiEN/aL4=; b=Pa95i0NKW+5fEUgqySyH28dJGGJccz2NhhIttEQNOzQNrkyy4aBWZhjDnGQ0wHdF+u ytp9Wvr9GnK/Tp3ux/pcJH58nNlHRpNXza4BWIvLSKHAkHT/Okh7crghMyPIQZIh4VYh WVJPuzzfpM5IzEtJ99NNUyP1m1xB9B2WhJ8VS/jRVS4Unlz4pxdLqirJ5G07ViAyn6Gb /tTTxi4Yl0d4yFLIaG6H/rmAi/1f2VzDpcTIvcN3zRCzFOW1Lp0hBQIszX2jiI30H5tv btYNRQ7rvJuOf4zhSCoOJx7q5OncVe6h8GVRe5lhszKD5UlhtX7ryYAvOGDZEzHYinoQ 8NMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777813497; x=1778418297; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=r93yiCbs+QMjz28EZSPiqp6dKzu7WenXmSUTiEN/aL4=; b=EvTZz2k/HGUV07C1MUZAT3HnH7TP+3rzbYSMEjhMkd/Jc7FrxW6EK1dDRjGroyE/aU niHjGJuPE0UvG1G7VNwo5Hf/oWYCEotT0UjMxBgnB7lHVpacXi6d64RwW6NUiSvEEBv2 eekNbE095RFoCoL/tFBImyyebtTthdoahfiQRN/QhpsIJE1ElNOoNClaRojkRmM0g+9d 8GXb9/XieM5cIHqs20QA7ZlDKsGhauuaAispd4K+CwSKzIjkbN1AXvbPOkGaHnhywIcD 1glLKg8fX0ao55UMUvo0to339+3lI3MxMcShTZhcl2RhJgtpHC9TsHnMq1EAyaAkeS0G QRng== X-Gm-Message-State: AOJu0Ywmlgp5ZuaJNiyhwWsDCKNLh0YoxWUU4TGaePy8HzgojAQY8Bkz S3m1xQxY8jcbj1Rq4MpiGhPJHX0u87n0qsYaonnltgviEsoCf3GD0kHiSY2nrBKULqE/w2+HS4C TIA4Z0IK+e04vfw== X-Received: from wmni20.prod.google.com ([2002:a05:600c:714:b0:48a:53cb:251b]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3e0e:b0:48a:52ce:a4b1 with SMTP id 5b1f17b1804b1-48a98893048mr103875805e9.15.1777813497376; Sun, 03 May 2026 06:04:57 -0700 (PDT) Date: Sun, 03 May 2026 13:04:53 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAPVH92kC/32NTQ6CMBBGr0Jm7Zi28iOsvIdhUcoAk2BLWmwwh LtbOYDL95LvfTsE8kwBmmwHT5EDO5tAXTIwk7YjIfeJQQlVSCFuuN1LZMsrmpm0fS8odF8VeS1 Fpw2k2eJp4O1MPtvEE4fV+c/5EOXP/olFiQIH1VV1nRul+/IxOjfOdDXuBe1xHF9koU7YsQAAA A== X-Change-Id: 20251003-x86-init-cleanup-0ad754910bac X-Mailer: b4 0.14.3 Message-ID: <20260503-x86-init-cleanup-v2-0-bb690bd2477c@google.com> Subject: [PATCH v2 0/3] x86/mm: some cleanups for pagetable setup code From: Brendan Jackman To: Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Per discussion in [0] I'm looking for ways to refactor this code to make ASI easier to deal with. But, while looking, I found some little things that seem like just straightforward cleanups without any real refactoring needed. So let's start there. This applies to tip/master. I'm having some infra issues so this hasn't been through Sashiko review yet. I've tested it on QEMU. [0] https://lore.kernel.org/all/20250924-b4-asi-page-alloc-v1-0-2d861768041f@google.com/T/#t Signed-off-by: Brendan Jackman --- Changes in v2: - Simplified patchset, instead of trying to fix confusing code only to delete it in a subsequent patch, just delete it in the first place. - Fixed add_pfn_range_mapped() args. (This bug causes a KASAN build to crash during boot). - Link to v1: https://lore.kernel.org/r/20251003-x86-init-cleanup-v1-0-f2b7994c2ad6@google.com --- Brendan Jackman (3): x86/mm: drop unused return from init_memory_mapping() x86/mm: simplify calculation of max_pfn_mapped x86/mm: drop unused returns from direct map setup functions arch/x86/include/asm/pgtable.h | 3 +- arch/x86/mm/init.c | 19 ++++----- arch/x86/mm/init_32.c | 5 +-- arch/x86/mm/init_64.c | 96 +++++++++++++++--------------------------- arch/x86/mm/mm_internal.h | 11 ++--- 5 files changed, 48 insertions(+), 86 deletions(-) --- base-commit: 32b8f4c4b8650a879d15ca10f2462d1072e49381 change-id: 20251003-x86-init-cleanup-0ad754910bac Best regards, -- Brendan Jackman