On 8/23/22 02:19, David Hildenbrand wrote:
1) s390_probe_access() documents to "With nonfault=1, return the PGM_
exception that would have been injected into the guest; return 0 if no
exception was detected."
But in case of CONFIG_USER_ONLY, we return the flags returned by
s390_probe_access(), not a PGM__* value. Maybe it doesn't matter,
because we'll simply inject a SIGSEGV in any case ...
I would have said it would matter for MVPG, except that is incorrectly *not* marked as a
privileged instruction. There should be no CONFIG_USER_ONLY case to answer there.
2) s390_probe_access() documents that for "CONFIG_USER_ONLY, the
faulting address is stored to env->__excp_addr.".
However, that's only set in s390_cpu_record_sigsegv(). With nonfault=1
that will never actually trigger, right?
Correct.
I assume db9aab5783a2 ("target/s390x: Use probe_access_flags in
s390_probe_access") might have introduced both. We had a flag conversion
to PGM_ in there and stored env->__excp_addr:
Indeed, that commit is faulty in that it breaks the contract of
s390_probe_access.
It's a shame, though, that we need to carry the extra code for the purpose, and that the
generic interfaces are not sufficient.
r~