On Tue, 7 Feb 2023 at 12:15, Philippe Mathieu-Daudé <phi...@linaro.org> wrote:
>
> On 3/2/23 19:04, Peter Maydell wrote:
> > Anything with type ARM_CP_NO_RAW shouldn't need a .raw_writefn, because
> > that type indication says that it's a bug if we ever call
> > read_raw_cp_reg() or write_raw_cp_reg() on it. (Specifically,
> > for KVM, we should never end up trying to do a raw read/write
> > for a state sync because write_list_to_cpustate() and
> > write_cpustate_to_list() skip NO_RAW cpregs.)
>
> Ah, this is the check added by commit 375421ccae ("target-arm: Add
> checks that cpreg raw accesses are handled"). So this patch shouldn't
> pass check-qtest, right?

That commit adds a check that if your register is *not* NO_RAW
then raw_read/raw_write will work[*] (ie it is const/has a fieldoffset/
has raw accessors/has normal accessors). It doesn't check that
if the register *is* NO_RAW it doesn't also specify unnecessary
accessor functions.

[*] at least in the sense of not crashing or accessing
offset 0 in the state structure -- it has no way of telling
the difference between "no raw accessors specified because
the plain ones will work fine" and "no raw accessors
specified, and this is a bug because the plain ones do
something that's not OK as a raw-access".

thanks
-- PMM

Reply via email to