提交 c9bfb460 编写于 作者: N Nico Boehr 提交者: Heiko Carstens

s390/perf: obtain sie_block from the right address

Since commit 1179f170 ("s390: fix fpu restore in entry.S"), the
sie_block pointer is located at empty1[1], but in sie_block() it was
taken from empty1[0].

This leads to a random pointer being dereferenced, possibly causing
system crash.

This problem can be observed when running a simple guest with an endless
loop and recording the cpu-clock event:

  sudo perf kvm --guestvmlinux=<guestkernel> --guest top -e cpu-clock

With this fix, the correct guest address is shown.

Fixes: 1179f170 ("s390: fix fpu restore in entry.S")
Cc: stable@vger.kernel.org
Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
Acked-by: NClaudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: NHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: NNico Boehr <nrb@linux.ibm.com>
Signed-off-by: NHeiko Carstens <hca@linux.ibm.com>
上级 3384f135
......@@ -30,7 +30,7 @@ static struct kvm_s390_sie_block *sie_block(struct pt_regs *regs)
if (!stack)
return NULL;
return (struct kvm_s390_sie_block *) stack->empty1[0];
return (struct kvm_s390_sie_block *)stack->empty1[1];
}
static bool is_in_guest(struct pt_regs *regs)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册