Make pmap_allocate_asid() mpsafe. Since between checking the ASID
authorpatrick <patrick@openbsd.org>
Thu, 16 Aug 2018 15:36:04 +0000 (15:36 +0000)
committerpatrick <patrick@openbsd.org>
Thu, 16 Aug 2018 15:36:04 +0000 (15:36 +0000)
commit2a0627a87bdbe71676455b13fb5cb61220cf8a67
tree3f26e9bf8e8e11d918a690667944b691aafbdb6f
parentb3f54129b83e153bde2b769c0f1d2e2e774cc153
Make pmap_allocate_asid() mpsafe.  Since between checking the ASID
table and setting the bits atomically another core can select the
same ASID as we did it currently would not be safe to run it without
the kernel lock.  This replaces the atomic_setbits_int(9) call with
atomic_cas_uint(9) where we can check that the table entry has not
been changed since we evaluted it.  Also modify pmap_free_asid() to
use the same concept.

ok kettenis@
sys/arch/arm64/arm64/pmap.c