diff options
author | Sami Mujawar <sami.mujawar@arm.com> | 2024-08-02 03:44:30 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-08-02 10:24:26 +0000 |
commit | f203a6db92eedf03ac544ed270404cb29d3dea7f (patch) | |
tree | 46d04ae0c5ec84fe065a93bdcfd065f07dee92d7 /OvmfPkg | |
parent | 24a375fcdd26ce5a36bde69b92f638420fddf9c8 (diff) | |
download | edk2-f203a6db92eedf03ac544ed270404cb29d3dea7f.zip edk2-f203a6db92eedf03ac544ed270404cb29d3dea7f.tar.gz edk2-f203a6db92eedf03ac544ed270404cb29d3dea7f.tar.bz2 |
OvmfPkg: Pass correct virtio-scsi request size
The patch at "1fc55a3933b0 OvmfPkg: Use heap memory
for virtio-scsi request" modified the virtio-scsi
request header memory to be allocated from the heap.
In doing so the request structure header which was
a local variable on the stack was converted to be a
pointer. This required adjusting the size computation
for the request header to reflect that the structure
was changed to a pointer.
Unfortunately, this was missed out in the call to
VirtioAppendDesc() for enqueuing the request due to
which only 8 bytes were being shared with the host
instead of the size of the VIRTIO_SCSI_REQ structure
which is 51 bytes.
This resulted in the following error message to
be printed by qemu: "qemu-system-<arch>: wrong size
for virtio-scsi headers" and the virtio-scsi
functionality degraded.
Therefore, pass the correct size of the virtio-scsi
request header when enqueuing the request.
Reported-by: Aithal Srikanth <sraithal@amd.com>
Tested-by: Aithal Srikanth <sraithal@amd.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'OvmfPkg')
-rw-r--r-- | OvmfPkg/VirtioScsiDxe/VirtioScsi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c index 11e4d87..ac8c576 100644 --- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c +++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c @@ -610,7 +610,7 @@ VirtioScsiPassThru ( VirtioAppendDesc (
&Dev->Ring,
RequestDeviceAddress,
- sizeof Request,
+ sizeof (*Request),
VRING_DESC_F_NEXT,
&Indices
);
|