Skip to content

Commit

Permalink
kvm: selftests: aarch64: compile with warnings on
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Andrew Jones authored and bonzini committed May 24, 2019
1 parent 55eda00 commit 98e6834
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/testing/selftests/kvm/lib/aarch64/processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#define _GNU_SOURCE /* for program_invocation_name */

#include <linux/compiler.h>

#include "kvm_util.h"
#include "../kvm_util_internal.h"
#include "processor.h"
Expand Down Expand Up @@ -67,15 +69,13 @@ static uint64_t ptrs_per_pgd(struct kvm_vm *vm)
return 1 << (vm->va_bits - shift);
}

static uint64_t ptrs_per_pte(struct kvm_vm *vm)
static uint64_t __maybe_unused ptrs_per_pte(struct kvm_vm *vm)
{
return 1 << (vm->page_shift - 3);
}

void virt_pgd_alloc(struct kvm_vm *vm, uint32_t pgd_memslot)
{
int rc;

if (!vm->pgd_created) {
vm_paddr_t paddr = vm_phy_pages_alloc(vm,
page_align(vm, ptrs_per_pgd(vm) * 8) / vm->page_size,
Expand Down Expand Up @@ -181,6 +181,7 @@ vm_paddr_t addr_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva)
unmapped_gva:
TEST_ASSERT(false, "No mapping for vm virtual address, "
"gva: 0x%lx", gva);
exit(1);
}

static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, uint64_t page, int level)
Expand Down Expand Up @@ -312,6 +313,6 @@ void vcpu_dump(FILE *stream, struct kvm_vm *vm, uint32_t vcpuid, uint8_t indent)
get_reg(vm, vcpuid, ARM64_CORE_REG(regs.pstate), &pstate);
get_reg(vm, vcpuid, ARM64_CORE_REG(regs.pc), &pc);

fprintf(stream, "%*spstate: 0x%.16llx pc: 0x%.16llx\n",
fprintf(stream, "%*spstate: 0x%.16lx pc: 0x%.16lx\n",
indent, "", pstate, pc);
}

0 comments on commit 98e6834

Please sign in to comment.