|
From: | Richard Henderson |
Subject: | Re: [PATCH v2 2/3] target/riscv: Implement the stval/mtval illegal instruction |
Date: | Fri, 24 Sep 2021 08:57:21 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
On 9/24/21 2:48 AM, Alistair Francis wrote:
But... more specific to this case. Prior to this, was the exception handler allowed to assume anything about the contents of stval? Should the value have been zero? Would it be wrong to write to stval unconditionally? How does the guest OS know that it can rely on stval being set?As we didn't support writing the illegal instruction stval should be zero before this patch.
Ok, that didn't quite answer the question...If *wasn't* zero before this patch: we didn't write anything at all, and so keep whatever previous value the previous exception wrote.
Is that a bug that needs fixing? Because you're still not writing anything to stval if !MTVAL_INST...
I simply wonder whether it's worthwhile to add the feature and feature test.Do you just mean have it enabled all the time?
Yes, if without this feature the value of stval was undefined. r~
[Prev in Thread] | Current Thread | [Next in Thread] |