大家好,我自己开发基于cortex-a7 4核的SMP模式OS。采用短描述符(Short-descriptor format memory region attributes)配置现某段内存,其TLB表项的Memory region attributes配置为: -----------+-----+----+|TEX[2:0] | C | B |+-----------+-----+----+| 1 0 1 | 0 | 1 |+-----------+-----+----+意思是: Inner Write-Back Write Allocate, Outer Write-Back Write Allocate, Shareability determined by [S] bit
上述配置在多cpu工作时出现问题,例如,cpu3对变量进行修改,在cpu1访问该变量时却发现变量的值没有改变只有将TLB表项配置为:Inner Write-Through, Outer Write-Back Write Allocate -----------+-----+----+|TEX[2:0] | C | B |+-----------+-----+----+| 1 1 0 | 1 | 0 |+-----------+-----+----+才工作正常,后来发现需要配置内部写直通模式(Inner Write-Through)才可以,要么在cpu1访问有关变量时,执行cache invalidate希望专家解答
谢谢回答,事实上,这两种情况已经设置TLB表项的S位,也设置了ACTLR(Auxiliary Control Register)的SMP位,cpu已经配置在SMP模式,我的问题是:一个cpu修改的内存变量,不是应该由硬件Snoop Control Unit解决cache一致性的问题吗?(Cortex-A7 MPCore processor supports between one and four individual processors with L1 data cache coherency maintained by the SCU)
如果只能TLB配置成写直通模式,或者是invalidate,不是性能很差吗?
那你在修改完了数据,加一条DSB指令广播一下