Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1994249imm; Thu, 24 May 2018 04:11:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp3sgCnkTh8OkA/P4aYpa/1k/ML+e1tUPYZDXduTYTepVikfupnj5YwtzApTwISLpSB/YaT X-Received: by 2002:a17:902:a717:: with SMTP id w23-v6mr6882383plq.130.1527160315016; Thu, 24 May 2018 04:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160314; cv=none; d=google.com; s=arc-20160816; b=CCQZZgb6MtdOV2lIx7uVe0E8x8reNM9/wTldy4qJyht7Cajz+GYyjrwRVMxEm0SUW5 kE/W/PmknFOPyNq7ikDWphyqhKDk2GZyWTHlnawgA2lm+JQS5ElHRPUi/Eo6ODuNN+qx 90vNmt5TFrjDO3sUpc+ipXWCkc1+H8xN81JZSGsj4wxwSHuGZ5M9rVPB9I0E5c4yPV3y XwRAUr4W3+iKHcSBV4EAhRnBpNZ2JThnyJoSdsON4otRavNVrx1AsVGE7SPljXDZQn2u 0xfJGuc1rTFxNiRqo2DrBBvLURvX0h7CRaRrT7eE8erPj4ZMi6zyOHO1IQUnsGxTC1Sm LvjQ== 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=lOU9wVjLWX4wn7ZCE60AG3qxz1kgPT4dG8rRSXL40RM=; b=P3T2JiOOYpYzcQvC20Q8347wm0vIhtPcgdVHxHOVAxTkkXnxYbZ5cGAc7SpfkV3w9W +hZ+KREWP/oH/GgeogUwa1e+B2jUbwmpeWN4lFpHFjbh+T4b5WYz/M/CKM58OaRHEYIL hIlQveeNEo/D1PqpKiZZoCQbX75BFozxjoO9KGDIEppLt40pQOM+Hvx9RWbnxuqEz/pL I2I9swhgXYHnfv0ODW50pbH1mhONBp6FhpDbw3I2IqJAo+X2fETiInguKaVUBA7LieJW kBDRXzcmN8L2gpaWGF6YHoDXFXHGFSlY+THO1PGXAQmEkTG8ndjcgnxk5oOM5/XaMu6N ZcVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VzlGI9AM; 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 d8-v6si15980362pgu.671.2018.05.24.04.11.40; Thu, 24 May 2018 04:11:54 -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=VzlGI9AM; 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 S968159AbeEXJyX (ORCPT + 99 others); Thu, 24 May 2018 05:54:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:34314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967477AbeEXJyS (ORCPT ); Thu, 24 May 2018 05:54:18 -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 5760E20891; Thu, 24 May 2018 09:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155657; bh=N2nDbm7rMa4I/xjstU3hnbzcO/vCsc7B5xEMIdcM0+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VzlGI9AMzqcd26jUl85xegO6eR6JcUzu51ToUaa5xvnC3rjPAKuZSV72mRof7dKFC 847KkH2e9p8nN3oLB8H5HH0kPjRsbW8OxDVq8+JLzrg3LiGcFvW4wONMY7nitdLiVc 2mRECuxTFVSenEh2DVH9dzb4TAtPAButyYzRAlHc= 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.14 042/165] s390/kernel: use expoline for indirect branches Date: Thu, 24 May 2018 11:37:28 +0200 Message-Id: <20180524093623.711906740@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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.14-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