On 17 March 2014 03:05, Peter Crosthwaite <peter.crosthwaite@xxxxxxxxxx> wrote: > On Fri, Mar 7, 2014 at 5:32 AM, Peter Maydell <peter.maydell@xxxxxxxxxx> wrote: >> For exceptions taken to AArch64, if a coprocessor/system register >> access fails due to a trap or enable bit then the syndrome information >> must include details of the failing instruction (crn/crm/opc1/opc2 >> fields, etc). Make the decoder construct the syndrome information >> at translate time so it can be passed at runtime to the access-check >> helper function and used as required. > Can we space out the constants to a consistent tab stop for readability? Sure. >> -void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip) >> +void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip, uint32_t syndrome) >> { >> const ARMCPRegInfo *ri = rip; >> switch (ri->accessfn(env, ri)) { >> case CP_ACCESS_OK: >> return; >> case CP_ACCESS_TRAP: >> + env->exception.syndrome = syndrome; > > Can TCG just deposit this directly and unconditionally straight to the > env to avoid the extra syndrome arg? Hmm. I think in theory that would be possible, but it seems to me that it would be pretty confusing if exception.syndrome could be set for anything other than "we're going to take an exception and this is it". Passing the syndrome as a function argument (probably in a register) seems better than always doing a store to memory, as well. Or am I missing something that would make it slower? thanks -- PMM _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm