Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1942798imm; Thu, 24 May 2018 03:20:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpF3Y0pGcQx0srznU7z08XSwRryINJp7QEsoKIYr0fQo8zgyJU+CUKIl5vB0SYb6m1wFDe9 X-Received: by 2002:a65:5607:: with SMTP id l7-v6mr5467214pgs.11.1527157208654; Thu, 24 May 2018 03:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157208; cv=none; d=google.com; s=arc-20160816; b=RnEx25OCkCpahfBrYWBwi+ZBMnAzjoSgZs6KtQ1vC5iCgJRWLqmMCbYExbFH4jNARm IDd1P8Qyn9wewSWzQXlV5y21lefrp5c/akLtZE5jTOlQ6piEQkBTFaozsCngX8WumVVn 9wYaY9P2Gm0UBEyxAKOgJlkmX0XFm5nn6NJJ1QeZh50vS57CG2jplGiwUSfScLcpTxpj Ni4icbMrxNCeT8Js/KgL2aP85Uw5rXgbJzU7lpXje76QxDaBh1kFDelXtFW9/RuiQGNF E0PhVuHsf3Ftr344G2dWuSKkPuwkGIVhe4+r1m2ZAl2cJ27uVaL8P2pHD1Ksxqszw1o+ 6zdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=VMNbnqksHNL/xfUw7c5zvxptdWyOTrNWNXf6GBHOfFk=; b=CEB1JPt+B0HUdhsCNHOY0miy9IoTs1NvoZylfiwjVPbjNW2WmmHxC4nWWkXU1cT95P j6Q7LZ/IeNgpLC95jOf6gnyKfVB/2/DaKtc+TIoria763udva7jTcqHL7rVecXosUW/O 4Y/km+R0h55GYcAItTj4RKpySWhEffS40kALzNX+y2beYACuIseaFFC6DE/Nk4wtJYhJ gmwQ7h6PEstuSAwMZkyGEqphkLjrrjgZBIFb7hNX6j5ehhI71gr7ToHxfpmY6d5K0J27 CdNjd+wtZx+Cq+IvyKSNmg6y9WRJZRNcgmcGOTm0r+3cNmWdpLz3Np6OpbF2ZkPQn28g KlmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MVIRqfU6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x23-v6si3090670pgx.576.2018.05.24.03.19.53; Thu, 24 May 2018 03:20:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MVIRqfU6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031293AbeEXKDe (ORCPT + 99 others); Thu, 24 May 2018 06:03:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:52496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030922AbeEXKD3 (ORCPT ); Thu, 24 May 2018 06:03:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 71FDD20890; Thu, 24 May 2018 10:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156209; bh=qhDkLYaCf9EQAemBGejFZHn3Kbzwx0SJ/fGSE65J9mE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MVIRqfU6iiZhypiVJBC+PNmdNK8cPgFYfPOJGNd4MZQccD4Qpyf5XPX8+fMohi8T5 2a+7f1//Hu3423e46qi32cJmRguc0SmjysQ+oVDRQFVtxvaUA2UgQfwJ8CMvyho9At OgvaP9z9oDr8E6sGdhtyx3x3Q6Dndbl3P+Dk5w7Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Martin Schwidefsky , Hendrik Brueckner Subject: [PATCH 4.16 060/161] s390/kernel: use expoline for indirect branches Date: Thu, 24 May 2018 11:38:05 +0200 Message-Id: <20180524093025.685282107@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Martin Schwidefsky [ Upstream commit c50c84c3ac4d5db683904bdb3257798b6ef980ae ] The assember code in arch/s390/kernel uses a few more indirect branches which need to be done with execute trampolines for CONFIG_EXPOLINE=y. Cc: stable@vger.kernel.org # 4.16 Fixes: f19fbd5ed6 ("s390: introduce execute-trampolines for branches") Reviewed-by: Hendrik Brueckner Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/base.S | 24 ++++++++++++++---------- arch/s390/kernel/reipl.S | 7 +++++-- arch/s390/kernel/swsusp.S | 10 ++++++---- 3 files changed, 25 insertions(+), 16 deletions(-) --- a/arch/s390/kernel/base.S +++ b/arch/s390/kernel/base.S @@ -9,18 +9,22 @@ #include #include +#include #include #include + GEN_BR_THUNK %r9 + GEN_BR_THUNK %r14 + ENTRY(s390_base_mcck_handler) basr %r13,0 0: lg %r15,__LC_PANIC_STACK # load panic stack aghi %r15,-STACK_FRAME_OVERHEAD larl %r1,s390_base_mcck_handler_fn - lg %r1,0(%r1) - ltgr %r1,%r1 + lg %r9,0(%r1) + ltgr %r9,%r9 jz 1f - basr %r14,%r1 + BASR_EX %r14,%r9 1: la %r1,4095 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1) lpswe __LC_MCK_OLD_PSW @@ -37,10 +41,10 @@ ENTRY(s390_base_ext_handler) basr %r13,0 0: aghi %r15,-STACK_FRAME_OVERHEAD larl %r1,s390_base_ext_handler_fn - lg %r1,0(%r1) - ltgr %r1,%r1 + lg %r9,0(%r1) + ltgr %r9,%r9 jz 1f - basr %r14,%r1 + BASR_EX %r14,%r9 1: lmg %r0,%r15,__LC_SAVE_AREA_ASYNC ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit lpswe __LC_EXT_OLD_PSW @@ -57,10 +61,10 @@ ENTRY(s390_base_pgm_handler) basr %r13,0 0: aghi %r15,-STACK_FRAME_OVERHEAD larl %r1,s390_base_pgm_handler_fn - lg %r1,0(%r1) - ltgr %r1,%r1 + lg %r9,0(%r1) + ltgr %r9,%r9 jz 1f - basr %r14,%r1 + BASR_EX %r14,%r9 lmg %r0,%r15,__LC_SAVE_AREA_SYNC lpswe __LC_PGM_OLD_PSW 1: lpswe disabled_wait_psw-0b(%r13) @@ -117,7 +121,7 @@ ENTRY(diag308_reset) larl %r4,.Lcontinue_psw # Restore PSW flags lpswe 0(%r4) .Lcontinue: - br %r14 + BR_EX %r14 .align 16 .Lrestart_psw: .long 0x00080000,0x80000000 + .Lrestart_part2 --- a/arch/s390/kernel/reipl.S +++ b/arch/s390/kernel/reipl.S @@ -7,8 +7,11 @@ #include #include +#include #include + GEN_BR_THUNK %r9 + # # Issue "store status" for the current CPU to its prefix page # and call passed function afterwards @@ -67,9 +70,9 @@ ENTRY(store_status) st %r4,0(%r1) st %r5,4(%r1) stg %r2,8(%r1) - lgr %r1,%r2 + lgr %r9,%r2 lgr %r2,%r3 - br %r1 + BR_EX %r9 .section .bss .align 8 --- a/arch/s390/kernel/swsusp.S +++ b/arch/s390/kernel/swsusp.S @@ -13,6 +13,7 @@ #include #include #include +#include #include /* @@ -24,6 +25,8 @@ * (see below) in the resume process. * This function runs with disabled interrupts. */ + GEN_BR_THUNK %r14 + .section .text ENTRY(swsusp_arch_suspend) stmg %r6,%r15,__SF_GPRS(%r15) @@ -103,7 +106,7 @@ ENTRY(swsusp_arch_suspend) spx 0x318(%r1) lmg %r6,%r15,STACK_FRAME_OVERHEAD + __SF_GPRS(%r15) lghi %r2,0 - br %r14 + BR_EX %r14 /* * Restore saved memory image to correct place and restore register context. @@ -197,11 +200,10 @@ pgm_check_entry: larl %r15,init_thread_union ahi %r15,1<<(PAGE_SHIFT+THREAD_SIZE_ORDER) larl %r2,.Lpanic_string - larl %r3,sclp_early_printk lghi %r1,0 sam31 sigp %r1,%r0,SIGP_SET_ARCHITECTURE - basr %r14,%r3 + brasl %r14,sclp_early_printk larl %r3,.Ldisabled_wait_31 lpsw 0(%r3) 4: @@ -267,7 +269,7 @@ restore_registers: /* Return 0 */ lmg %r6,%r15,STACK_FRAME_OVERHEAD + __SF_GPRS(%r15) lghi %r2,0 - br %r14 + BR_EX %r14 .section .data..nosave,"aw",@progbits .align 8