On Fri, 03 Jul 2026 14:49:23 +0200,
Aditya Gupta <[email protected]> wrote:
> 
> 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) ?
> 

I have no idea why OpenBSD does it but I see in powerpc64's pmap.c:

#define PATMEMSZ        (64 * 1024)
#define PATSIZE         (ffs(PATMEMSZ) - 12)

which was introduced by this commit:
https://github.com/openbsd/src/commit/dfe2a24332fd6769a7f9bb5806753189dae4d9c9

-- 
wbr, Kirill

Reply via email to