summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/lib/s390x/processor.c
Commit message (Collapse)AuthorAgeFilesLines
* KVM: selftests: Add wrapper to allocate page table pageSean Christopherson2021-06-241-2/+0
| | | | | | | | | | | | Add a helper to allocate a page for use in constructing the guest's page tables. All architectures have identical address and memslot requirements (which appear to be arbitrary anyways). No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210622200529.3650424-15-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* KVM: selftests: Unconditionally use memslot '0' for page table allocationsSean Christopherson2021-06-241-5/+4
| | | | | | | | | | | Drop the memslot param from virt_pg_map() and virt_map() and shove the hardcoded '0' down to the vm_phy_page_alloc() calls. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210622200529.3650424-13-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* KVM: selftests: Unconditionally use memslot 0 for vaddr allocationsSean Christopherson2021-06-241-3/+3
| | | | | | | | | | | | Drop the memslot param(s) from vm_vaddr_alloc() now that all callers directly specific '0' as the memslot. Drop the memslot param from virt_pgd_alloc() as well since vm_vaddr_alloc() is its only user. I.e. shove the hardcoded '0' down to the vm_phy_pages_alloc() calls. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* KVM: selftests: Make vm_create_default commonAndrew Jones2020-11-151-22/+0
| | | | | | | | | | | The code is almost 100% the same anyway. Just move it to common and add a few arch-specific macros. Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Ben Gardon <bgardon@google.com> Signed-off-by: Andrew Jones <drjones@redhat.com> Message-Id: <20201111122636.73346-5-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* selftests: kvm: Add exception handling to selftestsAaron Lewis2020-11-081-0/+4
| | | | | | | | | | | Add the infrastructure needed to enable exception handling in selftests. This allows any of the exception and interrupt vectors to be overridden in the guest. Signed-off-by: Aaron Lewis <aaronlewis@google.com> Reviewed-by: Alexander Graf <graf@amazon.com> Message-Id: <20201012194716.3950330-4-aaronlewis@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* KVM: selftests: Use kernel's list instead of homebrewed replacementSean Christopherson2020-04-151-1/+4
| | | | | | | | | | Replace the KVM selftests' homebrewed linked lists for vCPUs and memory regions with the kernel's 'struct list_head'. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Message-Id: <20200410231707.7128-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* KVM: selftests: Share common API documentationAndrew Jones2020-03-161-74/+0
| | | | | | | | | Move function documentation comment blocks to the header files in order to avoid duplicating them for each architecture. While at it clean up and fix up the comment blocks. Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* KVM: selftests: Add support for vcpu_args_set to aarch64 and s390xBen Gardon2020-03-161-0/+36
| | | | | | | | | | | | | | Currently vcpu_args_set is only implemented for x86. This makes writing tests with multiple vCPUs difficult as each guest vCPU must either a.) do the same thing or b.) derive some kind of unique token from it's registers or the architecture. To simplify the process of writing tests with multiple vCPUs for s390 and aarch64, add set args functions for those architectures. Signed-off-by: Ben Gardon <bgardon@google.com> [Fixed array index (num => i) and made some style changes.] Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Merge tag 'kvm-s390-next-5.3-1' of ↵Paolo Bonzini2019-07-151-10/+2
| | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: add kselftests This is the initial implementation for KVM selftests on s390.
* KVM: selftests: Add processor code for s390xThomas Huth2019-06-041-0/+286
Code that takes care of basic CPU setup, page table walking, etc. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20190523164309.13345-7-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>