Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2247145ybd; Mon, 24 Jun 2019 03:15:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx88/fc+M0+wiLgYh/juihAvQGeauQ68Mu/PkZt+nrIOjys/F7gc/uTRCMrQnxq7oZ7z5uE X-Received: by 2002:a17:902:6a88:: with SMTP id n8mr55841121plk.70.1561371302974; Mon, 24 Jun 2019 03:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371302; cv=none; d=google.com; s=arc-20160816; b=PEfZOjZbMIoQcHKX1ZP0qMFtSW+OjylpbEe/sTbIkY6aDUEC/NXzjyRn5JmtDIvKac p0B5vmmfO7Y9++vU3+35gim0/5Xu8yWb3CoAuW1izLpmaeWWRsuyx/0WmM+DivxI1Ptx q+7IfNznIcouiaSvLt+vTsMErpMsNivAm3oixtAYSAsmdsrgz7zcwaz7efZFDI+f5dt1 ctbvEp+t7JphI0MdqqgCYTavcHoJM4yuHXXeoJG4GN/mZukd+J+sT/mTgH0e++kTbY0t 2IUxfPT0zp6T83MNPG0UZBEC8eY2vhHyN2ZQd7HredLTKAE/wwMcZ0UifZv1ximNZv6O nSgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LYgDvJ97QtEOHQ+ox9bMAWV1w+BFLbniCQIEadsCDVM=; b=LNot6mYAwk08JdsLR8smKzvjTeAsaXm8v21E8H6sR5jiAetKABotCfvVH+zKeXmfdn fiiRF+S63MfVZAlkNrd9Bjrmv9g/EdN2sKL7pBSiWjirBaw5fHxyBHjo1B4gE92k5qWz 96Sac1LhDeRSL8lvAYOS7Oi7eSjuHk/sZZh/PeDihe2hrXVX6AT7ZisfXu838Gbr9lxA unOS+wQJHM/2uBCdka2GolHDV2oYfCJfsdzCX598xVVqnkiYnPDouoSdvHW+1glIRiSN WfRP57m0jYQ25vVMkdTl9FR1P9gixGVIG8xDLKbPoLmMjF6f42ZsaP1JM1tLjGAi3tD/ +gfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hjBMFrSo; 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 b36si10224628pla.289.2019.06.24.03.14.47; Mon, 24 Jun 2019 03:15:02 -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=hjBMFrSo; 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 S1730052AbfFXKNy (ORCPT + 99 others); Mon, 24 Jun 2019 06:13:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:35432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728715AbfFXKEC (ORCPT ); Mon, 24 Jun 2019 06:04:02 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (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 6B92E213F2; Mon, 24 Jun 2019 10:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561370641; bh=0Tuv9WLmua8GzdXQkqqEv0t3CuaXw/uKeuI6XH6NamM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hjBMFrSo0ZCcNVAJQJfAxh2qvoNznEp+yKsvJFZy+pywSxOwkCvqycUFTdzZaMRFk hPoBSVOhD5ItfPUWSEAjfG0dlJc4kcMOQlPgR1O2ZORxRj18PJ2T7LE7ACwzxQJWbn Qqrsedaqjr9HwL1KM5sNFwk8SxZ5eCtXnxBuyeZY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Laura Abbott , Ilya Leoshkevich , Heiko Carstens , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.19 10/90] s390/jump_label: Use "jdd" constraint on gcc9 Date: Mon, 24 Jun 2019 17:56:00 +0800 Message-Id: <20190624092314.669022460@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092313.788773607@linuxfoundation.org> References: <20190624092313.788773607@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 146448524bddbf6dfc62de31957e428de001cbda ] [heiko.carstens@de.ibm.com]: ----- Laura Abbott reported that the kernel doesn't build anymore with gcc 9, due to the "X" constraint. Ilya provided the gcc 9 patch "S/390: Introduce jdd constraint" which introduces the new "jdd" constraint which fixes this. ----- The support for section anchors on S/390 introduced in gcc9 has changed the behavior of "X" constraint, which can now produce register references. Since existing constraints, in particular, "i", do not fit the intended use case on S/390, the new machine-specific "jdd" constraint was introduced. This patch makes jump labels use "jdd" constraint when building with gcc9. Reported-by: Laura Abbott Signed-off-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- arch/s390/include/asm/jump_label.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jump_label.h index 40f651292aa7..9c7dc970e966 100644 --- a/arch/s390/include/asm/jump_label.h +++ b/arch/s390/include/asm/jump_label.h @@ -10,6 +10,12 @@ #define JUMP_LABEL_NOP_SIZE 6 #define JUMP_LABEL_NOP_OFFSET 2 +#if __GNUC__ < 9 +#define JUMP_LABEL_STATIC_KEY_CONSTRAINT "X" +#else +#define JUMP_LABEL_STATIC_KEY_CONSTRAINT "jdd" +#endif + /* * We use a brcl 0,2 instruction for jump labels at compile time so it * can be easily distinguished from a hotpatch generated instruction. @@ -19,9 +25,9 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran asm_volatile_goto("0: brcl 0,"__stringify(JUMP_LABEL_NOP_OFFSET)"\n" ".pushsection __jump_table, \"aw\"\n" ".balign 8\n" - ".quad 0b, %l[label], %0\n" + ".quad 0b, %l[label], %0+%1\n" ".popsection\n" - : : "X" (&((char *)key)[branch]) : : label); + : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label); return false; label: @@ -33,9 +39,9 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool asm_volatile_goto("0: brcl 15, %l[label]\n" ".pushsection __jump_table, \"aw\"\n" ".balign 8\n" - ".quad 0b, %l[label], %0\n" + ".quad 0b, %l[label], %0+%1\n" ".popsection\n" - : : "X" (&((char *)key)[branch]) : : label); + : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label); return false; label: -- 2.20.1