From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 3797D3858280 for ; Tue, 5 Jul 2022 14:38:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3797D3858280 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from [192.168.68.105] (unknown [111.18.133.250]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxj+PJTMRij6wKAA--.32145S3; Tue, 05 Jul 2022 22:38:02 +0800 (CST) Message-ID: <482d74d5-9377-02b4-9866-aec8f5fee32e@loongson.cn> Date: Tue, 5 Jul 2022 22:38:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v2] gdb: LoongArch: add orig_a0 into register set Content-Language: en-US To: Xi Ruoyao , gdb-patches@sourceware.org References: <95fc996abd9583348184a81cdd9bc5760fba17e1.camel@xry111.site> Cc: Xuefeng Li From: Tiezhu Yang In-Reply-To: <95fc996abd9583348184a81cdd9bc5760fba17e1.camel@xry111.site> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: AQAAf9Dxj+PJTMRij6wKAA--.32145S3 X-Coremail-Antispam: 1UD129KBjvJXoW7tw4kury3KrW5uryDtFy5urg_yoW8ur1UpF yUCF4YkF4kGF47A3sFgw1Y9Fy5tws3JryagF13Ary3uF90qFn29an7uFn3ZF12k34IgFW0 qF4xtw1j93WUAa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r1j 6r4UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IY64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7Mxk0xIA0c2IEe2xFo4CEbIxv r21l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxV WUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI 7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r 1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7VUbrMaUUUUU U== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2022 14:38:09 -0000 On 7/4/22 14:20, Xi Ruoyao wrote: > Hi Tiezhu, > > Thanks for the review. > > On Mon, 2022-07-04 at 10:50 +0800, Tiezhu Yang wrote: > >> The related code in gdb/loongarch-linux-nat.c also need to be >> modified. > > Done in v2. > >> Additionally, we know that the LoongArch upstream Linux kernel can not >> actually be used before efistub, irqchip and pci are merged [0]. >> >> [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c6f2f3e2c80e >> >> So I think we can modify the patch subject and the commit message like >> this: > > Done in v2, with some modification. > > Patch v2 follows here: > > -- >8 -- > > > The basic support for LoongArch has been merged into the upstream Linux > kernel since 5.19-rc1 on June 5, 2022. This commit adds orig_a0 which > is added into struct user_pt_regs [1] to match the upstream kernel, and > then the upstream GDB will work with the upstream kernel. > > Note that orig_a0 was added into struct user_pt_regs in the development > cycle for merging LoongArch port into the upstream Linux kernel, so > earlier kernels (notably, the product kernel with version 4.19 used in > distros like UOS and Loongnix) don't have it. Inspect > arch/loongarch/include/uapi/asm/ptrace.h in the kernel tree to make sure. > To build upstream GDB for a kernel lacking orig_a0, it's necessary to > revert this commit locally. > > [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/loongarch/include/uapi/asm/ptrace.h#n24 > > Signed-off-by: Xi Ruoyao > --- > gdb/features/loongarch/base32.c | 1 + > gdb/features/loongarch/base32.xml | 1 + > gdb/features/loongarch/base64.c | 1 + > gdb/features/loongarch/base64.xml | 1 + > gdb/loongarch-linux-nat.c | 2 ++ > gdb/loongarch-linux-tdep.c | 8 ++++++++ > gdb/loongarch-tdep.c | 1 + > gdb/loongarch-tdep.h | 7 ++++--- > 8 files changed, 19 insertions(+), 3 deletions(-) > Looks good to me, this patch only touches files related with LoongArch, pushed. Thanks, Tiezhu