Skip to content

Commit

Permalink
KVM: selftests: riscv: Fix alignment of the guest_hang() function
Browse files Browse the repository at this point in the history
The guest_hang() function is used as the default exception handler
for various KVM selftests applications by setting it's address in
the vstvec CSR. The vstvec CSR requires exception handler base address
to be at least 4-byte aligned so this patch fixes alignment of the
guest_hang() function.

Fixes: 3e06cdf ("KVM: selftests: Add initial support for RISC-V
64-bit")
Signed-off-by: Anup Patel <[email protected]>
Tested-by: Mayuresh Chitale <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
  • Loading branch information
avpatel committed Apr 9, 2022
1 parent fac3725 commit ebdef0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/lib/riscv/processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void vcpu_dump(FILE *stream, struct kvm_vm *vm, uint32_t vcpuid, uint8_t indent)
core.regs.t3, core.regs.t4, core.regs.t5, core.regs.t6);
}

static void guest_hang(void)
static void __aligned(16) guest_hang(void)
{
while (1)
;
Expand Down

0 comments on commit ebdef0d

Please sign in to comment.