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

David Hildenbrand
2025-01-20T09:43:22Z

>> +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?

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.

--
Cheers,

David / dhildenb