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 2/2] sbi: dbcn: Add write-byte test with more than byte given
Date: Fri, 30 Aug 2024 17:53:40 +0200	[thread overview]
Message-ID: <20240830155337.335534-6-andrew.jones@linux.dev> (raw)
In-Reply-To: <20240830155337.335534-4-andrew.jones@linux.dev>

Try the write-byte function, but with a word full of characters. We
should still get 'a' since that's in the least-significant byte.

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

diff --git a/riscv/sbi.c b/riscv/sbi.c
index 907bfbe5bb69..a1c97b93cdd0 100644
--- a/riscv/sbi.c
+++ b/riscv/sbi.c
@@ -407,12 +407,18 @@ static void check_dbcn(void)
 	report_prefix_pop();
 	report_prefix_push("write_byte");
 
-	puts("DBCN_WRITE TEST CHAR: ");
+	puts("DBCN_WRITE_BYTE TEST BYTE: ");
 	ret = sbi_dbcn_write_byte(DBCN_WRITE_BYTE_TEST_BYTE);
 	puts("\n");
 	report(ret.error == SBI_SUCCESS, "write success (error=%ld)", ret.error);
 	report(ret.value == 0, "expected ret.value (%ld)", ret.value);
 
+	puts("DBCN_WRITE_BYTE TEST WORD: "); /* still expect 'a' in the output */
+	ret = sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_WRITE_BYTE, 0x64636261, 0, 0, 0, 0, 0);
+	puts("\n");
+	report(ret.error == SBI_SUCCESS, "write success (error=%ld)", ret.error);
+	report(ret.value == 0, "expected ret.value (%ld)", ret.value);
+
 	report_prefix_pop();
 	report_prefix_pop();
 }
-- 
2.45.2


  parent reply	other threads:[~2024-08-30 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-30 15:53 [kvm-unit-tests PATCH 0/2] riscv: sbi: Rename sbi ecall wrappers Andrew Jones
2024-08-30 15:53 ` [kvm-unit-tests PATCH 1/2] sbi: Rename __*_sbi_ecall to sbi_* Andrew Jones
2024-08-30 15:53 ` Andrew Jones [this message]
2024-09-03 13:58 ` [kvm-unit-tests PATCH 0/2] riscv: sbi: Rename sbi ecall wrappers 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=20240830155337.335534-6-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