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: 14937 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp592804wru; Thu, 3 Nov 2022 08:13:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79M0vCqjaYtcE3JdKaeGh7JAb8PHShQQCwjtkkSDYZ+L8qqIgH51NoVK1ruF+O5TuW+E0X X-Received: by 2002:a17:906:fcb0:b0:7ae:388:98c5 with SMTP id qw16-20020a170906fcb000b007ae038898c5mr9057272ejb.120.1667488412346; Thu, 03 Nov 2022 08:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667488412; cv=none; d=google.com; s=arc-20160816; b=Vm8Tz6De9txKtR5AUePUpUNQ0k2XkFxeQ4ZgmwkNyShRQaf+NgTbXbB/7khsAqPTRG +oBD/QcLmjX1KpudEyrCAkPZwztgDtWeErSn/7OiPJsnmpioPGcxXjpukG0q0xDEL+y5 z8K4tuLiSBKzljq5/fcw/P+Fznxpi5IhFc3Czujmo95NS50ANylfZJH/TJyFDvWsR+8C W3EOe6zOcLDpDMY22tRvHXkd9pT+up1obMxEw7tASoT/4ddvMN4POztEDQV4X95H4nEu gCKiMFqVqpohNIUQvRJCpuSFs74SLiKNpZSwpkSWAsr7Emo8oSOLb/ZvfkAQopnOiAIz 9SMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=gPsPIUpuWi0AzhW+1UQvBnM1pKalxNt18gpNydGWEuE=; b=AA3s4M7qxcyrR6eAmVOvh5jl+t54QHl0gE/RDcrA6kbWFljrKdpcjMTOh9EbUK336E L0xG4nF/2t9hGf6tbjJ2tYtnh/FAuwbRf3wzuPuLZ9ohAfI8TBjIwqftd+w2mf1xqyvs TWGeeG8MWRK2KaaPGpVhrwlbdZnJRdKtmUEhPC/Kl6so0lYyQEBuWilhi3TvP+Pbz0Xq JjgkIwVREFi7sx7Apy5kHkACCvBgJyaNQlFLyiDR7WdEgmXlGYUOno6jtbOoiq8KVF26 guTLo8s9kirEGXoAXEzgVmMygsvBKiYPMTrhclXbrXu+27NN9isOB342Kvw1ByakeVBl HFdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=ivzSOPo0; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=NzKAZ3bm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr22-20020a170907721600b007adf9d2fa0fsi1598137ejc.947.2022.11.03.08.13.06; Thu, 03 Nov 2022 08:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=ivzSOPo0; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=NzKAZ3bm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232109AbiKCPMG (ORCPT + 99 others); Thu, 3 Nov 2022 11:12:06 -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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748488329397367050?= X-GMAIL-MSGID: =?utf-8?q?1748488329397367050?= 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;