qtest/am53c974-test: add additional test for cmdfifo overflow
Based upon the qtest reproducer posted to Gitlab issue #3082 at https://gitlab.com/qemu-project/qemu/-/issues/3082. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Link: https://lore.kernel.org/r/20250925122846.527615-3-mark.cave-ayland@ilande.co.uk Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
36ec1a829a
commit
e9d02b5931
1 changed files with 40 additions and 0 deletions
|
|
@ -109,6 +109,44 @@ static void test_cmdfifo_overflow2_ok(void)
|
|||
qtest_quit(s);
|
||||
}
|
||||
|
||||
/* Reported as https://issues.oss-fuzz.com/issues/439878564 */
|
||||
static void test_cmdfifo_overflow3_ok(void)
|
||||
{
|
||||
QTestState *s = qtest_init(
|
||||
"-device am53c974,id=scsi -device scsi-hd,drive=disk0 "
|
||||
"-drive id=disk0,if=none,file=null-co://,format=raw -nodefaults");
|
||||
qtest_outl(s, 0xcf8, 0x80001010);
|
||||
qtest_outl(s, 0xcfc, 0xc000);
|
||||
qtest_outl(s, 0xcf8, 0x80001004);
|
||||
qtest_outw(s, 0xcfc, 0x01);
|
||||
qtest_outb(s, 0xc00c, 0x43);
|
||||
qtest_outl(s, 0xc00b, 0x9100);
|
||||
qtest_outl(s, 0xc009, 0x02000000);
|
||||
qtest_outl(s, 0xc000, 0x0b);
|
||||
qtest_outl(s, 0xc00b, 0x00);
|
||||
qtest_outl(s, 0xc00b, 0x00);
|
||||
qtest_outl(s, 0xc00b, 0xc200);
|
||||
qtest_outl(s, 0xc00b, 0x1000);
|
||||
qtest_outl(s, 0xc00b, 0x9000);
|
||||
qtest_outb(s, 0xc008, 0x00);
|
||||
qtest_outb(s, 0xc008, 0x00);
|
||||
qtest_outl(s, 0xc03f, 0x0300);
|
||||
qtest_outl(s, 0xc00b, 0x00);
|
||||
qtest_outw(s, 0xc00b, 0x4200);
|
||||
qtest_outl(s, 0xc00b, 0x00);
|
||||
qtest_outw(s, 0xc00b, 0x1200);
|
||||
qtest_outl(s, 0xc00b, 0x00);
|
||||
qtest_outb(s, 0xc00c, 0x43);
|
||||
qtest_outl(s, 0xc00b, 0x00);
|
||||
qtest_outl(s, 0xc00b, 0x00);
|
||||
qtest_outl(s, 0xc007, 0x00);
|
||||
qtest_outl(s, 0xc007, 0x00);
|
||||
qtest_outl(s, 0xc007, 0x00);
|
||||
qtest_outl(s, 0xc00b, 0x1000);
|
||||
qtest_outl(s, 0xc007, 0x00);
|
||||
qtest_quit(s);
|
||||
}
|
||||
|
||||
/* Reported as crash_0900379669 */
|
||||
static void test_fifo_pop_buf(void)
|
||||
{
|
||||
|
|
@ -266,6 +304,8 @@ int main(int argc, char **argv)
|
|||
test_cmdfifo_overflow_ok);
|
||||
qtest_add_func("am53c974/test_cmdfifo_overflow2_ok",
|
||||
test_cmdfifo_overflow2_ok);
|
||||
qtest_add_func("am53c974/test_cmdfifo_overflow3_ok",
|
||||
test_cmdfifo_overflow3_ok);
|
||||
qtest_add_func("am53c974/test_fifo_pop_buf",
|
||||
test_fifo_pop_buf);
|
||||
qtest_add_func("am53c974/test_target_selected_ok",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue