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 E92962CA6 for ; Mon, 6 Dec 2021 21:13:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B55F0C341C6; Mon, 6 Dec 2021 21:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638825204; bh=ewmuxsY11nEr8SFgDbQVXcVDgcxMTM324HMwRtemalk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bVxWkZ2JiM+rUYpzfw5AhoczNGCtBVMq16DbnibjhljtOQ2xAksAG0Q0sIZqJvDpL ajq2ZbGIUdFb06nvc0oIdM1D0b2GigOORRTRtsA0sW1ch8E390X8atcbdSdY3uGmhJ /aUl1q7mMZBTsaMAeFb0AXzke7Nm5FdF44R4ZLGISUqrb+BA0rE/0khyUO/o51pWru l18zjaR8NQcsd+rPAlqSMg/l0VjUv07X/1Ct1/IKncHLjvntRQ4WDOVNXRYouXPsoj qJaB1N/t4kIkiJCivxqAJkeHsLo2fd6dOr2GbSY+ztJwkh5zYvtYENe0PWavE9gw9H UtlA+dTuY8RoA== 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, meted@linux.ibm.com, linux-s390@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH AUTOSEL 5.15 06/24] s390/test_unwind: use raw opcode instead of invalid instruction Date: Mon, 6 Dec 2021 16:12:11 -0500 Message-Id: <20211206211230.1660072-6-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211206211230.1660072-1-sashal@kernel.org> References: <20211206211230.1660072-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 ecf327d743a03..c0635cf787e31 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