Skip to content

Commit 98e6834

Browse files
Andrew Jonesbonzini
authored andcommitted
kvm: selftests: aarch64: compile with warnings on
aarch64 fixups needed to compile with warnings as errors. Reviewed-by: Thomas Huth <[email protected]> Signed-off-by: Andrew Jones <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 55eda00 commit 98e6834

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/testing/selftests/kvm/lib/aarch64/processor.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#define _GNU_SOURCE /* for program_invocation_name */
99

10+
#include <linux/compiler.h>
11+
1012
#include "kvm_util.h"
1113
#include "../kvm_util_internal.h"
1214
#include "processor.h"
@@ -67,15 +69,13 @@ static uint64_t ptrs_per_pgd(struct kvm_vm *vm)
6769
return 1 << (vm->va_bits - shift);
6870
}
6971

70-
static uint64_t ptrs_per_pte(struct kvm_vm *vm)
72+
static uint64_t __maybe_unused ptrs_per_pte(struct kvm_vm *vm)
7173
{
7274
return 1 << (vm->page_shift - 3);
7375
}
7476

7577
void virt_pgd_alloc(struct kvm_vm *vm, uint32_t pgd_memslot)
7678
{
77-
int rc;
78-
7979
if (!vm->pgd_created) {
8080
vm_paddr_t paddr = vm_phy_pages_alloc(vm,
8181
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)
181181
unmapped_gva:
182182
TEST_ASSERT(false, "No mapping for vm virtual address, "
183183
"gva: 0x%lx", gva);
184+
exit(1);
184185
}
185186

186187
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)
312313
get_reg(vm, vcpuid, ARM64_CORE_REG(regs.pstate), &pstate);
313314
get_reg(vm, vcpuid, ARM64_CORE_REG(regs.pc), &pc);
314315

315-
fprintf(stream, "%*spstate: 0x%.16llx pc: 0x%.16llx\n",
316+
fprintf(stream, "%*spstate: 0x%.16lx pc: 0x%.16lx\n",
316317
indent, "", pstate, pc);
317318
}

0 commit comments

Comments
 (0)