From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C3A2C3600C for ; Tue, 8 Apr 2025 09:32:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C21A56B000E; Tue, 8 Apr 2025 05:32:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA8106B0012; Tue, 8 Apr 2025 05:32:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A47396B0022; Tue, 8 Apr 2025 05:32:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 84F296B000E for ; Tue, 8 Apr 2025 05:32:11 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A9092140919 for ; Tue, 8 Apr 2025 09:32:11 +0000 (UTC) X-FDA: 83310360462.06.E600744 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by imf05.hostedemail.com (Postfix) with ESMTP id D8C7310000B for ; Tue, 8 Apr 2025 09:32:08 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of yangtiezhu@loongson.cn designates 114.242.206.163 as permitted sender) smtp.mailfrom=yangtiezhu@loongson.cn; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744104730; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jygftG1G3jtZ+xzPjAgxNPd0vjn4fthZIjlGbqQZDMk=; b=cPT0JQXB2P34vQB6NmLxH9bzMJwpcRrPIuGHUIs9+a4fwtd/XD5Vfq7V65PWEA3NHOM1QR oFb3kpJm9plyNRlERSLlSTxKJi82ar5HgjuNvHWT3sYjiBI4vVnlDpz2/qDR+QHUYJZIJL m5CjdrAfHs12WGTMn35fPSeyQZX9Q2I= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of yangtiezhu@loongson.cn designates 114.242.206.163 as permitted sender) smtp.mailfrom=yangtiezhu@loongson.cn; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1744104730; a=rsa-sha256; cv=none; b=iZHiY/peeAOcs6yOxQWigiemHvx8ju9Iy2BxWveEgSavlj/a+WDGfZTKTukdyhOlg44g9u 8AKooayG+bMdHPoNMgDRNrYm3koNonTUkfqYnR6q8wCcwMBxx7BBLnYbscjXjWvp/kcQQ/ YuLi7jYpD4/2uKpJ5T4KXLWBbf/Fobo= Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8AxDGsT7fRn7xC1AA--.38628S3; Tue, 08 Apr 2025 17:32:03 +0800 (CST) Received: from [10.130.0.149] (unknown [113.200.148.30]) by front1 (Coremail) with SMTP id qMiowMDxPcUS7fRnun90AA--.18864S3; Tue, 08 Apr 2025 17:32:03 +0800 (CST) Subject: Re: [linux-next:master 12681/13861] drivers/i2c/i2c-core-base.o: warning: objtool: __i2c_transfer+0x120: stack state mismatch: reg1[24]=-1+0 reg2[24]=-2-24 To: Josh Poimboeuf References: <202504011011.jyZ6NtXx-lkp@intel.com> <348cdb14-f8cf-1e7b-44b2-79dc4dda4e35@loongson.cn> <0cbe7ab8-bd87-b5f7-0513-07c82a7e76c9@loongson.cn> <5f830e7a-7cfa-3c62-ba3f-f93808e95821@loongson.cn> Cc: Philip Li , kernel test robot , Guenter Roeck , oe-kbuild-all@lists.linux.dev, Andrew Morton , Linux Memory Management List , Alessandro Carminati , Peter Zijlstra , linux-kernel@vger.kernel.org, loongarch@lists.linux.dev From: Tiezhu Yang Message-ID: <35f7eac8-a970-5fd3-25f4-55f417e8e15e@loongson.cn> Date: Tue, 8 Apr 2025 17:32:02 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID:qMiowMDxPcUS7fRnun90AA--.18864S3 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoW7uw45XF1kGFWxJF1fKr43CFX_yoW8WF47pr ZrA395CF4kGF4rtF9Fyw4jqF4Yvr93KryaqF4xK3yDAF1Yqry7CF48KFWq9F98G392q3yS qF47WasI9F4UAwcCm3ZEXasCq-sJn29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUBjb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ GcCE3s1ln4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2 x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5 McIj6I8E87Iv67AKxVW8JVWxJwA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RkDdEKfSAFFMp86tZlnXnmBOQV6pZl0xj19eUJHzhFXslcYGsDPB7lVTwf/ZFOBn0k6h+7svQgwTWLk84w0HAb5jJ+ga4tctEphwxEAOZ+cmDA8DxEWS+nw6VAkHxjzW8EZd4dlmtpEVVl+0lsQ85h5KsIB0yOEWnjAthvTSik4lEMbXXvJx8GORoI2ib5bTZfERJPbeGLGUtpu5sleo8TO9MJy1oN4SRJxUTFZcSbMjMm2UScSJ71Ndh2G83HPdLX3RK7bshCvpkxFgIOkS/6MXWqy5ZNJ44dV5fy6HJ8VHwc1aWQLJo21aWGEJxaTD0LxAs55/9MFg6u7NvN7E/+LJgrRE4aUgt0h3bY538vV2gCh49iraryHSR4iYbzxjdI0VJLm/qj/OjereVw37nCNtEzFzcuov8uQ691YFwupam7etzQOn/NqepebQu6roPNaqspl7lD/HaeMLX+n+ cMEaDzpv UVJWVoFnRFoqOFUAMhlJFI8no+3dewsMw0Qa7CiAWtVRWbaS6f3hxBIgY7kYnGFLj9mFH72yvyVZo6JDWFk1PUoMhxwCkpYAf4z48 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 04/08/2025 02:29 PM, Josh Poimboeuf wrote: > On Tue, Apr 08, 2025 at 10:45:51AM +0800, Tiezhu Yang wrote: >> So this is a run-time bug rather than a compile-time warning, it should >> put the option "-fno-shrink-wrap" outside CONFIG_OBJTOOL in >> arch/loongarch/Makefile as a workaround, like this: > > If loongarch folks agree it's a compiler bug, it should be reported to > GCC, so the issue is better understood (and can get fixed). > > Without understanding the root cause, we don't know if -fno-shrink-wrap > fixes it, or just makes this particular occurrence go away. OK, thank you. I have discussed offline with the developers Rui Wang and Lulu Cheng who are familiar with compiler, the root cause may be that if a jump label's control flow path exactly matches the caller's epilogue, the compiler may omit restoring saved registers, it needs to be confirmed by GCC developers. By the way, add an empty inline assembly can also work around the problem, like this: diff --git a/arch/loongarch/include/asm/jump_label.h b/arch/loongarch/include/asm/jump_label.h index 8a924bd69d19..dbc105e62380 100644 --- a/arch/loongarch/include/asm/jump_label.h +++ b/arch/loongarch/include/asm/jump_label.h @@ -34,6 +34,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key, co return false; l_yes: + asm volatile(""); return true; } @@ -47,6 +48,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const ke return false; l_yes: + asm volatile(""); return true; } We will fix this issue once the root cause is clear. Thanks, Tiezhu