From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42128 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753732AbeE1HL3 (ORCPT ); Mon, 28 May 2018 03:11:29 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4S79s1P072131 for ; Mon, 28 May 2018 03:11:29 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j87t51x97-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 28 May 2018 03:11:28 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 May 2018 08:11:26 +0100 Date: Mon, 28 May 2018 09:11:19 +0200 From: Martin Schwidefsky To: Greg KH Cc: stable@vger.kernel.org Subject: Re: [PATCH 4/9] s390/ftrace: use expoline for indirect branches In-Reply-To: <20180525140913.GA2559@kroah.com> References: <1527092496-24207-1-git-send-email-schwidefsky@de.ibm.com> <1527092496-24207-5-git-send-email-schwidefsky@de.ibm.com> <20180525135420.GA719@kroah.com> <20180525140913.GA2559@kroah.com> MIME-Version: 1.0 Message-Id: <20180528091119.2267de99@mschwideX1> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: On Fri, 25 May 2018 16:09:13 +0200 Greg KH wrote: > On Fri, May 25, 2018 at 03:54:20PM +0200, Greg KH wrote: > > On Wed, May 23, 2018 at 06:21:31PM +0200, Martin Schwidefsky wrote: > > > [ Upstream commit 23a4d7fd34856da8218c4cfc23dba7a6ec0a423a ] > > > > > > The return from the ftrace_stub, _mcount, ftrace_caller and > > > return_to_handler functions is done with "br %r14" and "br %r1". > > > These are indirect branches as well and need to use execute > > > trampolines for CONFIG_EXPOLINE=y. > > > > > > The ftrace_caller function is a special case as it returns to the > > > start of a function and may only use %r0 and %r1. For a pre z10 > > > machine the standard execute trampoline uses a LARL + EX to do > > > this, but this requires *two* registers in the range %r1..%r15. > > > To get around this the 'br %r1' located in the lowcore is used, > > > then the EX instruction does not need an address register. > > > But the lowcore trick may only be used for pre z14 machines, > > > with noexec=on the mapping for the first page may not contain > > > instructions. The solution for that is an ALTERNATIVE in the > > > expoline THUNK generated by 'GEN_BR_THUNK %r1' to switch to > > > EXRL, this relies on the fact that a machine that supports > > > noexec=on has EXRL as well. > > > > > > Cc: stable@vger.kernel.org # 4.16 > > > Fixes: f19fbd5ed6 ("s390: introduce execute-trampolines for branches") > > > Signed-off-by: Martin Schwidefsky > > > --- > > > arch/s390/include/asm/nospec-insn.h | 11 +++++++++++ > > > arch/s390/kernel/asm-offsets.c | 1 + > > > arch/s390/kernel/mcount.S | 14 +++++++++----- > > > 3 files changed, 21 insertions(+), 5 deletions(-) > > > > This patch breaks the build for 'allmodconfig' for s390, but defconfig > > works fine :( > > > > The error is: > > LD init/built-in.o > > arch/s390/built-in.o: In function `__s390x_indirect_jump_r1use_r1': > > (.text.__s390x_indirect_jump_r1use_r1[__s390x_indirect_jump_r1use_r1]+0x2): undefined reference to `_LC_BR_R1' > > make: *** [Makefile:956: vmlinux] Error 1 > > > > So I'm going to drop this patch, and the rest in the series, from the > > 4.4.y tree. Can you please fix this up and resend the needed patches > > after I do the next 4.4.y kernel release? > > Hm, it looks like everything at least boots with just this one patch > removed, so I've done that. I have no idea if it boots, I'll leave that > to people who have access to those types of boxes :) Uh-oh, yes. The reason is that the backport for 4.4 misses two lines from nospec-insn.h: +_LC_BR_R1 = __LC_BR_R1 + The compile only fails for CONFIG_MARCH_Z900=y. With a newer processor type it compiles just fine, I wonder why. Anyway I'll send a new patch. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.