Skip to content

Commit ebdd533

Browse files
committed
arch: ppc32 + riscv32 PAGE_OFFSET_INVARIANT=1 — unlock coupling synth
Same shape as the prior loongarch64 activation: PAGE_OFFSET on both arches is a single compile-time constant (0xc0000000) with no VMSPLIT or paging-mode runtime dependency within KASLD's modelled scope, so Q_PAGE_OFFSET is pinnable without evidence. page_offset_invariant_pin fires and text_base_coupling_synth propagates Q_VIRT_TEXT_BASE ↔ Q_PHYS_TEXT_BASE. ppc32 cross-test PASS; host 280/280.
1 parent 0f7541d commit ebdd533

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

src/include/kasld/arch/loongarch64.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
// Directmap leaks cannot reveal the KASLR slide.
3737
#define PAGE_OFFSET_RANDOMIZED 0
3838

39+
// The compile-time PAGE_OFFSET is the architectural guaranteed runtime
40+
// value: the kernel writes _ULCAST_(0x9) to the DMW1 CSR unconditionally
41+
// at boot, so Q_PAGE_OFFSET can be pinned without evidence — same
42+
// "architectural certainty" shape as MIPS CKSEG0 and ppc64 book3s.
43+
// Unlocks text_base_coupling_synth (it needs Q_PAGE_OFFSET pinned to
44+
// propagate Q_VIRT_TEXT_BASE ↔ Q_PHYS_TEXT_BASE).
45+
#define PAGE_OFFSET_INVARIANT 1
46+
3947
// XKPRANGE starts at 0x8000000000000000 (hardware direct map windows DMW0/1/2).
4048
// XKVRANGE starts at 0xc000000000000000 (vmalloc, modules, vmemmap).
4149
// XSPRANGE (0x4000000000000000) is hardware-accessible at PLV0 but unused by

src/include/kasld/arch/ppc32.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@
2323

2424
// PAGE_OFFSET and PHYS_OFFSET are compile-time on ppc32 (BookE
2525
// CONFIG_RELOCATABLE is out of KASLD scope). Mainline ppc32 has no KASLR —
26-
// text sits at a fixed offset within the linear map.
26+
// text sits at a fixed offset within the linear map. The compile-time
27+
// constant is the architectural guaranteed runtime value within KASLD's
28+
// modelled scope, so Q_PAGE_OFFSET is pinnable without evidence (same
29+
// shape as mips32/64 and ppc64). Unlocks text_base_coupling_synth.
2730
// https://elixir.bootlin.com/linux/v6.1.1/source/arch/powerpc/include/asm/page.h#L240
2831
#define DIRECTMAP_STATIC 1
2932
#define TEXT_TRACKS_DIRECTMAP 1
33+
#define PAGE_OFFSET_INVARIANT 1
3034

3135
#define KERNEL_VIRT_VAS_START PAGE_OFFSET
3236
#define KERNEL_VIRT_VAS_END 0xfffffffful

src/include/kasld/arch/riscv32.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@
2222
#define PHYS_OFFSET 0ul
2323
// PAGE_OFFSET and PHYS_OFFSET are compile-time on riscv32; the directmap
2424
// projection is sound. No mainline KASLR — text sits at a fixed offset
25-
// within the linear map.
25+
// within the linear map. The compile-time constant is the architectural
26+
// guaranteed runtime value (no VMSPLIT/SATP/paging-mode dependency on
27+
// riscv32), so Q_PAGE_OFFSET is pinnable without evidence — same shape
28+
// as mips32/64 and ppc32/64. Unlocks text_base_coupling_synth.
2629
#define DIRECTMAP_STATIC 1
2730
#define TEXT_TRACKS_DIRECTMAP 1
31+
#define PAGE_OFFSET_INVARIANT 1
2832

2933
#define KERNEL_VIRT_VAS_START PAGE_OFFSET
3034
#define KERNEL_VIRT_VAS_END 0xfffffffful

0 commit comments

Comments
 (0)