git: 0af5a0cd2788 - main - Hyper-V: storvsc: relax a kassert check
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 07 Sep 2022 15:17:39 UTC
The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=0af5a0cd2788efce9f444f4f781357d317bb0bb1 commit 0af5a0cd2788efce9f444f4f781357d317bb0bb1 Author: Wei Hu <whu@FreeBSD.org> AuthorDate: 2022-09-07 15:06:54 +0000 Commit: Wei Hu <whu@FreeBSD.org> CommitDate: 2022-09-07 15:06:54 +0000 Hyper-V: storvsc: relax a kassert check On ARM64 this kassert check could cause unnecessary panic. Sponsored by: Microsoft --- sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c index 4c9869887db6..d12d6a5982f6 100644 --- a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c +++ b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c @@ -1831,13 +1831,16 @@ storvsc_xferbuf_prepare(void *arg, bus_dma_segment_t *segs, int nsegs, int error for (i = 0; i < nsegs; i++) { #ifdef INVARIANTS if (nsegs > 1) { +#if defined(__amd64__) if (i == 0) { KASSERT((segs[i].ds_addr & PAGE_MASK) + segs[i].ds_len == PAGE_SIZE, ("invalid 1st page, ofs 0x%jx, len %zu", (uintmax_t)segs[i].ds_addr, segs[i].ds_len)); - } else if (i == nsegs - 1) { + } else +#endif + if (i == nsegs - 1) { KASSERT((segs[i].ds_addr & PAGE_MASK) == 0, ("invalid last page, ofs 0x%jx", (uintmax_t)segs[i].ds_addr));