From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 876361DFF0 for ; Tue, 9 Dec 2025 02:08:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765246109; cv=none; b=bmdsX8bUSI4JA9iimqEsUv4i1XT6eMjOiJ8V9kBSmiR0v34RMXth/VN6n4c6YZeLEaNmaV6LQW2jjdSXmQasz/NGI4k5mLaUZcJRwZ36JjDKiO58OHLdipZozvKvT7LGyJBrOTpDG/LiLUbCSDzDOrIc5JTAIEEjMJkY2t1nWnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765246109; c=relaxed/simple; bh=bvCpVa1xOGmJKrr+zelz211QpvanjA1V8AY+VmvygiI=; h=Subject:From:To:Cc:References:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=u0rPTBOPGRwHgzkArakYnj6rwirdMI9jU7E1hhoHOLUnyidqnBWwNadySE1QbxqEUV2dhNZAXG0Iq5H7zd/IFNp+6FSBac9Wvz9rWKeGuqIrZkT+bG5Fq19YwGXynlb2R6h3W+SBVSfQcCmY4PW6pgfgc5hYLqSSAegcEFSp1Ws= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8Dxvr+ZhDdpB4IsAA--.28404S3; Tue, 09 Dec 2025 10:08:25 +0800 (CST) Received: from [10.130.40.83] (unknown [113.200.148.30]) by front1 (Coremail) with SMTP id qMiowJDxQ+SXhDdp90BHAQ--.62762S3; Tue, 09 Dec 2025 10:08:24 +0800 (CST) Subject: Re: [PATCH v1] LoongArch: Handle special PC in unwind_next_frame() From: Tiezhu Yang To: Jinyang He Cc: Huacai Chen , Xi Zhang , Xianglai Li , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, Bibo Mao References: <20251125063327.31586-1-yangtiezhu@loongson.cn> <658bb477-b3f1-97c1-ab37-5dafcb6215f5@loongson.cn> <6cc59312-7cdc-19a5-4d18-e120ea9c7563@loongson.cn> <3c0602aa-a8bc-25b9-7d7a-467e04dbc519@loongson.cn> <45cf4a09-8895-73fb-c019-1b1f88501eed@loongson.cn> Message-ID: Date: Tue, 9 Dec 2025 10:08:23 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <45cf4a09-8895-73fb-c019-1b1f88501eed@loongson.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID:qMiowJDxQ+SXhDdp90BHAQ--.62762S3 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoW7KF43KF15GF17Jw13Gw1DCFX_yoW8GFWrpa 1rtF17trZ7GF18Gr18Jr18WFy7Jw4rtw1UJr1kXFyUJ3yUtFnaqr1jqryqgryUAr4xKr1Y vF10qF95Zr1UJ3cCm3ZEXasCq-sJn29KB7ZKAUJUUUU5529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUv0b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07AlzV AYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8zwZ7UU UUU== On 2025/11/26 下午5:09, Tiezhu Yang wrote: ... >> I will do more test and send v2 later. > > Here are the draft changes: ... > +#if IS_ENABLED(CONFIG_KVM) > +       unsigned long old, new, size; > + > +       if (get_kvm_entry_info) { > +               get_kvm_entry_info(&old, &new, &size); > +               if (ra >= new && ra < new + size) > +                       return old + (ra - new); > +       } > +#endif ... > > I tested with config UNWINDER_ORC, it can unwind from kvm_handle_exit() > to its previous frame kvm_exc_entry() which is the end of stack, there > is no "unreliable stack" in debug mode and also no timeout for kernel > livepatching. > > I also tested with config UNWINDER_PROLOGUE and config UNWINDER_GUESS, > no build errors and the virtual machine can boot normally. > > I would like to receive comments for the draft changes first and then > send the formal v2, the function and variable name may be not proper, > so any comments are welcome. > > Since the merge window is coming soon and I am busy with the other > higher priority stuff, so maybe I will send v2 after the merge window. FYI, after some internal discussions, it will only modify the code of KVM to fix this problem, so please ignore this patch and the above diff, I will not send new version and please wait for the KVM patch. Thanks, Tiezhu