Bug #14365


memlist_insert() throws memlists away with empty lists

Added by Robert Mustacchi 13 days ago. Updated 3 days ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


If you try to use memlist_insert() from the uts/common/os/memlist_new.c school of memlists and the curmemlistp is empty, it will fail entirely. The problem here is that when it doesn't find an instance for last here, it then we end up discarding this entirely and never setting *curmemlistp. The solution here is that if last is actually NULL, that we come back here and actually assign new to *curmemlistp.

Actions #1

Updated by Electric Monk 13 days ago

  • Gerrit CR set to 1915
Actions #2

Updated by Robert Mustacchi 12 days ago

I tested this in two ways:

  1. By using a platform that was causing this style of memlist to come up and verifying that we now correctly get through the initalization logic and all the way up through PCIe device enum.
  2. By using existing platforms (e.g. generic x86 systems) and booting them under these boots. To verify that nothing had changed in two ways:
    1. Looking at differences in a prtconf -vP between the two systems. The only thing that had changed were some minors being attached and detached. Critically all the hardware properties such as what memory addresses were assigned to BARs were the same.
    2. Using pcieadm to dump configuration space for all devices before and after this change and comparing its contents. Configuration space had not changed except in one or two cases where a page allocation order was switched around (e.g. one device got an MSI address of 0xfee1d000 instead of 0xfee1b000 and vice-versa.
Actions #3

Updated by Electric Monk 3 days ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit e0cd43fe10732fee98e49dcb194f13ded2d5b660

commit  e0cd43fe10732fee98e49dcb194f13ded2d5b660
Author: Robert Mustacchi <>
Date:   2022-01-15T18:40:54.000Z

    14365 memlist_insert() throws memlists away with empty lists
    Reviewed by: Jason King <>
    Reviewed by: Toomas Soome <>
    Approved by: Dan McDonald <>


Also available in: Atom PDF