On Fri, 7 Oct 2022 at 17:53, Richard Henderson <richard.hender...@linaro.org> wrote: > > On 10/7/22 09:20, Peter Maydell wrote: > >> - /* Check if IPA translates to secure or non-secure PA space. > >> */ > >> - if (is_secure) { > >> - if (ipa_secure) { > >> - result->attrs.secure = > >> - !(env->cp15.vstcr_el2 & (VSTCR_SA | VSTCR_SW)); > >> - } else { > >> - result->attrs.secure = > >> - !((env->cp15.vtcr_el2 & (VTCR_NSA | VTCR_NSW)) > >> - || (env->cp15.vstcr_el2 & (VSTCR_SA | VSTCR_SW))); > >> - } > >> - } > > > > If: > > is_secure == true > > ipa_secure == false > > (env->cp15.vstcr_el2 & (VSTCR_SA | VSTCR_SW) is non-zero > > (env->cp15.vtcr_el2 & (VTCR_NSA | VTCR_NSW) is zero > > then the old code sets attrs.secure to true... > > No, I think the misalignment of the two lines wrt the !() may have been > confusing:
Ah, yes -- I was indeed confused by the misalignment. thanks -- PMM