Skip to content

Commit ebccb53

Browse files
committed
Merge tag 'kvmarm-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 fixes for 6.1, take #2 - Fix a bug preventing restoring an ITS containing mappings for very large and very sparse device topology - Work around a relocation handling error when compiling the nVHE object with profile optimisation
2 parents 5834816 + c000a26 commit ebccb53

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

arch/arm64/kvm/hyp/nvhe/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ quiet_cmd_hypcopy = HYPCOPY $@
9292
# Remove ftrace, Shadow Call Stack, and CFI CFLAGS.
9393
# This is equivalent to the 'notrace', '__noscs', and '__nocfi' annotations.
9494
KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_CFI), $(KBUILD_CFLAGS))
95+
# Starting from 13.0.0 llvm emits SHT_REL section '.llvm.call-graph-profile'
96+
# when profile optimization is applied. gen-hyprel does not support SHT_REL and
97+
# causes a build failure. Remove profile optimization flags.
98+
KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%, $(KBUILD_CFLAGS))
9599

96100
# KVM nVHE code is run at a different exception code with a different map, so
97101
# compiler instrumentation that inserts callbacks or checks into the code may

arch/arm64/kvm/vgic/vgic-its.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,7 @@ static int scan_its_table(struct vgic_its *its, gpa_t base, int size, u32 esz,
21492149

21502150
memset(entry, 0, esz);
21512151

2152-
while (len > 0) {
2152+
while (true) {
21532153
int next_offset;
21542154
size_t byte_offset;
21552155

@@ -2162,6 +2162,9 @@ static int scan_its_table(struct vgic_its *its, gpa_t base, int size, u32 esz,
21622162
return next_offset;
21632163

21642164
byte_offset = next_offset * esz;
2165+
if (byte_offset >= len)
2166+
break;
2167+
21652168
id += next_offset;
21662169
gpa += byte_offset;
21672170
len -= byte_offset;

0 commit comments

Comments
 (0)