tests/misc: Add an icbi test

We have a bug where an icbi can cause an instruction to execute twice.
Add a test case for this.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
icbi-issue
Anton Blanchard 3 years ago committed by Anton Blanchard
parent 13439c76ba
commit 00259458c7

@ -185,3 +185,33 @@ test_loadhitstore:
or %r7,%r6,%r7
subf %r3,%r0,%r7
blr

/* Test for double execution of addi */
.balign 64
.global test_icbi
test_icbi:
1: li %r3,0
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
icbi 0,%r0
nop
nop
nop
nop
nop
nop
nop
nop
addi %r3,%r3,1
blr

@ -16,6 +16,7 @@ extern long test_mfpvr(void);
extern long test_mtpvr(void);
extern long test_bdnzl(void);
extern long test_loadhitstore(void);
extern long test_icbi(void);

// i < 100
void print_test_number(int i)
@ -74,5 +75,12 @@ int main(void)
} else
puts(PASS);

print_test_number(7);
if (test_icbi() != 1) {
fail = 1;
puts(FAIL);
} else
puts(PASS);

return fail;
}

Binary file not shown.

@ -4,3 +4,4 @@ Test 03:PASS
Test 04:PASS
Test 05:PASS
Test 06:PASS
Test 07:PASS

Loading…
Cancel
Save