On 28 December 2011 01:24, Mark Langsdorf <mark.langsd...@calxeda.com> wrote: > + case 0x104: > + /* aux_ctrl values affect cache_type values */ > + s->aux_ctrl = value; > + cache_data = (value & (7 << 17)) >> 15; > + cache_data |= (value & (1 << 16)) >> 16; > + s->cache_type |= (cache_data << 18) | (cache_data << 6); > + break;
If you do this this way round, then cache_type is no longer constant, and you need to reset it in reset and save/load it in the vmstate. It's probably simpler to fill in the bits from aux_ctrl when cache_type is read rather than when aux_ctrl is written. (It seems pretty safe to assume neither happens very frequently.) -- PMM