Re: bootwrapper: Turn on CCI snoops when CCI exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2012-09-05 at 16:32 +0800, Guodong Xu wrote:
> Hi, all
> 
> This patch is about adding codes to turn on CCI compatible with all platforms, A15 
> x4, and big.LITTLE, etc. 
> 
> With this patch, a Secure vector table is installed, with which the
> data abort for accessing CCI on boards where it doesn't exist can be
> captured and handled.   

Rather than always ignoring data aborts, it might be nice to have a
separate function to try and read an address and have the data abort
handler, check for that function explicitly. Then if the abort was
caused by a different instruction do something (like execute an invalid
instruction) so that the data abort gets noticed rather than ignored.
E.g.

	@
	@ Turn on CCI snoops
	@
	ldr	r4, =0x2c090000
	add	r0, r4, #0xc          @ status reg
	bl	try_read
	bne	no_cci	
	...
no_cci:
	...

try_read:
	mov	r12, #0
try_read_may_fault:
	ldr	r0, [r0]
	cmp	r12, #0
	bx	lr

@ data abort handling

	ldr	r12, =try_read_may_fault+8
	cmp	lr, r12     @ if faulting instruction is try_read_may_fault
	subeqs	pc, lr, #4  @ then skip it, returning non-zero r12 value
	@ put some instruction here which is architecturally defined as
	@ invalid, or is there something fast model specific we can use
	@ to get better diagnostics?

> There are open issues with the code, somebody can clarify:
> 1. Is the default secure vector table being used in other palce? I 
>         didn't find. But if yes, I should restore secure vector table.
> 2. When return from data abort exception, I added two 'nop' instruction.
>         Without them, the instruction 'cmp r4, #0xba' seems not function  
>         correctly. That's really tricky.  
> 	- I tried to use exception return instruction 'subs pc, lr, #8'. It doesn't help.

"subs pc, lr, #8" would return to the instruction which faulted which
would go a bit wrong as it would use the new r4 value to read from
memory again.

"subs pc, lr, #4" is what you need to return to the instruction after
the faulting ldr instruction.

-- 
Tixy

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm


[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux