From patchwork Thu Nov 3 15:10:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13030175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 159E3C43217 for ; Thu, 3 Nov 2022 15:12:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232073AbiKCPME (ORCPT ); Thu, 3 Nov 2022 11:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232156AbiKCPLt (ORCPT ); Thu, 3 Nov 2022 11:11:49 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEC20DAD; Thu, 3 Nov 2022 08:11:12 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id A20465C0054; Thu, 3 Nov 2022 11:11:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 03 Nov 2022 11:11:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1667488269; x=1667574669; bh=gPsPIUpuWi 0AzhW+1UQvBnM1pKalxNt18gpNydGWEuE=; b=ivzSOPo0VRRByEJs7gehHrnsoU O/1Qpib6eRC6wPu+27XOD2lT1+Zhm+B8ta6XI8FTsKtqyUb34m53Tfr0dPrnen88 odeMSfTzAhFhYqITHJDfQAW+slcfL0rqsuhgqZM+oBRZHnCUVrYNzBOU/5r3YtZG rqgosgjr+pbqZ0bwJOpGwyvSyXlW81k62Ii84OtbkHaHT3VE7CvxvOWl62nsO6I2 nKvcnV86NYi/+/TN4GeyYMtnaaM1ZeSwotANnQmN81vo7pzy2rKsYtr1U29zKG/O LeEQrR7pNK2r8SIBxAW3bhzY+A5sxf/AlU/uqHgvhsjfNhVnXDsbbvWqVUnw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667488269; x=1667574669; bh=gPsPIUpuWi0Az hW+1UQvBnM1pKalxNt18gpNydGWEuE=; b=NzKAZ3bmOvJNQs5Z+lG5fPp5xIXVn a9GQYaHnmclp14YKW5ttwKfdqBJpfc6CcwhNwh2MYpCuAEx2Le/51xua9AiYET14 5ssO4mvecnw4EWCzq7ZWlPHrK/pZ5dBxatmeA2MoU/SoRE5WbLChPdItHhZQzzYw 3/nr+XkAc4KLIRL5iuk/XjzMFDzw2I5vyp99iOw05mD6Z9u8SPX9Q/H8W+0Om3lq mupvqIQtoG7PQDeUGLSvIfRno2mTuaUW2JheiKdRMLZETp2h+x/1Z8FPPJJ54eKQ AzxtZz2+tBWPytfrSmb2sTVU7Cr8vX6grEZYso6xmWXn2rkXQkNONthqg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrudelgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheplfhirgiguhhn ucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenucggtf frrghtthgvrhhnpedtgfduvedvtdfgkeektdffveeiueeludegheehtdegheduueeuueeg tdehjeehheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Nov 2022 11:11:07 -0400 (EDT) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, ardb@kernel.org, rostedt@goodmis.org, Jiaxun Yang , stable@vger.kernel.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2] MIPS: jump_label: Fix compat branch range check Date: Thu, 3 Nov 2022 15:10:53 +0000 Message-Id: <20221103151053.213583-1-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Cast upper bound of branch range to long to do signed compare, avoid negative offset trigger this warning. Fixes: 9b6584e35f40 ("MIPS: jump_label: Use compact branches for >= r6") Signed-off-by: Jiaxun Yang Cc: stable@vger.kernel.org Reviewed-by: Philippe Mathieu-Daudé --- v2: Fix typo, collect review tags. --- arch/mips/kernel/jump_label.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c index 71a882c8c6eb..f7978d50a2ba 100644 --- a/arch/mips/kernel/jump_label.c +++ b/arch/mips/kernel/jump_label.c @@ -56,7 +56,7 @@ void arch_jump_label_transform(struct jump_entry *e, * The branch offset must fit in the instruction's 26 * bit field. */ - WARN_ON((offset >= BIT(25)) || + WARN_ON((offset >= (long)BIT(25)) || (offset < -(long)BIT(25))); insn.j_format.opcode = bc6_op;