Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2033455imm; Thu, 24 May 2018 04:52:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrWGjsblX9Zw2tMGuKtwSOb27WGOZ+QvRV9QoFSXyHOwsDXoe7bH46yKxkaOJPRr4KNxe66 X-Received: by 2002:a63:8c4f:: with SMTP id q15-v6mr4753851pgn.236.1527162745132; Thu, 24 May 2018 04:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527162745; cv=none; d=google.com; s=arc-20160816; b=l1eGU5JxxGrkIJ1zdv1SkdCEiCb0K/a3Y1ykl5voLssqzdDsQ3h14pe+96uPPtIIhK PbIKWQ/JrBAmP3DNFlbMcb0m3ml/JmqCkdkYgvXytBer5Cg5vqZiGVxsMOeTaki9xBqF 60ld1CO+cama3EE+LK2nQYFL/HIHcT1Zz8qc4mPgYQILQXMCBLuDne2olh38t+cpK6mO T46C78wxjepKld4cBxkH6EepwMlUpAFnhDNjpiLNSPyLfEvavYLZN8c70OdYFRSSRUHM o75Coi1OUzPyQ+eHY8YO6sB6h5Z2qm4nIoRun9WnRh7kEEYiaD9xTgOOZBb/0XMDaYwF mm3Q== 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=Nq3tZDaueWqTuwuKS93yQ99nnRDPHQyPZMIEf9coJjA=; b=zDPN7MPbitYqTjua8jfjAg1GIy1ooOjn7oVYKokhqu0KtVxWv3yAb2FRvJxxykVi+M 7YdgNIsD4ZJ9/3pArVn7tBvMJ9ZPazWXacwPOstO5eaUK6W/SzHWVkm5OmZiIpgTKHdZ APQ0zOLbvuUi4kvu8n/Wrr1SU9M9ZunpABA/VRQUOz+sGyzUdq1qi41BErU5FcfcNQTh xBYfTbY/bjaxnyKOQZXy6VRNH3qyW/PJ7fiQmLpRV5ZQ3DVDPZg2hm+tDQGIGktKaifi d7+E/GcLeBZtuNqq/4660vOAohjRWH+ZJqg/teSN7E7/TKDYPN9KSFAu10HSFjWcMyaB UOuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BWeSOYJl; 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 a11-v6si16689068pgt.680.2018.05.24.04.52.10; Thu, 24 May 2018 04:52:25 -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=BWeSOYJl; 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 S966968AbeEXJqt (ORCPT + 99 others); Thu, 24 May 2018 05:46:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:58264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966941AbeEXJqm (ORCPT ); Thu, 24 May 2018 05:46:42 -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 62E00208C3; Thu, 24 May 2018 09:46:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155201; bh=7eaJvFEbteGfeWaeldbseupOKFMB7SCOPSpkIkEOj40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BWeSOYJl3h+mg6DwxrQEWMwD1ZwjeBK1mJtf7aNKunKP9Vw+xqAybp+jUVH12ajSp ZcaK4d7x93BYNzP2K5iWMclOiqvHivydwTwDPEAeV7h90ffk1eGv5+YWwDiRGg2Sw9 GKxcHuybxsXD6HYQkVKB9KGlEASFsxq4VyUp0kMk= 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.4 80/92] s390/kernel: use expoline for indirect branches Date: Thu, 24 May 2018 11:38:57 +0200 Message-Id: <20180524093206.932186509@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093159.286472249@linuxfoundation.org> References: <20180524093159.286472249@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.4-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 | 5 ++++- arch/s390/kernel/swsusp.S | 10 ++++++---- 3 files changed, 24 insertions(+), 15 deletions(-) --- a/arch/s390/kernel/base.S +++ b/arch/s390/kernel/base.S @@ -8,18 +8,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 @@ -36,10 +40,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 @@ -56,10 +60,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) @@ -116,7 +120,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 @@ -6,8 +6,11 @@ #include #include +#include #include + GEN_BR_THUNK %r14 + # # store_status # @@ -62,7 +65,7 @@ ENTRY(store_status) st %r3,__LC_PSW_SAVE_AREA-SAVE_AREA_BASE + 4(%r1) larl %r2,store_status stg %r2,__LC_PSW_SAVE_AREA-SAVE_AREA_BASE + 8(%r1) - br %r14 + BR_EX %r14 .section .bss .align 8 --- a/arch/s390/kernel/swsusp.S +++ b/arch/s390/kernel/swsusp.S @@ -12,6 +12,7 @@ #include #include #include +#include #include /* @@ -23,6 +24,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) @@ -102,7 +105,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. @@ -196,11 +199,10 @@ pgm_check_entry: larl %r15,init_thread_union ahi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) larl %r2,.Lpanic_string - larl %r3,_sclp_print_early lghi %r1,0 sam31 sigp %r1,%r0,SIGP_SET_ARCHITECTURE - basr %r14,%r3 + brasl %r14,_sclp_print_early larl %r3,.Ldisabled_wait_31 lpsw 0(%r3) 4: @@ -266,7 +268,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