FreeBSD Bugzilla – Attachment 234217 Details for
Bug 264177
bhyve: Guest can cause a crash in bhyve nvme emulation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Check existance of previous IOV before concatenating
bz264177-00.patch (text/plain), 1001 bytes, created by
Chuck Tuffli
on 2022-05-25 23:01:00 UTC
(
hide
)
Description:
Check existance of previous IOV before concatenating
Filename:
MIME Type:
Creator:
Chuck Tuffli
Created:
2022-05-25 23:01:00 UTC
Size:
1001 bytes
patch
obsolete
>diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c >index 098f0aba1084..a86339202249 100644 >--- a/usr.sbin/bhyve/pci_nvme.c >+++ b/usr.sbin/bhyve/pci_nvme.c >@@ -2171,6 +2171,7 @@ pci_nvme_append_iov_req(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req, > uint64_t gpaddr, size_t size, int do_write, uint64_t lba) > { > int iovidx; >+ bool can_concatenate = false; > > if (req == NULL) > return (-1); >@@ -2179,8 +2180,14 @@ pci_nvme_append_iov_req(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req, > return (-1); > } > >- /* concatenate contig block-iovs to minimize number of iovs */ >- if ((req->prev_gpaddr + req->prev_size) == gpaddr) { >+ /* >+ * Minimize the number of IOVs by concatenating contiguous address >+ * ranges. Skip if there is no previous range. >+ */ >+ if (req->io_req.br_iovcnt > 0) >+ can_concatenate = (req->prev_gpaddr + req->prev_size) == gpaddr; >+ >+ if (can_concatenate) { > iovidx = req->io_req.br_iovcnt - 1; > > req->io_req.br_iov[iovidx].iov_base =
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 264177
: 234217