From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22CBD2CA6 for ; Mon, 6 Dec 2021 21:15:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3CF1C341C6; Mon, 6 Dec 2021 21:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638825349; bh=CtcKASc9UMnknSvliK8E7YX1Ljqy0C2xHCE6Xh0Ics8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SL2CzDCOx1kS7dquvVh1H2GJx7AIIWg9YHwPMpmVimpB+X9Y4KtQ6T0z/btBs4Z9g BtaYqFZDNyh7otyphtv+C9DD9uytmvZUJ90Sp/VsTIV1mS+IowBcfSVP0YIf2cMex4 x7mwDpsP9WcGkz6FhDSfQZCudVQpKEpr+HFiFS5st612qF5lEBJujjYy+iYId9xMXg 6TYlOCT5tueEfH64D6vlQ1c5sXLT0tQDBYSJbJmCEaIe5+wl+xWoWDYnKEPabNAW73 FsJGWiOd2rl5ZNVtGVXMccRvSP/foaXJbRiQApdbY1OiYr6SPoRIi/JU+iWRIYkGo0 6izF6nJGS4vgw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ilie Halip , Nick Desaulniers , Ulrich Weigand , Christian Borntraeger , Heiko Carstens , Sasha Levin , gor@linux.ibm.com, borntraeger@linux.ibm.com, nathan@kernel.org, svens@linux.ibm.com, iii@linux.ibm.com, meted@linux.ibm.com, linux-s390@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH AUTOSEL 5.10 03/15] s390/test_unwind: use raw opcode instead of invalid instruction Date: Mon, 6 Dec 2021 16:15:03 -0500 Message-Id: <20211206211520.1660478-3-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211206211520.1660478-1-sashal@kernel.org> References: <20211206211520.1660478-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Ilie Halip [ Upstream commit 53ae7230918154d1f4281d7aa3aae9650436eadf ] Building with clang & LLVM_IAS=1 leads to an error: arch/s390/lib/test_unwind.c:179:4: error: invalid register pair " mvcl %%r1,%%r1\n" ^ The test creates an invalid instruction that would trap at runtime, but the LLVM inline assembler tries to validate it at compile time too. Use the raw instruction opcode instead. Reported-by: Nick Desaulniers Signed-off-by: Ilie Halip Reviewed-by: Nick Desaulniers Suggested-by: Ulrich Weigand Link: https://github.com/ClangBuiltLinux/linux/issues/1421 Link: https://lore.kernel.org/r/20211117174822.3632412-1-ilie.halip@gmail.com Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger [hca@linux.ibm.com: use illegal opcode, and update comment] Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- arch/s390/lib/test_unwind.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/s390/lib/test_unwind.c b/arch/s390/lib/test_unwind.c index 6bad84c372dcb..b0b67e6d1f6e2 100644 --- a/arch/s390/lib/test_unwind.c +++ b/arch/s390/lib/test_unwind.c @@ -171,10 +171,11 @@ static noinline int unwindme_func4(struct unwindme *u) } /* - * trigger specification exception + * Trigger operation exception; use insn notation to bypass + * llvm's integrated assembler sanity checks. */ asm volatile( - " mvcl %%r1,%%r1\n" + " .insn e,0x0000\n" /* illegal opcode */ "0: nopr %%r7\n" EX_TABLE(0b, 0b) :); -- 2.33.0