Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Andrew Jones <andrew.jones@linux.dev>
To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org
Cc: atishp@rivosinc.com, cade.richard@berkeley.edu, jamestiotio@gmail.com
Subject: [kvm-unit-tests PATCH 1/4] riscv: sbi: dbcn: Output return values
Date: Mon, 12 Aug 2024 16:13:56 +0200	[thread overview]
Message-ID: <20240812141354.119889-7-andrew.jones@linux.dev> (raw)
In-Reply-To: <20240812141354.119889-6-andrew.jones@linux.dev>

When a test fails its nice to be able to see exactly what error code
it failed with in order to immediately start debug.

Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
---
 riscv/sbi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/riscv/sbi.c b/riscv/sbi.c
index 93a79d8095f5..2393929b965d 100644
--- a/riscv/sbi.c
+++ b/riscv/sbi.c
@@ -299,7 +299,7 @@ static void check_dbcn(void)
 		num_calls++;
 	} while (num_bytes != 0 && ret.error == SBI_SUCCESS);
 
-	report(ret.error == SBI_SUCCESS, "write success");
+	report(ret.error == SBI_SUCCESS, "write success (error=%ld)", ret.error);
 	report_info("%d sbi calls made", num_calls);
 
 	/* Bytes are read from memory and written to the console */
@@ -307,7 +307,7 @@ static void check_dbcn(void)
 		paddr = strtoull(getenv("INVALID_ADDR"), NULL, 0);
 		split_phys_addr(paddr, &base_addr_hi, &base_addr_lo);
 		ret = __dbcn_sbi_ecall(SBI_EXT_DBCN_CONSOLE_WRITE, 1, base_addr_lo, base_addr_hi);
-		report(ret.error == SBI_ERR_INVALID_PARAM, "invalid parameter: address");
+		report(ret.error == SBI_ERR_INVALID_PARAM, "invalid parameter: address (error=%ld)", ret.error);
 	}
 
 	report_prefix_pop();
@@ -317,8 +317,8 @@ static void check_dbcn(void)
 	puts("DBCN_WRITE TEST CHAR: ");
 	ret = __dbcn_sbi_ecall(SBI_EXT_DBCN_CONSOLE_WRITE_BYTE, (u8)DBCN_WRITE_BYTE_TEST_BYTE, 0, 0);
 	puts("\n");
-	report(ret.error == SBI_SUCCESS, "write success");
-	report(ret.value == 0, "expected ret.value");
+	report(ret.error == SBI_SUCCESS, "write success (error=%ld)", ret.error);
+	report(ret.value == 0, "expected ret.value (%ld)", ret.value);
 
 	report_prefix_pop();
 }
-- 
2.45.2


  reply	other threads:[~2024-08-12 14:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12 14:13 [kvm-unit-tests PATCH 0/4] riscv: sbi: More DBCN tests Andrew Jones
2024-08-12 14:13 ` Andrew Jones [this message]
2024-08-12 14:13 ` [kvm-unit-tests PATCH 2/4] riscv: sbi: Use strtoul to avoid overflow Andrew Jones
2024-08-12 14:13 ` [kvm-unit-tests PATCH 3/4] riscv: sbi: Prefix several environment variables with SBI Andrew Jones
2024-08-12 14:13 ` [kvm-unit-tests PATCH 4/4] riscv: sbi: dbcn: Add high address tests Andrew Jones
2024-08-12 14:18 ` [kvm-unit-tests PATCH 0/4] riscv: sbi: More DBCN tests Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240812141354.119889-7-andrew.jones@linux.dev \
    --to=andrew.jones@linux.dev \
    --cc=atishp@rivosinc.com \
    --cc=cade.richard@berkeley.edu \
    --cc=jamestiotio@gmail.com \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox