xiaoxiang781216 commented on code in PR #15461:
URL: https://github.com/apache/nuttx/pull/15461#discussion_r1909403906


##########
mm/kasan/hook.c:
##########
@@ -123,6 +125,8 @@ static uint32_t g_region_init;
  * Private Functions
  ****************************************************************************/
 
+#ifndef CONFIG_MM_KASAN_MTE_TAGS

Review Comment:
   why need empty kasan_show_memory in MTE case



##########
mm/kasan/mte_tags.c:
##########
@@ -0,0 +1,97 @@
+/****************************************************************************
+ * mm/kasan/mte_tags.c

Review Comment:
   why not move the implentation to arch/arm64? like the custom heap manager 
for sim



##########
mm/kasan/hook.c:
##########
@@ -252,6 +256,10 @@ static inline void kasan_check_report(FAR const void 
*addr, size_t size,
 #  endif
 #endif
 }
+#else
+#define kasan_check_report(addr, size, is_write, return_address)
+#define kasan_report(addr, size, is_write, return_address)

Review Comment:
   ```
   #  define kasan_check_report(addr, size, is_write, return_address)
   #  define kasan_report(addr, size, is_write, return_address)
   ```



##########
include/nuttx/mm/kasan.h:
##########
@@ -201,6 +203,23 @@ void kasan_stop(void);
 
 int kasan_debugpoint(int type, FAR void *addr, size_t size);
 
+#ifndef CONFIG_MM_KASAN_MTE_TAGS
+#  define kasan_hw_open()

Review Comment:
   why add hw_ 



##########
mm/mm_heap/mm_free.c:
##########
@@ -49,6 +49,8 @@ static void add_delaylist(FAR struct mm_heap_s *heap, FAR 
void *mem)
 
   /* Delay the deallocation until a more appropriate time. */
 
+  kasan_hw_close();
+
   flags = up_irq_save();

Review Comment:
   let's extract mm_lock_irq/mm_unlock_irq



##########
include/nuttx/mm/kasan.h:
##########
@@ -201,6 +203,23 @@ void kasan_stop(void);
 
 int kasan_debugpoint(int type, FAR void *addr, size_t size);
 
+#ifndef CONFIG_MM_KASAN_MTE_TAGS
+#  define kasan_hw_open()
+#  define kasan_hw_close()
+#else
+/****************************************************************************
+ * Name: kasan_hw_open
+ ****************************************************************************/
+
+void kasan_hw_open(void);

Review Comment:
   kasaon_bypass(bool bypass);



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to