diff options
| author | Mike Rapoport (Microsoft) <rppt@kernel.org> | 2026-09-06 11:27:12 +0300 |
|---|---|---|
| committer | Janosch Frank <frankja@linux.ibm.com> | 2026-09-28 13:35:17 +0000 |
| commit | a9107d97c229a674fb0cb6a065eb2a292ce77665 (patch) | |
| tree | 8a9f90308c182b4faa4b6f31334bafbbc14e2d32 /tools/perf/scripts/python/stackcollapse.py | |
| parent | eae7c66bf221d2f1ce03d84310b9d603eddcde8e (diff) | |
| download | linux-next-a9107d97c229a674fb0cb6a065eb2a292ce77665.tar.gz linux-next-a9107d97c229a674fb0cb6a065eb2a292ce77665.zip | |
KVM: s390: Replace get_zeroed_page() with kzalloc() for sie_page2 and CMMA
kvm_arch_init_vm() allocates struct sie_page2 that holds the facility
list and the crypto control block of a VM and kvm_s390_vcpu_setup_cmma()
allocates the CMMA collaborative memory management block referenced by
the SIE control block. Both are passed to the hardware as physical
addresses and must be page aligned.
kmalloc() guarantees that a power of two sized allocation is aligned to
its size, so a PAGE_SIZE allocation is page aligned as well.
These buffers can be allocated with kmalloc() as there's nothing special
about them to go directly to the page allocator.
kmalloc() provides a better API that does not require ugly casts and
kfree() does not need to know the size of the freed object.
Performance difference between kmalloc() and __get_free_pages() is not
measurable as both allocators take an object/page from a per-CPU list for
fast path allocations.
For the slow path the performance is anyway determined by the amount of
reclaim involved rather than by what allocator is used.
The sie_page allocated in kvm_arch_vcpu_create() is left alone because it
is mapped to userspace with virt_to_page() in kvm_arch_vcpu_fault() and
therefore really needs a struct page.
The SIE hardware stores the offset of the next CBR entry in the low bits
of cbrlo, so mask them out before converting cbrlo back to a virtual
address. free_page() did not care, kfree() needs the address kzalloc()
returned.
Replace use of get_zeroed_page() with kzalloc() and free_page() with
kfree().
Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
Assisted-by: copilot:claude-opus
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
