summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/118/peripherals/2462
blob: 4acd39eb1db83a6727eddab297316c9c8a3d13f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
peripherals: 0.928
performance: 0.919
ppc: 0.897
user-level: 0.856
PID: 0.832
architecture: 0.817
graphic: 0.811
permissions: 0.753
debug: 0.737
network: 0.716
device: 0.712
arm: 0.683
semantic: 0.672
files: 0.653
hypervisor: 0.622
kernel: 0.615
assembly: 0.611
TCG: 0.601
socket: 0.584
risc-v: 0.582
x86: 0.569
vnc: 0.569
mistranslation: 0.547
register: 0.541
i386: 0.526
boot: 0.497
virtual: 0.462
VMM: 0.442
KVM: 0.421

QEMU SIFIVE reading from stdin hangs
Description of problem:
I have a simple test program (C and ASM) that reads from stdin.  When i was using the qemu provided by Ubuntu, QEMU emulator version 8.0.4 (Debian 1:8.0.4+dfsg-1ubuntu3.23.10.5), my test was working, and was able to read bytes from stdin.

Using the latest Qemu from git, breaks my test.  I can still print, but now reading hangs, like its always waiting for input but never getting it.

My guess is that this commit breaks my code:
https://github.com/qemu/qemu/commit/6ee7ba1b8a10bd8eb1d3b918eaaf9f832a51adb4

Before the above commit, `qemu_chr_fe_set_handlers` was being called, and that is what allowed the default behavior of reading from stdin is on by default?

from sifive_uart.c
```
    qemu_chr_fe_set_handlers(&s->chr, sifive_uart_can_rx, sifive_uart_rx,
                             sifive_uart_event, sifive_uart_be_change, s,
                             NULL, true);
```
Steps to reproduce:
1. compile simple C program that calls `read` reading a single byte from stdin
2. do not initialize UART options
3. run in QEMU, send input, hangs.
Additional information:
Other examples online, like riscv-probe, use a uart init function like below:
```
static void sifive_uart_init()
{
    uart = (int *)(void *)getauxval(SIFIVE_UART0_CTRL_ADDR);
    uint32_t uart_freq = getauxval(UART0_CLOCK_FREQ);
    uint32_t baud_rate = getauxval(UART0_BAUD_RATE);
    uint32_t divisor = uart_freq / baud_rate - 1;
    uart[UART_REG_DIV] = divisor;
    uart[UART_REG_TXCTRL] = UART_TXEN;
    uart[UART_REG_RXCTRL] = UART_RXEN;
    uart[UART_REG_IE] = 0;
}
```

However, when I was using QEMU 8.0.4, i did not have to write a function like above to init UART, because stdin and stdout were working out of the box.
Below is my C and ASM: