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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A00DC433FE for ; Thu, 24 Nov 2022 23:58:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyM6W-0005lP-VZ; Thu, 24 Nov 2022 18:58:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyM6V-0005kh-NH; Thu, 24 Nov 2022 18:58:03 -0500 Received: from mail-vs1-xe31.google.com ([2607:f8b0:4864:20::e31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyM6U-0003Yd-6M; Thu, 24 Nov 2022 18:58:03 -0500 Received: by mail-vs1-xe31.google.com with SMTP id l190so2755870vsc.10; Thu, 24 Nov 2022 15:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AMaCs/Z1AyVsS1nxWxcV3PxL+cpyQViP/5WbDkpLjoA=; b=LDj2zRmE0c50zQLXWC0tcXX8yMGpMbvgs6sfrgp/Huj2MzBoA3ryHz0MSmbZVgS16o j29rUC29Tjk+QWqFSuUgQJACwua1raBOCo260qkv3Sb+wJl6+e/jzGIzx4fZwy+BwUMB n5jj1Yqou43jHiHoT4hLILjVApqShwc41Yk03cKcglZXYdyqvbaOq1PHkMp5hPk69fPb ST9sxkwhrIz4rOGC/C76BbUhoMtNhiY+EAsBnbWf8gv8pwvj0oQxV7pKcQd7lEr+/XFy pk+F1Z82H9ruElZCn4mpPeVSkQEo9U9r/yWZX+6dzJ7a8Pwz+NtnxJCOuQFBBZLzf015 mHsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AMaCs/Z1AyVsS1nxWxcV3PxL+cpyQViP/5WbDkpLjoA=; b=od70FDnpp65Sgmhkp6EO1oBqDKO5nde/o5DmPtvijOcjwHimQtGU81nmIy9mVOh6wX +1iP9n5z3s3yq7+3yyurygT+7lz9IsSI2LBPEnUOfo6VEI25NxpB2RRIHSgiPW9MZbaQ Rv/BJ7Ja9jp+9sL6R4chCUfArP/2nRo06fQKoyyqn/rXRdHmH1BE/dq7nKJ9Q3r1sX6Y ASv+lsrBljZ8jphZEtU85+5WN5ljbDts5gGcuE5a+dQLaGGU/yLNRUZN7E7K8WT1O7f/ WpAyu6L2YDEArMtnIMhylYUmtXQK/XfI9MrdksmtcKHa751IIlwGWJ72RUDjREGUVJ3J 6+lw== X-Gm-Message-State: ANoB5plAWvghigOTOkOaAgzW7J8XBhdhC/V3IP7gYSyVP7zAQXB1tITi bOoi49ER0xDJ7bFSxALEWdFBiynD5Q/o6N5Qp2Q= X-Google-Smtp-Source: AA0mqf5Sm2sP9RfszRlq7hlfHJqIixZIXGTCPmzvFGfJOsP53n5rYvZTWWDKaCWUC/XL08MSm2FW+MK5KxxzA7BBsTs= X-Received: by 2002:a05:6102:f09:b0:3a6:eec3:b246 with SMTP id v9-20020a0561020f0900b003a6eec3b246mr18927594vss.64.1669334280531; Thu, 24 Nov 2022 15:58:00 -0800 (PST) MIME-Version: 1.0 References: <20221122154628.3138131-1-bmeng@tinylab.org> In-Reply-To: From: Alistair Francis Date: Fri, 25 Nov 2022 09:57:34 +1000 Message-ID: Subject: Re: [PATCH] target/riscv: Dump sstatus CSR in riscv_cpu_dump_state() To: Bin Meng Cc: Bin Meng , qemu-devel@nongnu.org, Alistair Francis , Bin Meng , Palmer Dabbelt , qemu-riscv@nongnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::e31; envelope-from=alistair23@gmail.com; helo=mail-vs1-xe31.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Wed, Nov 23, 2022 at 2:07 PM Bin Meng wrote: > > Hi Alistair, > > On Wed, Nov 23, 2022 at 8:03 AM Alistair Francis wrote: > > > > On Wed, Nov 23, 2022 at 2:07 AM Bin Meng wrote: > > > > > > sstatus register dump is currently missing in riscv_cpu_dump_state(). > > > > > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1332 > > > Signed-off-by: Bin Meng > > > > > > --- > > > > > > target/riscv/cpu.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c > > > index d14e95c9dc..80d76f0181 100644 > > > --- a/target/riscv/cpu.c > > > +++ b/target/riscv/cpu.c > > > @@ -382,6 +382,7 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags) > > > CSR_MHARTID, > > > CSR_MSTATUS, > > > CSR_MSTATUSH, > > > + CSR_SSTATUS, > > > > I don't think we need this. mstatus contains all of the information > > already and there is limited space to print all of this information > > out. > > > > I am not sure what limited space restricts this? This is CPU state > dump, and printing sstatus CSR seems reasonable to me. We do the > similar thing in the gdb stub too. Limited space in that there is only so much text we want to dump to the screen. As new extensions are added this will continue to grow, and sstatus doesn't provide any more information then the mstatus register that we already show. GDB is a little different as people can interactively probe the registers they are interested in. Alistair > > Regards, > Bin