summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2021-09-19 11:05:12 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2021-10-30 19:50:43 +0100
commitb9062deaaea7269369eaa46260d75edcaf276afa (patch)
treeb24f3cc864f27693a7f5249b6a144f2b76e1fc68
parentd657b653186c0fd6e062cab133497415c2a5a5b8 (diff)
downloadqemu-openbios-b9062deaaea7269369eaa46260d75edcaf276afa.tar.gz
cuda: fix reset-all and power-off words
There is a long-standing bug in the CUDA implementation of the reset-all and power-off words whereby an extra byte is written after the CUDA_RESET_SYSTEM and CUDA_POWERDOWN commands. This extra byte used to be ignored in QEMU until commits 017da0b568 ("cuda: port POWERDOWN command to new framework") and 54e894442e ("cuda: port RESET_SYSTEM command to new framework") added a check which rejects the command if the command length is incorrect. Fix the outgoing command length to remove the extra byte which allows the reset-all and power-off words to work in QEMU once again. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org> Fixes: https://gitlab.com/qemu-project/qemu/-/issues/624
-rw-r--r--drivers/cuda.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cuda.c b/drivers/cuda.c
index 56d73e12..c89b174f 100644
--- a/drivers/cuda.c
+++ b/drivers/cuda.c
@@ -177,7 +177,7 @@ static cuda_t *main_cuda;
static void
ppc32_reset_all(void)
{
- uint8_t cmdbuf[2], obuf[64];
+ uint8_t cmdbuf[1], obuf[64];
cmdbuf[0] = CUDA_RESET_SYSTEM;
cuda_request(main_cuda, CUDA_PACKET, cmdbuf, sizeof(cmdbuf), obuf);
@@ -186,7 +186,7 @@ ppc32_reset_all(void)
static void
ppc32_poweroff(void)
{
- uint8_t cmdbuf[2], obuf[64];
+ uint8_t cmdbuf[1], obuf[64];
cmdbuf[0] = CUDA_POWERDOWN;
cuda_request(main_cuda, CUDA_PACKET, cmdbuf, sizeof(cmdbuf), obuf);