see possible solution, in #if 0 is original code in #else see possible fix
static uint64_t icc_pmr_read(CPUARMState *env, const ARMCPRegInfo *ri)
....
#if 0 // KIURCHER: bug - shall be opposite; see ARM specification
if (value & 0x80) {
/* Secure priorities not visible to NS */
value = 0;
} else if (value != 0xff) {
value = (value << 1) & 0xff;
}
#else
if (value & 0x80) {
value = (value << 1) & 0xff;
} else {
value = 0;
}
#endif
....
static void icc_pmr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)
....
#if 0 //KIURCHER: bug
if (arm_feature(env, ARM_FEATURE_EL3) && !arm_is_secure(env) && (env->cp15.scr_el3 & SCR_FIQ)) {
/* NS access and Group 0 is inaccessible to NS: return the
* NS view of the current priority
*/
if (!(cs->icc_pmr_el1 & 0x80)) {
/* Current PMR in the secure range, don't allow NS to change it */
return;
}
value = (value >> 1) & 0x80;
}
#else
if (arm_feature(env, ARM_FEATURE_EL3) && !arm_is_secure(env) && (env->cp15.scr_el3 & SCR_FIQ)) {
/* NS access and Group 0 is inaccessible to NS: return the
* NS view of the current priority
*/
if (!(cs->icc_pmr_el1 & 0x80)) {
/* Current PMR in the secure range, don't allow NS to change it */
return;
}
value = (value >> 1) | 0x80;
}
#endif
see possible solution, in #if 0 is original code in #else see possible fix
static uint64_t icc_pmr_ read(CPUARMStat e *env, const ARMCPRegInfo *ri)
....
#if 0 // KIURCHER: bug - shall be opposite; see ARM specification
if (value & 0x80) {
/* Secure priorities not visible to NS */
value = 0;
} else if (value != 0xff) {
value = (value << 1) & 0xff;
}
#else
if (value & 0x80) {
value = (value << 1) & 0xff;
} else {
value = 0;
}
#endif
....
static void icc_pmr_ write(CPUARMSta te *env, const ARMCPRegInfo *ri,
uint64_ t value)
(env-> cp15.scr_ el3 & SCR_FIQ)) {
(env-> cp15.scr_ el3 & SCR_FIQ)) {
....
#if 0 //KIURCHER: bug
if (arm_feature(env, ARM_FEATURE_EL3) && !arm_is_secure(env) &&
/* NS access and Group 0 is inaccessible to NS: return the
* NS view of the current priority
*/
if (!(cs->icc_pmr_el1 & 0x80)) {
/* Current PMR in the secure range, don't allow NS to change it */
return;
}
value = (value >> 1) & 0x80;
}
#else
if (arm_feature(env, ARM_FEATURE_EL3) && !arm_is_secure(env) &&
/* NS access and Group 0 is inaccessible to NS: return the
* NS view of the current priority
*/
if (!(cs->icc_pmr_el1 & 0x80)) {
/* Current PMR in the secure range, don't allow NS to change it */
return;
}
value = (value >> 1) | 0x80;
}
#endif