diff options
| author | Andrew Jones <drjones@redhat.com> | 2019-05-23 06:16:34 -0400 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-05-24 15:27:16 -0400 |
| commit | 98e683443ba298685205c0c5157df49e42c1c0b1 (patch) | |
| tree | fc0aca982b3fcf9b5a24fb870fe9ba27e533c464 | |
| parent | 55eda003f02f075bab0223a188e548dbf3ac8dfe (diff) | |
kvm: selftests: aarch64: compile with warnings on
aarch64 fixups needed to compile with warnings as errors.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | tools/testing/selftests/kvm/lib/aarch64/processor.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/testing/selftests/kvm/lib/aarch64/processor.c b/tools/testing/selftests/kvm/lib/aarch64/processor.c index fa6cd340137c..19e667911496 100644 --- a/tools/testing/selftests/kvm/lib/aarch64/processor.c +++ b/tools/testing/selftests/kvm/lib/aarch64/processor.c | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | #define _GNU_SOURCE /* for program_invocation_name */ | 8 | #define _GNU_SOURCE /* for program_invocation_name */ |
| 9 | 9 | ||
| 10 | #include <linux/compiler.h> | ||
| 11 | |||
| 10 | #include "kvm_util.h" | 12 | #include "kvm_util.h" |
| 11 | #include "../kvm_util_internal.h" | 13 | #include "../kvm_util_internal.h" |
| 12 | #include "processor.h" | 14 | #include "processor.h" |
| @@ -67,15 +69,13 @@ static uint64_t ptrs_per_pgd(struct kvm_vm *vm) | |||
| 67 | return 1 << (vm->va_bits - shift); | 69 | return 1 << (vm->va_bits - shift); |
| 68 | } | 70 | } |
| 69 | 71 | ||
| 70 | static uint64_t ptrs_per_pte(struct kvm_vm *vm) | 72 | static uint64_t __maybe_unused ptrs_per_pte(struct kvm_vm *vm) |
| 71 | { | 73 | { |
| 72 | return 1 << (vm->page_shift - 3); | 74 | return 1 << (vm->page_shift - 3); |
| 73 | } | 75 | } |
| 74 | 76 | ||
| 75 | void virt_pgd_alloc(struct kvm_vm *vm, uint32_t pgd_memslot) | 77 | void virt_pgd_alloc(struct kvm_vm *vm, uint32_t pgd_memslot) |
| 76 | { | 78 | { |
| 77 | int rc; | ||
| 78 | |||
| 79 | if (!vm->pgd_created) { | 79 | if (!vm->pgd_created) { |
| 80 | vm_paddr_t paddr = vm_phy_pages_alloc(vm, | 80 | vm_paddr_t paddr = vm_phy_pages_alloc(vm, |
| 81 | page_align(vm, ptrs_per_pgd(vm) * 8) / vm->page_size, | 81 | page_align(vm, ptrs_per_pgd(vm) * 8) / vm->page_size, |
| @@ -181,6 +181,7 @@ vm_paddr_t addr_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva) | |||
| 181 | unmapped_gva: | 181 | unmapped_gva: |
| 182 | TEST_ASSERT(false, "No mapping for vm virtual address, " | 182 | TEST_ASSERT(false, "No mapping for vm virtual address, " |
| 183 | "gva: 0x%lx", gva); | 183 | "gva: 0x%lx", gva); |
| 184 | exit(1); | ||
| 184 | } | 185 | } |
| 185 | 186 | ||
| 186 | static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, uint64_t page, int level) | 187 | static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, uint64_t page, int level) |
| @@ -312,6 +313,6 @@ void vcpu_dump(FILE *stream, struct kvm_vm *vm, uint32_t vcpuid, uint8_t indent) | |||
| 312 | get_reg(vm, vcpuid, ARM64_CORE_REG(regs.pstate), &pstate); | 313 | get_reg(vm, vcpuid, ARM64_CORE_REG(regs.pstate), &pstate); |
| 313 | get_reg(vm, vcpuid, ARM64_CORE_REG(regs.pc), &pc); | 314 | get_reg(vm, vcpuid, ARM64_CORE_REG(regs.pc), &pc); |
| 314 | 315 | ||
| 315 | fprintf(stream, "%*spstate: 0x%.16llx pc: 0x%.16llx\n", | 316 | fprintf(stream, "%*spstate: 0x%.16lx pc: 0x%.16lx\n", |
| 316 | indent, "", pstate, pc); | 317 | indent, "", pstate, pc); |
| 317 | } | 318 | } |
