Re: [PATCH v1 13/13] KVM: s390: remove the last user of page->index

Claudio Imbrenda
2025-01-20T10:29:20Z

On Mon, 20 Jan 2025 10:43:15 +0100
David Hildenbrand <david@redhat.com> wrote:

> >> +static inline unsigned long gmap_pgste_get_index(unsigned long *pgt)
> >> +{
> >> + unsigned long *pgstes, res;
> >> +
> >> + pgstes = pgt + _PAGE_ENTRIES;
> >> +
> >> + res = (pgstes[0] & PGSTE_ST2_MASK) << 16;
> >> + res |= pgstes[1] & PGSTE_ST2_MASK;
> >> + res |= (pgstes[2] & PGSTE_ST2_MASK) >> 16;
> >> + res |= (pgstes[3] & PGSTE_ST2_MASK) >> 32;
> >> +
> >> + return res;
> >> +}
> >
> > I have to think about that change for a bit before I post an opinion.
>
> I'm wondering if we should just do what Willy suggested and use ptdesc
> -> pt_index instead?

we will need to store more stuff in the future; putting things in the
PGSTEs gives us 512 bytes per table (although I admit it looks... weird)

>
> It's not like we must "force" this removal here. If we'll simply
> allocate a ptdesc memdesc in the future for these page tables (just like
> for any other page table), we have that extra space easily available.
>
> The important part is getting rid of page->index now, but not
> necessarily ptdesc->pt_index.
>