Summary: | mpt(4): VMWare virtualized LSI controller panics during hot-attach | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Allan Jude <allanjude> | ||||
Component: | kern | Assignee: | freebsd-virtualization (Nobody) <virtualization> | ||||
Status: | In Progress --- | ||||||
Severity: | Affects Many People | CC: | cem, jpaetzel, markj | ||||
Priority: | --- | Keywords: | crash, needs-qa | ||||
Version: | 11.3-RELEASE | Flags: | koobs:
mfc-stable12?
koobs: mfc-stable11? |
||||
Hardware: | amd64 | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Allan Jude
2020-06-12 14:34:36 UTC
Looks like mpt_dma_buf_free() doesn't handle this particular failure mode properly. Created attachment 215490 [details]
proposed patch
Could you try this patch? It'll still be necessary to figure out why the memory allocation is failing, but hopefully it won't panic anymore.
mpt_dma_mem_free() has the same problem for now.
@Allan have you had a chance to test this? For a baseline I tried: root@freebsd13:/home/jpaetzel # uname -a FreeBSD freebsd13.demosp.com 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r364438: Fri Aug 21 09:29:22 PDT 2020 jpaetzel@freebsd13.demosp.com:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 I hot added an MPT controller to the system and didn't get a panic. What version of FreeBSD were you using that got the panic? Ok, so I see the reason I couldn't reproduce the panic is this patch has already been committed to HEAD. So I think that's verification that the patch works. (In reply to Josh Paetzel from comment #5) It was not committed as far as I know. The patch fixes bugs in the controller detach path. That is, the driver fails to attach for some reason (which you don't seem to hit), and panics when cleaning up. I see said the blind man as he pissed into the wind, it's all coming back to me now. I had built the kernel with the patch, but tried to reproduce on the original kernel. I couldn't reproduce the issue, then looked at your patch and my sources (which already had the patch applied) and came to he conclusion that I couldn't reproduce the issue because I was testing the fix. To be clear, I was testing stock FreeBSD HEAD WITHOUT the patch and could not reproduce the problem. |