debug.c (df50424b4dcfde823047d3717abd6a61224ea205) debug.c (0099f6053410f5611796213b723e908cfc8055eb)
1/*
2 * QEMU RISC-V Native Debug Support
3 *
4 * Copyright (c) 2022 Wind River Systems, Inc.
5 *
6 * Author:
7 * Bin Meng <bin.meng@windriver.com>
8 *

--- 784 unchanged lines hidden (view full) ---

793 }
794
795 ctrl = env->tdata1[i];
796 pc = env->tdata2[i];
797
798 if ((ctrl & TYPE2_EXEC) && (bp->pc == pc)) {
799 /* check U/S/M bit against current privilege level */
800 if ((ctrl >> 3) & BIT(env->priv)) {
1/*
2 * QEMU RISC-V Native Debug Support
3 *
4 * Copyright (c) 2022 Wind River Systems, Inc.
5 *
6 * Author:
7 * Bin Meng <bin.meng@windriver.com>
8 *

--- 784 unchanged lines hidden (view full) ---

793 }
794
795 ctrl = env->tdata1[i];
796 pc = env->tdata2[i];
797
798 if ((ctrl & TYPE2_EXEC) && (bp->pc == pc)) {
799 /* check U/S/M bit against current privilege level */
800 if ((ctrl >> 3) & BIT(env->priv)) {
801 env->badaddr = pc;
801 return true;
802 }
803 }
804 break;
805 case TRIGGER_TYPE_AD_MATCH6:
806 ctrl = env->tdata1[i];
807 pc = env->tdata2[i];
808
809 if ((ctrl & TYPE6_EXEC) && (bp->pc == pc)) {
810 if (env->virt_enabled) {
811 /* check VU/VS bit against current privilege level */
812 if ((ctrl >> 23) & BIT(env->priv)) {
802 return true;
803 }
804 }
805 break;
806 case TRIGGER_TYPE_AD_MATCH6:
807 ctrl = env->tdata1[i];
808 pc = env->tdata2[i];
809
810 if ((ctrl & TYPE6_EXEC) && (bp->pc == pc)) {
811 if (env->virt_enabled) {
812 /* check VU/VS bit against current privilege level */
813 if ((ctrl >> 23) & BIT(env->priv)) {
814 env->badaddr = pc;
813 return true;
814 }
815 } else {
816 /* check U/S/M bit against current privilege level */
817 if ((ctrl >> 3) & BIT(env->priv)) {
815 return true;
816 }
817 } else {
818 /* check U/S/M bit against current privilege level */
819 if ((ctrl >> 3) & BIT(env->priv)) {
820 env->badaddr = pc;
818 return true;
819 }
820 }
821 }
822 break;
823 default:
824 /* other trigger types are not supported or irrelevant */
825 break;

--- 120 unchanged lines hidden ---
821 return true;
822 }
823 }
824 }
825 break;
826 default:
827 /* other trigger types are not supported or irrelevant */
828 break;

--- 120 unchanged lines hidden ---