From 00259458c7b8f99dc4e08d8c0c2adfa4a39883ae Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Thu, 23 Sep 2021 12:23:22 +1000 Subject: [PATCH] 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 --- tests/misc/head.S | 30 ++++++++++++++++++++++++++++++ tests/misc/misc.c | 8 ++++++++ tests/test_misc.bin | Bin 5804 -> 5844 bytes tests/test_misc.console_out | 1 + 4 files changed, 39 insertions(+) diff --git a/tests/misc/head.S b/tests/misc/head.S index 9044c51..025f226 100644 --- a/tests/misc/head.S +++ b/tests/misc/head.S @@ -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 diff --git a/tests/misc/misc.c b/tests/misc/misc.c index 3cc0300..d5eb12e 100644 --- a/tests/misc/misc.c +++ b/tests/misc/misc.c @@ -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; } diff --git a/tests/test_misc.bin b/tests/test_misc.bin index 648ab184ab362a9a3c1ba0c554df4f1ceb96bb3e..0897d85a4404b8e19b81011c15c2d1870f58a218 100755 GIT binary patch delta 1125 zcmaizUr19?9LIlWO*duJyUpdw$h)bu(H#sjx=RO}(I2Ol1Vs-$TpfWy5A`5yuywCv z4+%YadJ&51HD(m{U{JV{pch4;sA zi$$Vq03dt_qo(ft{>S%^We4Q<%Oj9cWiT$H&SHzpWX(M%^}Cm*GpYonw!wn68#E<# z23Kux0hQYLww{k+@+(Is|5~uqIOqb+Nhin*U68sw{iK*;Y;usm=0F82tkZxUK0FlL zVI!?@H0*+6(v44W7K>)TujmQ-(&z8IiT@%^eI6Jt0JJJH6mg!6x=lB{fy0$#LWcAN zdai7T{MW0=0#xJ#G^c5MM^v}hA~~o)Vx=9U>_nY2XU=5%c?2NA+1#0Qp@dJ&IRQD2 z)6Mf77v336j`JK|``LN907j@7r`LB^M{op_5Gk!5U=KpklY%JdA!_V%-tJms92oZPXTCe{JHx(CEF_ke zx#cLo?jb6FxhAGOH>b+72wY>0Mj8o{6?aEwc^CzN()gEZB?)EuX;-;oIP55ts z4|6BTqS)gVxalmV=h7T(4By61x5zruZ}2ajBpu#f@0&KNkR#sS>a#Z5?cCIXH!W_` zLj5x>FgF1G@rP~Nx18;?6SY@S`@BVaqfPt7(Iz1xYd_ytWz?hdY8ue`eY8I72%2^w z&6we^0JX#xoBY$Lg`IX-v4v$FcD{ur99BVwLt&7b&nJS}r{K9Hn8)!Mn;}a+?SGi^ z-x3XYv4A&&3Khl^=(P41jL3BhbGGG7<;4HGt7sT<~tdrJZkeg`ue^Xu!iroQ-a}Y4C$-8^16vT z=0H-|cW$f!MC(j%Qb}R`ADxj5!R-5BoyWjB^DhM51u?tsux+3!Zip2fs9HjCOJu)y zp-5<95|}3~^N_1kDkxzohGt{-U}Hdz1^12Giyerwr2@Tp)HW&A7{K@qB4Z)6 diff --git a/tests/test_misc.console_out b/tests/test_misc.console_out index 5296101..041accf 100644 --- a/tests/test_misc.console_out +++ b/tests/test_misc.console_out @@ -4,3 +4,4 @@ Test 03:PASS Test 04:PASS Test 05:PASS Test 06:PASS +Test 07:PASS