Skip to content

Commit aeb7942

Browse files
author
Marc Zyngier
committed
Merge branch kvm-arm64/misc-5.20 into kvmarm-master/next
* kvm-arm64/misc-5.20: : . : Misc fixes for 5.20: : : - Tidy up the hyp/nvhe Makefile : : - Fix functions pointlessly returning a void value : : - Fix vgic_init selftest to handle the GICv3-on-v3 case : : - Fix hypervisor symbolisation when CONFIG_RANDOMIZE_BASE=y : . KVM: arm64: Fix hypervisor address symbolization KVM: arm64: selftests: Add support for GICv2 on v3 KVM: arm64: Don't return from void function KVM: arm64: nvhe: Add intermediates to 'targets' instead of extra-y KVM: arm64: nvhe: Rename confusing obj-y Signed-off-by: Marc Zyngier <[email protected]>
2 parents dc94f89 + ed6313a commit aeb7942

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

arch/arm64/kvm/handle_exit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr,
347347
kvm_err("nVHE hyp BUG at: %s:%u!\n", file, line);
348348
else
349349
kvm_err("nVHE hyp BUG at: [<%016llx>] %pB!\n", panic_addr,
350-
(void *)panic_addr);
350+
(void *)(panic_addr + kaslr_offset()));
351351
} else {
352352
kvm_err("nVHE hyp panic at: [<%016llx>] %pB!\n", panic_addr,
353-
(void *)panic_addr);
353+
(void *)(panic_addr + kaslr_offset()));
354354
}
355355

356356
/*

arch/arm64/kvm/hyp/nvhe/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ HOST_EXTRACFLAGS += -I$(objtree)/include
1212
lib-objs := clear_page.o copy_page.o memcpy.o memset.o
1313
lib-objs := $(addprefix ../../../lib/, $(lib-objs))
1414

15-
obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o hyp-init.o host.o \
15+
hyp-obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o hyp-init.o host.o \
1616
hyp-main.o hyp-smp.o psci-relay.o early_alloc.o page_alloc.o \
1717
cache.o setup.o mm.o mem_protect.o sys_regs.o pkvm.o
18-
obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \
18+
hyp-obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \
1919
../fpsimd.o ../hyp-entry.o ../exception.o ../pgtable.o
20-
obj-$(CONFIG_DEBUG_LIST) += list_debug.o
21-
obj-y += $(lib-objs)
20+
hyp-obj-$(CONFIG_DEBUG_LIST) += list_debug.o
21+
hyp-obj-y += $(lib-objs)
2222

2323
##
2424
## Build rules for compiling nVHE hyp code
2525
## Output of this folder is `kvm_nvhe.o`, a partially linked object
2626
## file containing all nVHE hyp code and data.
2727
##
2828

29-
hyp-obj := $(patsubst %.o,%.nvhe.o,$(obj-y))
29+
hyp-obj := $(patsubst %.o,%.nvhe.o,$(hyp-obj-y))
3030
obj-y := kvm_nvhe.o
31-
extra-y := $(hyp-obj) kvm_nvhe.tmp.o kvm_nvhe.rel.o hyp.lds hyp-reloc.S hyp-reloc.o
31+
targets += $(hyp-obj) kvm_nvhe.tmp.o kvm_nvhe.rel.o hyp.lds hyp-reloc.S hyp-reloc.o
3232

3333
# 1) Compile all source files to `.nvhe.o` object files. The file extension
3434
# avoids file name clashes for files shared with VHE.

arch/arm64/kvm/hyp/nvhe/switch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,5 +386,5 @@ asmlinkage void __noreturn hyp_panic_bad_stack(void)
386386

387387
asmlinkage void kvm_unexpected_el2_exception(void)
388388
{
389-
return __kvm_unexpected_el2_exception();
389+
__kvm_unexpected_el2_exception();
390390
}

arch/arm64/kvm/hyp/vhe/switch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,5 +249,5 @@ void __noreturn hyp_panic(void)
249249

250250
asmlinkage void kvm_unexpected_el2_exception(void)
251251
{
252-
return __kvm_unexpected_el2_exception();
252+
__kvm_unexpected_el2_exception();
253253
}

tools/testing/selftests/kvm/aarch64/vgic_init.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ int test_kvm_device(uint32_t gic_dev_type)
670670

671671
if (!_kvm_create_device(v.vm, other, true, &fd)) {
672672
ret = _kvm_create_device(v.vm, other, false, &fd);
673-
TEST_ASSERT(ret && errno == EINVAL,
673+
TEST_ASSERT(ret && (errno == EINVAL || errno == EEXIST),
674674
"create GIC device while other version exists");
675675
}
676676

@@ -698,6 +698,7 @@ int main(int ac, char **av)
698698
{
699699
int ret;
700700
int pa_bits;
701+
int cnt_impl = 0;
701702

702703
pa_bits = vm_guest_mode_params[VM_MODE_DEFAULT].pa_bits;
703704
max_phys_size = 1ULL << pa_bits;
@@ -706,17 +707,19 @@ int main(int ac, char **av)
706707
if (!ret) {
707708
pr_info("Running GIC_v3 tests.\n");
708709
run_tests(KVM_DEV_TYPE_ARM_VGIC_V3);
709-
return 0;
710+
cnt_impl++;
710711
}
711712

712713
ret = test_kvm_device(KVM_DEV_TYPE_ARM_VGIC_V2);
713714
if (!ret) {
714715
pr_info("Running GIC_v2 tests.\n");
715716
run_tests(KVM_DEV_TYPE_ARM_VGIC_V2);
716-
return 0;
717+
cnt_impl++;
717718
}
718719

719-
print_skip("No GICv2 nor GICv3 support");
720-
exit(KSFT_SKIP);
720+
if (!cnt_impl) {
721+
print_skip("No GICv2 nor GICv3 support");
722+
exit(KSFT_SKIP);
723+
}
721724
return 0;
722725
}

0 commit comments

Comments
 (0)