On 02/07/26 18:31, Kirill A. Korinsky wrote:
<...snip...>
+
+bool ppc64_v3_get_pate(PowerPCCPU *cpu, target_ulong lpid, ppc_v3_pate_t
*entry)
+{
+ uint64_t pats = cpu->env.spr[SPR_PTCR] & PTCR_PATS;
+
+ /*
+ * Keep the existing ISA v3.0 PATS interpretation first. OpenBSD/powernv
+ * computes the value written to PTCR as ffs(PATMEMSZ) - 12, which writes 5
+ * for its 64KiB LPID 0 partition table. If the existing interpretation
+ * fails, accept that form only for the bare metal LPID 0 table.
+ */
+ if (ppc64_v3_get_pate_from_size(cpu, lpid, entry, 1ull << (pats + 12))) {
+ return true;
+ }
Thanks for the patch, though I still have a doubt here about PATS.
PowerISA says Partition Table Size=2^(12+PATS). But seems OpenBSD on PowerNV
populates PATS in such way that Partition Table Size=2^11 + PATS. Why does
OpenBSD populate PATS this way, or am I missing some document where
Partition
Table Size was 2^(11+PATS) ?
Rest of the code looks good to me.
Thanks,
- Aditya G