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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B708C433EF for ; Mon, 18 Oct 2021 05:42:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C1F1B61027 for ; Mon, 18 Oct 2021 05:42:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C1F1B61027 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:56952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcLPk-0005a4-B5 for qemu-devel@archiver.kernel.org; Mon, 18 Oct 2021 01:42:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcLMB-0002xM-9p; Mon, 18 Oct 2021 01:38:45 -0400 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]:40769) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mcLM9-0004nE-9e; Mon, 18 Oct 2021 01:38:42 -0400 Received: by mail-il1-x135.google.com with SMTP id k3so3277973ilo.7; Sun, 17 Oct 2021 22:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JMW3SlNS6TeTS8bYlu9dqbX1aQ5PChdeZZFObjQVjQ4=; b=mRFB+wQLGU2b4cVPPOwuyvF88LCBFxW8OYZBkzD8bBSEhazS1U3cAE/SnDJj9Dqbr1 aJuB5+r1xpW2dRtqOuYcW5hoEF4sShD0Y0Ztz87S7TeC/4LIGuSEtqAZkGCbEX/Tj9Xz GDHZ7D+LgtmnQqXDSmfGBRz4PpxO6VAiHRzJSKUWA0Kwr9UrW3gFDcci0KRcEgb9MWBm Mw4vv4zdo/oByVz1KxBjC1cgXkERTmQ1+2KJsFjyeUkwOGmqt0RDLGE3cAA3X/i+rTWI TuQcU8cgzEQBUizKvHjHn19Em3q1EZxUmKfzlaaEEylEmm5hE3Myh7i32FDVHI07cjKg jMJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JMW3SlNS6TeTS8bYlu9dqbX1aQ5PChdeZZFObjQVjQ4=; b=v8qNUamyBMEMh8GBYnkeIVSxI/uD9RJjGXB0/MEjfTuJ7d2h4TXS7MsJ6CER6GUfjI AR393NVS+5q5Y9YM5y1adO1ZZhpau+/cmxk5BuxH0Dq0kB/VZ/gZ+0Cq4pL6+xKuQ/Lf D/ik2LIUAFXCzGtzDjNCfMrPvqM15N4YYilEsXSusUTt3e0d1S0mcXbS3ujEWgUzqtHC JPQ9QaQRmno8PH0D3zjyutAQb9kkLF35kcYgU4kIHjzqnuLnwy1z0JByweRJ8OljUSuc E2IuPWJfmGaRCqujDRBVlFmidoZDFSzrLFngCq3UZ2wEtJUUWqdHbuJQXqLW3j5tRGdL suRg== X-Gm-Message-State: AOAM532tyX5usZiBOEQ2tSgqmXcnwOFwd+3LljTuYL2Sg4qNEWw+DIUb rTsDD0Ijkurt9sAaTSLrbGkbGx+7vsQXTAad5YE= X-Google-Smtp-Source: ABdhPJwuZB/Vbis8sgmSJr//sJbZsdXiybBJpiGmep0kxlCOfFkTBem9ddyw/0kI6pohygkh3Tl83Dz4ny/KwwRRsB0= X-Received: by 2002:a05:6e02:1402:: with SMTP id n2mr13086839ilo.208.1634535519146; Sun, 17 Oct 2021 22:38:39 -0700 (PDT) MIME-Version: 1.0 References: <20211016171412.3163784-1-richard.henderson@linaro.org> <20211016171412.3163784-15-richard.henderson@linaro.org> In-Reply-To: From: Alistair Francis Date: Mon, 18 Oct 2021 15:38:12 +1000 Message-ID: Subject: Re: [PATCH v3 14/14] target/riscv: Compute mstatus.sd on demand To: Richard Henderson Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::135; envelope-from=alistair23@gmail.com; helo=mail-il1-x135.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:RISC-V" , Frank Chang , "qemu-devel@nongnu.org Developers" , Alistair Francis , Fabien Portas , =?UTF-8?B?RnLDqWTDqXJpYyBQw6l0cm90?= , liuzhiwei Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, Oct 18, 2021 at 3:31 PM Richard Henderson wrote: > > On 10/17/21 9:52 PM, Alistair Francis wrote: > > On Sun, Oct 17, 2021 at 3:32 AM Richard Henderson > > wrote: > >> > >> The position of this read-only field is dependent on the > >> current cpu width. Rather than having to compute that > >> difference in many places, compute it only on read. > >> > >> Signed-off-by: Richard Henderson > > > > This means that the value reported by riscv_cpu_dump_state() and GDB > > will both be incorrect though? > > Yep. Missed those; should have added another accessor. Do we get much of an advantage from this though? To me it seems confusing that the mstatus register doesn't actually contain the latest value (for example when debugging QEMU and adding my own printf's). > > Also, for the record, it changes the vmstate, but since a previous patch in the series > bumped the version number for the split on misa, we can call all of a piece and ok. Works for me :) Alistair > > > r~