From nobody Thu Apr 23 18:16:22 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g1kn32GvRz6bG1b for ; Thu, 23 Apr 2026 18:16:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g1kn302sgz3Qtc for ; Thu, 23 Apr 2026 18:16:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776968183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J2YM/5zA2gOJdMuXyOe5Xvg0dyx8psz/d3ZL/W9QhOI=; b=SV3r6qoyZRrUnBJw7S+pef5mXKc1QEQMsZqVxLvXbKcVcqitbHZEVTTcKgKmaPIm/y0J2F OiUMejRt5i+sT20m9yhvxrMQ4/ZHDr9LrkL/k1Cn6QbhG7koqbSUkfHrn1DRAoTKdkZ1Oj ysX6PFd3oq771l77o4XLGV5B3lb2pycig31eIDRZfCy9oafv+y3q0lUt/3pNSP7cayzSlj avLbQJmXQqetK8x9uzRFOAXKOOjQnJySyVVqx6D4bomlawXKsbd3BV3+n9U3q4MCoNBC5x 4lsa7HXA2vLPObAZrsSiDw6diaA3teyDbReCIiXlP4KSTGTEozS/YB454Y9hqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776968183; a=rsa-sha256; cv=none; b=vMdq0XreBEQnsMR1xzFemjE8fNvruJGnUHIU36NgUStxNVpKvaXOjlcZalNHeugS6ncmMr +JiiBCqTfgrKMEyu8cIQaf+/MmdOEkLLj5t+iwyQegLotwD8dVoTt4zpYUoUbQY5+wY1xM 6XJwjmIoe2DMtZuXVWnNgs7CrZYYhQsc6HoARLQiMeS2cBfsSnY1zm2GSI5TWZB+hOVF/H XSMuXOUk8usQCFvP4XSOQ50KrZ/SJc1PFOobDRxh1Nq2BnjV624t9wUFQtYDAKW5Ck3+Jf Q8URTjzzryy+FqDyb3afa7xzwjLt1vmeu5S82810d9GCBohfP+FGJiQYuq21sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776968183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J2YM/5zA2gOJdMuXyOe5Xvg0dyx8psz/d3ZL/W9QhOI=; b=Mbsru8+CBToU1CKRQZ7tmdNYfkAfKTq+fwrKp+q8Pxbl+HBgntqCLKar6ocs3X2V39I27A sawQmXnDBmBPLG3iLJceCbyvYoCcqAeS/JyNQYVn7jUBRJFULEXgxxe+yjUEcW9sj0emgL Q2RF4wEtdWD2qLQj0XFlV+ucs1cH0MQFjWH08eSAhnJW7MD1ZePP9TmEh+dLbLDnVtqLNu 2H4UdfOT4+gk4J9q+2An7KEM1reAIPtgFWHoSXBF9RL2lLpXM20AVyX6lUuNNifTCwzKQ+ 62thvKf0/vIhv2HZz1JaEzVEmei/8Awdy4UBZogLdOxOiRJ90XN2pJ1usWawwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g1kn26j9nzCNW for ; Thu, 23 Apr 2026 18:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 450b8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 23 Apr 2026 18:16:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c49cbf849dee - main - powerpc aim64: Return vm_paddr_t from moea64_bootstrap_alloc List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c49cbf849dee9121ed3b972df56d240068d0423e Auto-Submitted: auto-generated Date: Thu, 23 Apr 2026 18:16:22 +0000 Message-Id: <69ea61f6.450b8.4a1d980a@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c49cbf849dee9121ed3b972df56d240068d0423e commit c49cbf849dee9121ed3b972df56d240068d0423e Author: John Baldwin AuthorDate: 2026-04-23 17:05:54 +0000 Commit: John Baldwin CommitDate: 2026-04-23 17:05:54 +0000 powerpc aim64: Return vm_paddr_t from moea64_bootstrap_alloc Consistently use vm_paddr_t for the type returned from moea64_bootstrap_alloc and avoid temporarily smuggling it via a pointer. Instead, be explicit in the places that assume a 1:1 mapping. Effort: CHERI upstreaming Reviewed by: kib Sponsored by: AFRL, DARPA Pull Request: https://github.com/freebsd/freebsd-src/pull/2068 --- sys/powerpc/aim/mmu_oea64.c | 17 ++++++++++------- sys/powerpc/aim/mmu_oea64.h | 2 +- sys/powerpc/aim/mmu_radix.c | 2 +- sys/powerpc/aim/moea64_native.c | 15 +++++++-------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index ac0444ddade0..ebc1f68bc063 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -1022,6 +1022,7 @@ moea64_early_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) void moea64_mid_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) { + vm_paddr_t pa; int i; /* @@ -1054,14 +1055,15 @@ moea64_mid_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) moea64_bpvo_pool_size*sizeof(struct pvo_entry) / 1048576); } - moea64_bpvo_pool = (struct pvo_entry *)moea64_bootstrap_alloc( - moea64_bpvo_pool_size*sizeof(struct pvo_entry), PAGE_SIZE); + pa = moea64_bootstrap_alloc( + moea64_bpvo_pool_size * sizeof(struct pvo_entry), PAGE_SIZE); moea64_bpvo_pool_index = 0; /* Place at address usable through the direct map */ if (hw_direct_map) - moea64_bpvo_pool = (struct pvo_entry *) - PHYS_TO_DMAP((uintptr_t)moea64_bpvo_pool); + moea64_bpvo_pool = (struct pvo_entry *)PHYS_TO_DMAP(pa); + else + moea64_bpvo_pool = (struct pvo_entry *)pa; /* * Make sure kernel vsid is allocated as well as VSID 0. @@ -1106,7 +1108,8 @@ moea64_late_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) phandle_t mmu; ssize_t sz; int i; - vm_offset_t pa, va; + vm_paddr_t pa; + vm_offset_t va; void *dpcpu; /* @@ -2805,10 +2808,10 @@ moea64_remove_all(vm_page_t m) * Can only be called from moea64_bootstrap before avail start and end are * calculated. */ -vm_offset_t +vm_paddr_t moea64_bootstrap_alloc(vm_size_t size, vm_size_t align) { - vm_offset_t s, e; + vm_paddr_t s, e; int i, j; size = round_page(size); diff --git a/sys/powerpc/aim/mmu_oea64.h b/sys/powerpc/aim/mmu_oea64.h index bc93cf4d521d..1cb9072312b0 100644 --- a/sys/powerpc/aim/mmu_oea64.h +++ b/sys/powerpc/aim/mmu_oea64.h @@ -46,7 +46,7 @@ extern const struct mmu_kobj oea64_mmu; */ /* Allocate physical memory for use in moea64_bootstrap. */ -vm_offset_t moea64_bootstrap_alloc(vm_size_t size, vm_size_t align); +vm_paddr_t moea64_bootstrap_alloc(vm_size_t size, vm_size_t align); /* Set an LPTE structure to match the contents of a PVO */ void moea64_pte_from_pvo(const struct pvo_entry *pvo, struct lpte *lpte); diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 8b4c8ddcc578..cdfb979e2f87 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -893,7 +893,7 @@ pagezero(vm_offset_t va) static uint64_t allocpages(int n) { - u_int64_t ret; + vm_paddr_t ret; ret = moea64_bootstrap_alloc(n * PAGE_SIZE, PAGE_SIZE); for (int i = 0; i < n; i++) diff --git a/sys/powerpc/aim/moea64_native.c b/sys/powerpc/aim/moea64_native.c index b79da6c462ac..169a4da7598b 100644 --- a/sys/powerpc/aim/moea64_native.c +++ b/sys/powerpc/aim/moea64_native.c @@ -608,17 +608,16 @@ moea64_bootstrap_native(vm_offset_t kernelstart, vm_offset_t kernelend) * its own size. Pick the larger of the two, which works on all * systems. */ - moea64_pteg_table = (struct lpte *)moea64_bootstrap_alloc(size, - MAX(256*1024, size)); + pa = moea64_bootstrap_alloc(size, MAX(256*1024, size)); if (hw_direct_map) - moea64_pteg_table = - (struct lpte *)PHYS_TO_DMAP((vm_offset_t)moea64_pteg_table); + moea64_pteg_table = (struct lpte *)PHYS_TO_DMAP(pa); + else + moea64_pteg_table = (struct lpte *)pa; + /* Allocate partition table (ISA 3.0). */ if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { - moea64_part_table = - (struct pate *)moea64_bootstrap_alloc(PART_SIZE, PART_SIZE); - moea64_part_table = - (struct pate *)PHYS_TO_DMAP((vm_offset_t)moea64_part_table); + pa = moea64_bootstrap_alloc(PART_SIZE, PART_SIZE); + moea64_part_table = (struct pate *)PHYS_TO_DMAP(pa); } DISABLE_TRANS(msr); bzero(__DEVOLATILE(void *, moea64_pteg_table), moea64_pteg_count *