From 1e0e335b0f0dbae8ce49307377b23ef3673bd402 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 13 Apr 2023 14:37:35 +0300 Subject: amd64: fix PKRU and swapout interaction When vm_map_remove() is called from vm_swapout_map_deactivate_pages() due to swapout, PKRU attributes for the removed range must be kept intact. Provide a variant of pmap_remove(), pmap_map_delete(), to allow pmap to distinguish between real removes of the UVA mappings and any other internal removes, e.g. swapout. For non-amd64, pmap_map_delete() is stubbed by define to pmap_remove(). Reported by: andrew Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39556 --- sys/riscv/include/pmap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/riscv') diff --git a/sys/riscv/include/pmap.h b/sys/riscv/include/pmap.h index 04808422c2c2..88579e6448b5 100644 --- a/sys/riscv/include/pmap.h +++ b/sys/riscv/include/pmap.h @@ -57,6 +57,7 @@ #define pmap_page_get_memattr(m) ((m)->md.pv_memattr) #define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); +#define pmap_map_delete(pmap, sva, eva) pmap_remove(pmap, sva, eva) /* * Pmap stuff -- cgit v1.2.3