On Thu, 20 Jan 2022 08:07:27 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 18/01/2022 21:52, Glenn Washburn wrote:
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];
ucell second, minute, hour, day, month, year; uint32_t now; int current;uint8_t cmdbuf[1], obuf[64];
This looks like exactly the same issue that recently affected the CUDA reset and power-off words :(. Thanks for figuring this out and fixing this, the patch looks good to me. Assuming there are no other comments over the next few days I'll apply this to master.
Yes, I'm the one that submitted the bug report for the CUDA reset and power-off issue. I saw your patch and noticed that a similar solution would fix this get-time issue that I've been seeing. So thanks for the inspiration.
I've just done an OpenBIOS update for QEMU a few days ago so I wasn't planning another one for a little while, but I will make sure that this gets into the QEMU 7.0 release.
Thats fine, I'm thinking I'll have to be building it myself anyway since I doubt I'll see these changes in the distro package anytime soon. I believe I'm hitting other bugs too, which I'll detail in upcoming emails (one seems to be delayed due to the need for moderator approval).
Glenn