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

David Hildenbrand
2025-01-20T10:34:40Z

On 20.01.25 11:28, Claudio Imbrenda wrote:
> 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)

With memdesc/ptdesc you'll be able to allocate more without playing many
tricks.

Storing more information could be done today by allocating a separate
structure for these page tables and linking it via ptindex. Not that I
would suggest that just now. :)

But this is not something I am to decide, just pointing it out that it
likely can be done in a simpler+cleaner way and there is no way to rush
the pt_index removal.

--
Cheers,

David / dhildenb