An extra byte is written after the CUDA_GET_TIME command causing the command to return an incorrect time. Running QEMU with CUDA debug messages on yields these messages:
1177318@1642469573.070752:cuda_packet_receive length 3 1177318@1642469573.070768:cuda_packet_receive_data [0] 0x01 1177318@1642469573.070771:cuda_packet_receive_data [1] 0x03 1177318@1642469573.070773:cuda_packet_receive_data [2] 0xfb 1177318@1642469573.070776:cuda_receive_packet_cmd handling command GET_TIME CUDA: GET_TIME: wrong parameters 2
Fix the outgoing command length to remove the extra byte.
Signed-off-by: Glenn Washburn development@efficientek.com --- drivers/cuda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cuda.c b/drivers/cuda.c index c89b174..86d2ddb 100644 --- a/drivers/cuda.c +++ b/drivers/cuda.c @@ -234,7 +234,7 @@ static inline int is_leap(int year) static void rtc_get_time(int *idx) { - uint8_t cmdbuf[2], obuf[64]; + uint8_t cmdbuf[1], obuf[64]; ucell second, minute, hour, day, month, year; uint32_t now; int current;