You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/11/24 17:14:24 UTC

[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #4878: cache_invalidate: fix unalign cacheline invalidate & add cache coherence config for semihosting option

davids5 commented on a change in pull request #4878:
URL: https://github.com/apache/incubator-nuttx/pull/4878#discussion_r756284413



##########
File path: arch/arm/src/armv7-m/arm_cache.c
##########
@@ -422,7 +428,12 @@ void up_invalidate_dcache(uintptr_t start, uintptr_t end)
 
       start += ssize;
     }
-  while (start < end);
+  while (start + ssize <= end);
+
+  if (start != end)

Review comment:
       I think this is over reaching. 
   
   consider a 32 byte properly aligned buffer with a 19 byte message.
   
   The only address that should be invalidated is  2002A980 It will cover the whole cacheline sized block as show below.
   
   But this code will then invalidate 2002A9A0 which will cause issues for the next block (ie loose dirty in WB) mode
   
   start | 2002a980 | 537045376 | 2002A980
   -- | -- | -- | --
     | 1 | 537045377 | 2002A981
     | 2 | 537045378 | 2002A982
     | 3 | 537045379 | 2002A983
     | 4 | 537045380 | 2002A984
     | 5 | 537045381 | 2002A985
     | 6 | 537045382 | 2002A986
     | 7 | 537045383 | 2002A987
     | 8 | 537045384 | 2002A988
     | 9 | 537045385 | 2002A989
     | 10 | 537045386 | 2002A98A
     | 11 | 537045387 | 2002A98B
     | 12 | 537045388 | 2002A98C
     | 13 | 537045389 | 2002A98D
     | 14 | 537045390 | 2002A98E
     | 15 | 537045391 | 2002A98F
     | 16 | 537045392 | 2002A990
     | 17 | 537045393 | 2002A991
     | 18 | 537045394 | 2002A992
   end | 19 | 537045395 | 2002A993
     | 20 | 537045396 | 2002A994
     | 21 | 537045397 | 2002A995
     | 22 | 537045398 | 2002A996
     | 23 | 537045399 | 2002A997
     | 24 | 537045400 | 2002A998
     | 25 | 537045401 | 2002A999
     | 26 | 537045402 | 2002A99A
     | 27 | 537045403 | 2002A99B
     | 28 | 537045404 | 2002A99C
     | 29 | 537045405 | 2002A99D
     | 30 | 537045406 | 2002A99E
     | 31 | 537045407 | 2002A99F
   
   
   
   </body>
   
   </html>
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org