[RFC PATCH v4 3/7] target/riscv: add sdext Debug Mode helpers