summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* s390: support command lines longer than 896 bytesSven Schnelle2021-10-267-34/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently s390 supports a fixed maximum command line length of 896 bytes. This isn't enough as some installers are trying to pass all configuration data via kernel command line, and even with zfcp alone it is easy to generate really long command lines. Therefore extend the command line to 4 kbytes. In the parm area where the command line is stored there is no indication of the maximum allowed length, so a new field which contains the maximum length is added. The parm area has always been initialized to zero, so with old kernels this field would read zero. This is important because tools like zipl could read this field. If it contains a number larger than zero zipl knows the maximum length that can be stored in the parm area, otherwise it must assume that it is booting a legacy kernel and only 896 bytes are available. The removing of trailing whitespace in head.S is also removed because code to do this is already present in setup_boot_command_line(). Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/kexec_file: move kernel image size checkSven Schnelle2021-10-263-18/+2
| | | | | | | | | | | | | | | | In preparation of adding support for command lines with variable sizes on s390, the check whether the new kernel image is at least HEAD_END bytes long isn't correct. Move the check to kexec_file_add_components() so we can get the size of the parm area and check the size there. The '.org HEAD_END' directive can now also be removed from head.S. This was used in the past to reserve space for the early sccb buffer, but with commit 9a5131b87cac1 ("s390/boot: move sclp early buffer from fixed address in asm to C") this is no longer required. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/pci: add s390_iommu_aperture kernel parameterNiklas Schnelle2021-10-262-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | Some applications map the same memory area for DMA multiple times while also mapping significant amounts of memory. With our current DMA code these applications will run out of DMA addresses after mapping half of the available memory because the number of DMA mappings is constrained by the number of concurrently active DMA addresses we support which in turn is limited by the minimum of hardware constraints and high_memory. Limiting the number of active DMA addresses to high_memory is only a heuristic to save memory used by the iommu_bitmap and DMA page tables however. This was added under the assumption that it rarely makes sense to DMA map more than system memory. To accommodate special applications which insist on double mapping, which works on other platforms, allow specifying a factor of how many times installed memory is available as DMA address space. Use 0 as a special value to apply no constraints beyond what hardware dictates at the expense of significantly more memory use. Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.ibm.com> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/spinlock: remove incorrect kernel doc indicatorHeiko Carstens2021-10-261-1/+1
| | | | | Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/string: use generic strlcpyHeiko Carstens2021-10-262-28/+0
| | | | | | | | | The generic version of strlcpy is identical to the architecure specific variant. Therefore use the generic variant. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/string: use generic strrchrHeiko Carstens2021-10-262-21/+0
| | | | | | | | | | | | Use generic strrchr instead of an optimized architecture specific variant. Performance of strrchr is not relevant for real life workloads, since the only user which may call this more frequently would be kbasename(). Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/lkml/CAHk-=whoe211F8ND-9hZvfnib0UA4gga8DZJ+YaBZNbE4fubdg@mail.gmail.com/ Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/ap: function rework based on compiler warningHarald Freudenberger2021-10-261-0/+3
| | | | | | | | | | | | | | | | Slight rework of function __ap_revise_reserved() because of unused variable warning when build with W=1. This patch introduces an additional debug feature warning message when device_reprobe() returns with failure. However, the return value of __ap_revise_reserved() is still hard coded to 0 as this is a callback function to be used together with bus_for_each_dev() and thus the return value indicates to go on with the bus_for_each_dev() loop and not apport on a failure of something within this function. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/cio: make ccw_device_dma_* more robustHalil Pasic2021-10-261-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 48720ba56891 ("virtio/s390: use DMA memory for ccw I/O and classic notifiers") we were supposed to make sure that virtio_ccw_release_dev() completes before the ccw device and the attached dma pool are torn down, but unfortunately we did not. Before that commit it used to be OK to delay cleaning up the memory allocated by virtio-ccw indefinitely (which isn't really intuitive for guys used to destruction happens in reverse construction order), but now we trigger a BUG_ON if the genpool is destroyed before all memory allocated from it is deallocated. Which brings down the guest. We can observe this problem, when unregister_virtio_device() does not give up the last reference to the virtio_device (e.g. because a virtio-scsi attached scsi disk got removed without previously unmounting its previously mounted partition). To make sure that the genpool is only destroyed after all the necessary freeing is done let us take a reference on the ccw device on each ccw_device_dma_zalloc() and give it up on each ccw_device_dma_free(). Actually there are multiple approaches to fixing the problem at hand that can work. The upside of this one is that it is the safest one while remaining simple. We don't crash the guest even if the driver does not pair allocations and frees. The downside is the reference counting overhead, that the reference counting for ccw devices becomes more complex, in a sense that we need to pair the calls to the aforementioned functions for it to be correct, and that if we happen to leak, we leak more than necessary (the whole ccw device instead of just the genpool). Some alternatives to this approach are taking a reference in virtio_ccw_online() and giving it up in virtio_ccw_release_dev() or making sure virtio_ccw_release_dev() completes its work before virtio_ccw_remove() returns. The downside of these approaches is that these are less safe against programming errors. Cc: <stable@vger.kernel.org> # v5.3 Signed-off-by: Halil Pasic <pasic@linux.ibm.com> Fixes: 48720ba56891 ("virtio/s390: use DMA memory for ccw I/O and classic notifiers") Reported-by: bfu@redhat.com Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com> Acked-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/vfio-ap: s390/crypto: fix all kernel-doc warningsTony Krowiak2021-10-263-20/+44
| | | | | | | | | | | Fixes the kernel-doc warnings in the following source files: * drivers/s390/crypto/vfio_ap_private.h * drivers/s390/crypto/vfio_ap_drv.c * drivers/s390/crypto/vfio_ap_ops.c Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/hmcdrv: fix kernel doc commentsHeiko Carstens2021-10-261-0/+3
| | | | | Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/ap: new module option ap.useirqHarald Freudenberger2021-10-261-1/+5
| | | | | | | | | | | | | | | | | | This patch introduces a new AP module option to be able to control if the ap bus code is using interrupts or not. By default if the interrupt support is available it is used. This option makes it possible to disable interrupt use even when interrupt support is available. It should be obvious that this option can't magically enable interrupt support when the hardware or hypervisor layer does not support AP interrupts. On the kernel command line use ap.useirq=0 or ap.useirq=1 to disable or enable (that's the default) interrupt use. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/cpumf: Allow multiple processes to access /dev/hwcThomas Richter2021-10-261-78/+150
| | | | | | | | | | | | | | | | | | | Commit a029a4eab39e ("s390/cpumf: Allow concurrent access for CPU Measurement Counter Facility") added CPU Measurement counter facility access to multiple consumers. It allows concurrent access to the CPU Measurement counter facility via several perf_event_open() system call invocations and via ioctl() system call of device /dev/hwc. However the access via device /dev/hwc was exclusive, only one process was able to open this device. The patch removes this restriction. Now multiple invocations of lshwc can execute in parallel. They can access different CPUs and counter sets or CPUs and counter set can overlap. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Suggested-by: Heiko Carstens <hca@linux.ibm.com> Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/bitops: return true/false (not 1/0) from bool functionsHuilong Deng2021-10-261-1/+1
| | | | | | | Signed-off-by: Huilong Deng <denghuilong@cdjrlc.com> Link: https://lore.kernel.org/r/20211017092057.24179-1-denghuilong@cdjrlc.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390: add support for BEAR enhancement facilitySven Schnelle2021-10-2611-24/+87
| | | | | | | | | | | | | | | | | | | The Breaking-Event-Address-Register (BEAR) stores the address of the last breaking event instruction. Breaking events are usually instructions that change the program flow - for example branches, and instructions that modify the address in the PSW like lpswe. This is useful for debugging wild branches, because one could easily figure out where the wild branch was originating from. What is problematic is that lpswe is considered a breaking event, and therefore overwrites BEAR on kernel exit. The BEAR enhancement facility adds new instructions that allow to save/restore BEAR and also an lpswey instruction that doesn't cause a breaking event. So we can save BEAR on kernel entry and restore it on exit to user space. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390: introduce nospec_uses_trampoline()Sven Schnelle2021-10-264-5/+10
| | | | | | | | | and replace all of the "__is_defined(CC_USING_EXPOLINE) && !nospec_disable" occurrences. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390: rename last_break to pgm_last_breakSven Schnelle2021-10-265-6/+6
| | | | | | | | | | | With the upcoming BEAR enhancements last_break isn't really unique, so rename it to pgm_last_break. This way it should be more obvious that this is the last_break value that is written by the hardware when a program check occurs. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/ptrace: add last_break member to pt_regsSven Schnelle2021-10-263-2/+3
| | | | | | | | | Instead of using args[0] for the value of the last breaking event address register, add a member to make things more obvious. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/sclp: sort out physical vs virtual pointers usageAlexander Gordeev2021-10-266-9/+16
| | | | | | | | | | | | | | | | | Provide physical addresses whenever the hardware interface expects it or a 32-bit value used for tracking. Variable sclp_early_sccb gets initialized in the decompressor and points to an address in physcal memory. Yet, it is used as virtual memory pointer and therefore should be converted. Note, the other two __bootdata variables sclp_info_sccb and sclp_info_sccb_valid contain plain data, but no pointers and do need any special care. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/setup: convert start and end initrd pointers to virtualAlexander Gordeev2021-10-261-1/+1
| | | | | | | | | Variables initrd_start and initrd_end are expected to hold virtual memory pointers, not physical. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/setup: use physical pointers for memblock_reserve()Alexander Gordeev2021-10-261-5/+2
| | | | | | | | | memblock_reserve() function accepts physcal address of a memory block to be reserved, but provided with virtual memory pointers. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/setup: use virtual address for STSI instructionAlexander Gordeev2021-10-261-4/+2
| | | | | | | | Provide virtual memory pointer for system-information block. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/cpcmd: use physical address for command and responseAlexander Gordeev2021-10-261-3/+3
| | | | | | | | | Virtual Console Function DIAGNOSE 8 accepts physical addresses of command and response strings. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/pgtable: use physical address for Page-Table OriginAlexander Gordeev2021-10-262-8/+8
| | | | | | | | | | | Instructions IPTE, IDTE and CRDTE accept Page-Table Origin as one of the arguments, but instead the pgtable virtual address is passed. Fix that and also update the crdte() prototype to conform to csp() and cspg() friends. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/zcrypt: rework of debug feature messagesHarald Freudenberger2021-10-2610-117/+116
| | | | | | | | | | | | | | This patch reworks all the debug feature invocations to be more uniform. All invocations now use the macro with the level already part of the macro name. All messages now start with %s filled with __func__ (well there are still some exceptions), and some message text has been shortened or reworked. There is no functional code touched with this patch. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* s390/ap: Fix hanging ioctl caused by orphaned repliesHarald Freudenberger2021-10-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | When a queue is switched to soft offline during heavy load and later switched to soft online again and now used, it may be that the caller is blocked forever in the ioctl call. The failure occurs because there is a pending reply after the queue(s) have been switched to offline. This orphaned reply is received when the queue is switched to online and is accidentally counted for the outstanding replies. So when there was a valid outstanding reply and this orphaned reply is received it counts as the outstanding one thus dropping the outstanding counter to 0. Voila, with this counter the receive function is not called any more and the real outstanding reply is never received (until another request comes in...) and the ioctl blocks. The fix is simple. However, instead of readjusting the counter when an orphaned reply is detected, I check the queue status for not empty and compare this to the outstanding counter. So if the queue is not empty then the counter must not drop to 0 but at least have a value of 1. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Cc: stable@vger.kernel.org Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* Merge branch 'fixes' into featuresVasily Gorbik2021-10-267-26/+54
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | pci and string functions changes on features depend on changes from the fixes branch. * fixes: s390: add Alexander Gordeev as reviewer s390: fix strrchr() implementation vfio-ccw: step down as maintainer KVM: s390: remove myself as reviewer s390/pci: fix zpci_zdev_put() on reserve bpf, s390: Fix potential memory leak about jit_data Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
| * s390: add Alexander Gordeev as reviewerHeiko Carstens2021-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | Alexander Gordeev will help reviewing s390 code. Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Acked-by: Vasily Gorbik <gor@linux.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
| * s390: fix strrchr() implementationRoberto Sassu2021-10-121-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two problems found in the strrchr() implementation for s390 architectures: evaluate empty strings (return the string address instead of NULL, if '\0' is passed as second argument); evaluate the first character of non-empty strings (the current implementation stops at the second). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Reported-by: Heiko Carstens <hca@linux.ibm.com> (incorrect behavior with empty strings) Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com> Link: https://lore.kernel.org/r/20211005120836.60630-1-roberto.sassu@huawei.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
| * vfio-ccw: step down as maintainerCornelia Huck2021-10-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | I currently don't have time to act as vfio-ccw maintainer anymore, but I trust that I leave it in capable hands. Signed-off-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Eric Farman <farman@linux.ibm.com> Acked-by: Matthew Rosato <mjrosato@linux.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Link: https://lore.kernel.org/r/20211006160120.217636-3-cohuck@redhat.com Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
| * KVM: s390: remove myself as reviewerCornelia Huck2021-10-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | I currently don't have time anymore to review KVM/s390 code. Signed-off-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Janosch Frank <frankja@linux.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Link: https://lore.kernel.org/r/20211006160120.217636-2-cohuck@redhat.com Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
| * s390/pci: fix zpci_zdev_put() on reserveNiklas Schnelle2021-10-044-15/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 2a671f77ee49 ("s390/pci: fix use after free of zpci_dev") the reference count of a zpci_dev is incremented between pcibios_add_device() and pcibios_release_device() which was supposed to prevent the zpci_dev from being freed while the common PCI code has access to it. It was missed however that the handling of zPCI availability events assumed that once zpci_zdev_put() was called no later availability event would still see the device. With the previously mentioned commit however this assumption no longer holds and we must make sure that we only drop the initial long-lived reference the zPCI subsystem holds exactly once. Do so by introducing a zpci_device_reserved() function that handles when a device is reserved. Here we make sure the zpci_dev will not be considered for further events by removing it from the zpci_list. This also means that the device actually stays in the ZPCI_FN_STATE_RESERVED state between the time we know it has been reserved and the final reference going away. We thus need to consider it a real state instead of just a conceptual state after the removal. The final cleanup of PCI resources, removal from zbus, and destruction of the IOMMU stays in zpci_release_device() to make sure holders of the reference do see valid data until the release. Fixes: 2a671f77ee49 ("s390/pci: fix use after free of zpci_dev") Cc: stable@vger.kernel.org Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
| * bpf, s390: Fix potential memory leak about jit_dataTiezhu Yang2021-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | Make sure to free jit_data through kfree() in the error path. Fixes: 1c8f9b91c456 ("bpf: s390: add JIT support for multi-function programs") Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390: update defconfigsHeiko Carstens2021-10-192-3/+13
| | | | | | | | | | Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | samples: add s390 support for ftrace direct call samplesHeiko Carstens2021-10-194-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | Add s390 support for ftrace direct call samples, which also enables ftrace direct call selftests within ftrace selftests. Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: https://lore.kernel.org/r/20211012133802.2460757-5-hca@linux.ibm.com Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | samples: add HAVE_SAMPLE_FTRACE_DIRECT config optionHeiko Carstens2021-10-192-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Add HAVE_SAMPLE_FTRACE_DIRECT config option which can be selected by architectures which have support for ftrace direct call samples. Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: https://lore.kernel.org/r/20211012133802.2460757-4-hca@linux.ibm.com Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390: make STACK_FRAME_OVERHEAD available via asm-offsets.hHeiko Carstens2021-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make STACK_FRAME_OVERHEAD available via asm-offsets.h. This allows to add s390 specific asm code to e.g. ftrace samples, without requiring to add random header files, which might cause all sort of problems on other architectures. asm-offsets.h can be assumed to be non-problematic. Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: https://lore.kernel.org/r/20211012133802.2460757-3-hca@linux.ibm.com Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/ftrace: add HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALL supportHeiko Carstens2021-10-193-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | This is the s390 variant of commit 562955fe6a55 ("ftrace/x86: Add register_ftrace_direct() for custom trampolines"). Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: https://lore.kernel.org/r/20211012133802.2460757-2-hca@linux.ibm.com Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/cmm: use string_upper() instead of open coded variantAndy Shevchenko2021-10-111-7/+4
| | | | | | | | | | | | | | | | | | | | Use string_upper() from string helper module instead of open coded variant. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20211001130201.72545-1-andriy.shevchenko@linux.intel.com [hca@linux.ibm.com: removed hunk which converts extmem.c] Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/ptrace: add function argument access APIHeiko Carstens2021-10-112-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add regs_get_kernel_argument() which returns Nth argument of a function call. This enables ftrace kprobe events to access kernel function arguments via $argN syntax. This is the s390 variant of commit a823c35ff2ed ("arm64: ptrace: Add function argument access API"). Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Steffen Maier <maier@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | selftests/ftrace: add s390 support for kprobe args testsHeiko Carstens2021-10-112-0/+7
| | | | | | | | | | | | | | | | | | This is the s390 variant of commit 9855c4626c67 ("selftests/ftrace: Add ppc support for kprobe args tests"). Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/ptrace: fix coding styleHeiko Carstens2021-10-111-2/+1
| | | | | | | | | | | | Reported-by: Steffen Maier <maier@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/ftrace: provide separate ftrace_caller/ftrace_regs_caller implementationsHeiko Carstens2021-10-112-13/+29
| | | | | | | | | | | | | | | | | | | | | | ftrace_regs_caller is an alias to ftrace_caller - making ftrace_caller quite heavyweight. Split the function and provide an ftrace_caller implementation which comes with fewer instructions. Especially getting rid of 'stosm' on each function entry should help here, e.g. to have less performance impact on live patched functions. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/ftrace: add ftrace_instruction_pointer_set() helper functionHeiko Carstens2021-10-112-3/+9
| | | | | | | | | | | | | | | | | | Add ftrace_instruction_pointer_set() helper function to match x86. See commit 2860cd8a2353 ("livepatch: Use the default ftrace_ops instead of REGS when ARGS is available"). Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/ftrace: add HAVE_DYNAMIC_FTRACE_WITH_ARGS supportHeiko Carstens2021-10-112-0/+10
| | | | | | | | | | | | | | | | | | | | | | Add HAVE_DYNAMIC_FTRACE_WITH_ARGS support similar to commit 02a474ca266a ("ftrace/x86: Allow for arguments to be passed in to ftrace_regs by default"). s390's ftrace implementation always provides all registers with pt_regs, therefore this is trivial. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/jump_label: add __init_or_module annotationHeiko Carstens2021-10-111-2/+3
| | | | | | | | | | | | | | Add missing __init_or_module to arch_jump_label_transform_static(). Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/jump_label: rename __jump_label_transform()Heiko Carstens2021-10-111-6/+6
| | | | | | | | | | | | | | Trivial patch just to get rid of the leading underscores. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/jump_label: make use of HAVE_JUMP_LABEL_BATCHHeiko Carstens2021-10-112-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specify HAVE_JUMP_LABEL_BATCH in header file. This allows to make use of the arch_jump_label_transform_queue()/arch_jump_label_transform_apply() mechanism. However unlike on x86, which currently is the only user of this mechanism, the to be patched instructions are still directly modified. The only difference to before is that serialization is only done after all instructions have been modified. This way the number of serialization/synchronization events is reduced. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/ftrace: add missing serialization for graph caller patchingHeiko Carstens2021-10-111-0/+2
| | | | | | | | | | | | | | | | CPUs must be serialized also when ftrace_graph_caller gets patched. This is missing since ftrace function graph support was added on s390. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/ftrace: use text_poke_sync_lock()Heiko Carstens2021-10-111-6/+6
| | | | | | | | | | Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
* | s390/jump_label: use text_poke_sync()Heiko Carstens2021-10-111-6/+2
| | | | | | | | | | Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>