[PATCH v6 1/3] target/riscv: Add functions for common matching conditions of trigger

2024-06-26 Thread alvinga--- via
From: Alvin Chang via According to RISC-V Debug specification version 0.13 [1] (also applied to version 1.0 [2] but it has not been ratified yet), there are several common matching conditions before firing a trigger, including the enabled privilege levels of the trigger. This commit adds

[PATCH v6 3/3] target/riscv: Apply modularized matching conditions for icount trigger

2024-06-26 Thread alvinga--- via
From: Alvin Chang via We have implemented trigger_common_match(), which checks if the enabled privilege levels of the trigger match CPU's current privilege level. We can invoke trigger_common_match() to check the privilege levels of the type 3 triggers. Signed-off-by: Alvin Chang Acked-by:

[PATCH v6 2/3] target/riscv: Apply modularized matching conditions for watchpoint

2024-06-26 Thread alvinga--- via
From: Alvin Chang via We have implemented trigger_common_match(), which checks if the enabled privilege levels of the trigger match CPU's current privilege level. Remove the related code in riscv_cpu_debug_check_watchpoint() and invoke trigger_common_match() to check the privilege levels of the

[PATCH v6 0/3] RISC-V: Modularize common match conditions for trigger

2024-06-26 Thread alvinga--- via
From: Alvin Chang According to RISC-V Debug specification ratified version 0.13 [1] (also applied to version 1.0 [2] but it has not been ratified yet), the enabled privilege levels of the trigger is common match conditions for all the types of the trigger. This series modularize the code for