Date: Tue, 7 May 2019 02:34:58 -0700 From: Mark Millard <marklmi@yahoo.com> To: Justin Hibbits <chmeeedalf@gmail.com>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org> Subject: PowerMac G5 context: kernel_va_to_slbv(...) and SLBV_L use vs. addresses < DMAP_BASE_ADDRESS Message-ID: <E68F567D-4F9A-46ED-B7CC-4CE8A7F1D402@yahoo.com>
next in thread | raw e-mail | index | archive | help
[DMAP_START below is an abbreviation of DMAP_BASE_ADDRESS.] kernel_va_to_slbv has logic for if slbv would have SLBV_L asserted or not: uint64_t kernel_va_to_slbv(vm_offset_t va) { uint64_t slbv; /* Set kernel VSID to deterministic value */ slbv =3D (KERNEL_VSID((uintptr_t)va >> ADDR_SR_SHFT)) << = SLBV_VSID_SHIFT; /* * Figure out if this is a large-page mapping. */ if (hw_direct_map && va > DMAP_BASE_ADDRESS && va < = DMAP_MAX_ADDRESS) { /* * XXX: If we have set up a direct map, assumes * all physical memory is mapped with large pages. */ =20 if (mem_valid(DMAP_TO_PHYS(va), 0) =3D=3D 0) slbv |=3D SLBV_L; } =20 return (slbv); } [Presuming hw_direct_map!=3D0 . . .] By having handle_kernel_slb_spill count its usage, broken out by address range and EXC_[DI]SE type, there are examples of slbtrap's that use handle_kernel_slb_spill for srr0<DMAP_START and for dar<DMAP_START. handle_kernel_slb_spill uses kernel_va_to_slbv. (So did my hack to -r345758 .) Are slbv values correct for small effective addresses by not having SLBV_L asserted? (Same memory, covered by two different page sizes based on the style of effective-address that happens to be used [upper bits different].) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E68F567D-4F9A-46ED-B7CC-4CE8A7F1D402>