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 9C179C433F5 for ; Mon, 18 Oct 2021 06:07:49 +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 4516060F93 for ; Mon, 18 Oct 2021 06:07:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4516060F93 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:57380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcLoK-0000hI-9R for qemu-devel@archiver.kernel.org; Mon, 18 Oct 2021 02:07:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcLlz-0007Ew-4K for qemu-devel@nongnu.org; Mon, 18 Oct 2021 02:05:24 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:43995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mcLlv-0002ob-H1 for qemu-devel@nongnu.org; Mon, 18 Oct 2021 02:05:21 -0400 Received: by mail-pf1-x431.google.com with SMTP id 187so13868270pfc.10 for ; Sun, 17 Oct 2021 23:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4GoNaO6cAr8P3L2u+cHY+4aP6OhACRc+y7aXts4nf94=; b=r4WTyBV7kWeANPz7SiXT3APGMeI1UsTVvd99SiW7v6kPu5ot0kAUn+EkvkbO7POTMh Lobxv6Pudu2V7CAZZmi3ghtI5tButW1mTuhWyg8aj37hVXoSiZOvpj2QKdZepAHDeV5g Sbfm4YUrm0susxrSj9IlonwWpoWy7FawClkA7vV2SwR9gHiKsR/SkaUiPLWlUOw5rEh2 SQlZHpaUV3ZWaTegHdgFvdfkq56i/BmhYs9zOaTA+RHuOJH/5s+7ZWwh1mjodjbvRvvj jKfOsCB33dYqhfMitaR06exyeQpoHF4MsBv3RVfasaa8WqWJiTvCt6GgGZvmcIT2zVaq 9fAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4GoNaO6cAr8P3L2u+cHY+4aP6OhACRc+y7aXts4nf94=; b=jC+SKs2lfktN4dxhvucE017cCN29kdd2GjIjHpNTEPkhmcHa0APJgxaEIkRKF5yRtc 6lH3Hsi2Lfh+RtY6Ikh+HIOawIVOmQO3pVVoI9FDF5TNAifFsPulNLkvNpO/UA2OymZL +n1xA6wJFo6R1fXM6BtTrcniawGChI2rr2UGVvkllsY124QEru1MhZtioE259F3rlLeB IBMdiSM/IqtR3yzsjlDbSXCuaBsppPMuEsnW3kGhzl1JWWb0/J8dQ/GRRySoyD7HGNfk MNpXlFzAq+fEzWkN2Fyuq3j2Wz6i5UE4IrpN2gWwdXjjFTg4iRz4pVM+uhOUaee2Lic9 5wKw== X-Gm-Message-State: AOAM531DkmG0aOVls+6jnzMUy8cpz2c3yrbwKjriZeJB+M5pGYEaAvsK O/krNQRPdDw0vxNfyMJ/Y2MUhA== X-Google-Smtp-Source: ABdhPJwIXRUcIeievjSFGBYGEnJfL4MLGKKmIt/KuHZsMF6TOViuyJrSXzb8Z2utTl+CKelqlPIGng== X-Received: by 2002:a63:81c2:: with SMTP id t185mr14382682pgd.114.1634537117937; Sun, 17 Oct 2021 23:05:17 -0700 (PDT) Received: from [192.168.1.11] ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id g25sm3209531pge.12.2021.10.17.23.05.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Oct 2021 23:05:17 -0700 (PDT) Subject: Re: [PATCH v3 14/14] target/riscv: Compute mstatus.sd on demand To: Alistair Francis References: <20211016171412.3163784-1-richard.henderson@linaro.org> <20211016171412.3163784-15-richard.henderson@linaro.org> From: Richard Henderson Message-ID: Date: Sun, 17 Oct 2021 23:05:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 10/17/21 10:38 PM, Alistair Francis wrote: > 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). (1) We have at least 3 places that need to check the cpu state in order to set SD correctly; we would add another couple with the VS bit that's coming in from RVV-1.0. By setting this bit during read, we reduce that to one accessor for read. (2) We would need to move this bit when changing MXL, once that's possible with the various XLEN changing patch sets. (3) The position of this bit, between MSTATUS and SSTATUS, differs if MXL != SXL, which means that there is not really one correct setting for (2). r~ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mcLmE-0007Gh-2Z for mharc-qemu-riscv@gnu.org; Mon, 18 Oct 2021 02:05:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcLlx-0007Em-3W for qemu-riscv@nongnu.org; Mon, 18 Oct 2021 02:05:24 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:40937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mcLlv-0002od-Gk for qemu-riscv@nongnu.org; Mon, 18 Oct 2021 02:05:20 -0400 Received: by mail-pg1-x52e.google.com with SMTP id q5so14984133pgr.7 for ; Sun, 17 Oct 2021 23:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4GoNaO6cAr8P3L2u+cHY+4aP6OhACRc+y7aXts4nf94=; b=r4WTyBV7kWeANPz7SiXT3APGMeI1UsTVvd99SiW7v6kPu5ot0kAUn+EkvkbO7POTMh Lobxv6Pudu2V7CAZZmi3ghtI5tButW1mTuhWyg8aj37hVXoSiZOvpj2QKdZepAHDeV5g Sbfm4YUrm0susxrSj9IlonwWpoWy7FawClkA7vV2SwR9gHiKsR/SkaUiPLWlUOw5rEh2 SQlZHpaUV3ZWaTegHdgFvdfkq56i/BmhYs9zOaTA+RHuOJH/5s+7ZWwh1mjodjbvRvvj jKfOsCB33dYqhfMitaR06exyeQpoHF4MsBv3RVfasaa8WqWJiTvCt6GgGZvmcIT2zVaq 9fAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4GoNaO6cAr8P3L2u+cHY+4aP6OhACRc+y7aXts4nf94=; b=L9YR7SO6X7mag/4at5gtF5KtqaiJIHNZg9ITNyV4yptbRVrl9vu/glXx2vMiSxgVID qN/IFETdEpI22TMX52gX7cqSu9c7BPApOPJ2KY9aD37wUhQXLgYSg6LvLndMqHWNbYHP lEVGXqO7z9T3s8hB2ThzYV7JhM5Uu2Rjeww/pAGh4/gvQPjGSb/vNI8BCF/XMcvQL69O LFnPicMJt6+frrvnSggy33y2IRO7A9FfI71y2VcN6hJSlE6XxECWbb0SDbSTLtglAVfm iJjZTP0Bz593aSL63DPI/lKc5weltnBeEp+KXof2c14V4TZwxk+bg+AOaNW3i2Ayej1m qGxQ== X-Gm-Message-State: AOAM531oIqZZcxa8COs/z2kyWZgW8RZrCd0XaxbcRPdMB/cKdQ/Utad5 4FPCV2stqcOJL1LJ00/vPw5hHQ== X-Google-Smtp-Source: ABdhPJwIXRUcIeievjSFGBYGEnJfL4MLGKKmIt/KuHZsMF6TOViuyJrSXzb8Z2utTl+CKelqlPIGng== X-Received: by 2002:a63:81c2:: with SMTP id t185mr14382682pgd.114.1634537117937; Sun, 17 Oct 2021 23:05:17 -0700 (PDT) Received: from [192.168.1.11] ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id g25sm3209531pge.12.2021.10.17.23.05.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Oct 2021 23:05:17 -0700 (PDT) Subject: Re: [PATCH v3 14/14] target/riscv: Compute mstatus.sd on demand To: Alistair Francis Cc: "qemu-devel@nongnu.org Developers" , "open list:RISC-V" , Frank Chang , Alistair Francis , Fabien Portas , =?UTF-8?B?RnLDqWTDqXJpYyBQw6l0cm90?= , liuzhiwei References: <20211016171412.3163784-1-richard.henderson@linaro.org> <20211016171412.3163784-15-richard.henderson@linaro.org> From: Richard Henderson Message-ID: Date: Sun, 17 Oct 2021 23:05:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, NICE_REPLY_A=-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-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Oct 2021 06:05:29 -0000 On 10/17/21 10:38 PM, Alistair Francis wrote: > 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). (1) We have at least 3 places that need to check the cpu state in order to set SD correctly; we would add another couple with the VS bit that's coming in from RVV-1.0. By setting this bit during read, we reduce that to one accessor for read. (2) We would need to move this bit when changing MXL, once that's possible with the various XLEN changing patch sets. (3) The position of this bit, between MSTATUS and SSTATUS, differs if MXL != SXL, which means that there is not really one correct setting for (2). r~