From 88c87f0af4bded7b1892bd68a6d59ed583d65641 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Thu, 8 Aug 2019 12:18:22 +0530 Subject: [PATCH] lib: Use sbi_dprintf() for invalid CSRs We should sbi_dprintf() instead of sbi_printf() for invalid CSRs because we are forwarding invalid CSR access back to S-mode. Signed-off-by: Anup Patel Reviewed-by: Bin Meng --- lib/sbi/sbi_emulate_csr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/sbi/sbi_emulate_csr.c b/lib/sbi/sbi_emulate_csr.c index 5d6819e..791890f 100644 --- a/lib/sbi/sbi_emulate_csr.c +++ b/lib/sbi/sbi_emulate_csr.c @@ -83,8 +83,8 @@ int sbi_emulate_csr_read(int csr_num, u32 hartid, ulong mstatus, *csr_val = csr_read(CSR_MHPMEVENT4); break; default: - sbi_printf("%s: hartid%d: invalid csr_num=0x%x\n", __func__, - hartid, csr_num); + sbi_dprintf(scratch, "%s: hartid%d: invalid csr_num=0x%x\n", + __func__, hartid, csr_num); return SBI_ENOTSUPP; }; @@ -128,8 +128,8 @@ int sbi_emulate_csr_write(int csr_num, u32 hartid, ulong mstatus, csr_write(CSR_MHPMEVENT4, csr_val); break; default: - sbi_printf("%s: hartid%d: invalid csr_num=0x%x\n", __func__, - hartid, csr_num); + sbi_dprintf(scratch, "%s: hartid%d: invalid csr_num=0x%x\n", + __func__, hartid, csr_num); return SBI_ENOTSUPP; };