Print this page
8622 panic in PTE_set_all()
8623 IMMU_CONTIG_PADDR is broken for cookies with more than one page
8625 nvme causes bad free panic in IOMMU
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/rootnex.c
          +++ new/usr/src/uts/i86pc/io/rootnex.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  /*
  25   25   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  26   26   * Copyright (c) 2011 Bayard G. Bell.  All rights reserved.
  27   27   * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
       28 + * Copyright 2017 Joyent, Inc.
  28   29   */
  29   30  
  30   31  /*
  31   32   * x86 root nexus driver
  32   33   */
  33   34  
  34   35  #include <sys/sysmacros.h>
  35   36  #include <sys/conf.h>
  36   37  #include <sys/autoconf.h>
  37   38  #include <sys/sysmacros.h>
↓ open down ↓ 2291 lines elided ↑ open up ↑
2329 2330          }
2330 2331  
2331 2332          /*
2332 2333           * cleanup and copy buffer or window state. if we didn't use the copy
2333 2334           * buffer or windows, there won't be much to do :-)
2334 2335           */
2335 2336          rootnex_teardown_copybuf(dma);
2336 2337          rootnex_teardown_windows(dma);
2337 2338  
2338 2339  #if defined(__amd64) && !defined(__xpv)
2339      -        if (IOMMU_USED(rdip))
     2340 +        if (IOMMU_USED(rdip) && dma->dp_dvma_used)
2340 2341                  (void) iommulib_nexdma_unmapobject(dip, rdip, handle,
2341 2342                      &dma->dp_dvma);
2342 2343  #endif
2343 2344  
2344 2345          /*
2345 2346           * If we had to allocate space to for the worse case sgl (it didn't
2346 2347           * fit into our pre-allocate buffer), free that up now
2347 2348           */
2348 2349          if (dma->dp_need_to_free_cookie) {
2349 2350                  kmem_free(dma->dp_cookies, dma->dp_cookie_size);
↓ open down ↓ 2823 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX