Re: [PATCH 09/11] KVM: selftests: Make vm_create_default common

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 05.11.20 19:45, Peter Xu wrote:
> On Thu, Nov 05, 2020 at 10:59:30AM +0100, Andrew Jones wrote:
>>>>> +#define PTRS_PER_PAGE(page_size)	((page_size) / 8)
>>>>
>>>> Doh. I think this 8 is supposed to be a 16 for s390x, considering it
>>>> was dividing by 256 in its version of vm_create_default. I need
>>>> guidance from s390x gurus as to whether or not I should respin though.
>>>>
>>>> Thanks,
>>>> drew
>>>>
>>>
>>> This is kind of tricky. The last level page table is only 2kb (256 entries = 1MB range).
>>> Depending on whether the page table allocation is clever or not (you can have 2 page
>>> tables in one page) this means that indeed 16 might be better. But then you actually 
>>> want to change the macro name to PTES_PER_PAGE?
>>
>> Thanks Christian,
>>
>> I'll respin with the macro name change and 16 for s390.
> 
> Maybe it can also be moved to common header, but instead define PTR_SIZE for
> per-arch?  I'm also curious whether PTR_SIZE will equals to "sizeof(void *)",
> but seems not for s390x..  Thanks,

Thats why I want to change the name. It is not about the ptr size. It is about
number of page table entries in a page. And as a page table is just 2kb on s390
there is a mismatch. So instead of

#define PTRS_PER_PAGE(page_size)	((page_size) / 8)

let us just to
#define PTES_PER_PAGETABLE 256
for s390
and
#define PTES_PER_PAGETABLE 512
for the others



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux