| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: pmap.9,v 1.47 2020/03/14 14:05:42 ad Exp $ | | 1 | .\" $NetBSD: pmap.9,v 1.48 2020/08/16 16:48:08 thorpej Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2000, 2001, 2002, 2020 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2000, 2001, 2002, 2020 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | | 6 | .\" This code is derived from software contributed to The NetBSD Foundation |
7 | .\" by Jason R. Thorpe. | | 7 | .\" by Jason R. Thorpe. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| @@ -17,27 +17,27 @@ | | | @@ -17,27 +17,27 @@ |
17 | .\" | | 17 | .\" |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | | 28 | .\" POSSIBILITY OF SUCH DAMAGE. |
29 | .\" | | 29 | .\" |
30 | .Dd March 14, 2020 | | 30 | .Dd August 16, 2020 |
31 | .Dt PMAP 9 | | 31 | .Dt PMAP 9 |
32 | .Os | | 32 | .Os |
33 | .Sh NAME | | 33 | .Sh NAME |
34 | .Nm pmap | | 34 | .Nm pmap |
35 | .Nd machine-dependent portion of the virtual memory system | | 35 | .Nd machine-dependent portion of the virtual memory system |
36 | .Sh SYNOPSIS | | 36 | .Sh SYNOPSIS |
37 | .In sys/param.h | | 37 | .In sys/param.h |
38 | .In uvm/uvm_extern.h | | 38 | .In uvm/uvm_extern.h |
39 | .Ft void | | 39 | .Ft void |
40 | .Fn "pmap_init" "void" | | 40 | .Fn "pmap_init" "void" |
41 | .Ft void | | 41 | .Ft void |
42 | .Fn "pmap_virtual_space" "vaddr_t *vstartp" "vaddr_t *vendp" | | 42 | .Fn "pmap_virtual_space" "vaddr_t *vstartp" "vaddr_t *vendp" |
43 | .Ft vaddr_t | | 43 | .Ft vaddr_t |
| @@ -756,55 +756,53 @@ and | | | @@ -756,55 +756,53 @@ and |
756 | .Fn pmap_kremove | | 756 | .Fn pmap_kremove |
757 | in order to ensure correct operation of the virtual memory system. | | 757 | in order to ensure correct operation of the virtual memory system. |
758 | .Pp | | 758 | .Pp |
759 | If a | | 759 | If a |
760 | .Nm | | 760 | .Nm |
761 | implementation does not delay virtual-to-physical mapping updates, | | 761 | implementation does not delay virtual-to-physical mapping updates, |
762 | .Fn pmap_update | | 762 | .Fn pmap_update |
763 | has no operation. | | 763 | has no operation. |
764 | In this case, the call may be deleted using a C pre-processor macro in | | 764 | In this case, the call may be deleted using a C pre-processor macro in |
765 | .In machine/pmap.h . | | 765 | .In machine/pmap.h . |
766 | .It void Fn "pmap_activate" "struct lwp *l" | | 766 | .It void Fn "pmap_activate" "struct lwp *l" |
767 | Activate the physical map used by the process behind lwp | | 767 | Activate the physical map used by the process behind lwp |
768 | .Fa l . | | 768 | .Fa l . |
| | | 769 | on the current CPU. |
769 | This is called by the virtual memory system when the | | 770 | This is called by the virtual memory system when the |
770 | virtual memory context for a process is changed, and is also | | 771 | virtual memory context for a process is changed, and is also |
771 | often used by machine-dependent context switch code to program | | 772 | used by the context switch code to program the memory management hardware |
772 | the memory management hardware with the process's page table | | 773 | with the process's page table base, etc. |
773 | base, etc. | | 774 | All calls to |
774 | Note that | | | |
775 | .Fn pmap_activate | | 775 | .Fn pmap_activate |
776 | may not always be called when | | 776 | from machine-independent code are made with preemption disabled and with |
777 | .Fa l | | 777 | .Fa l |
778 | is the current lwp. | | 778 | as the current lwp. |
779 | .Fn pmap_activate | | | |
780 | must be able to handle this scenario. | | | |
781 | .Pp | | 779 | .Pp |
782 | The | | 780 | The |
783 | .Fn pmap_activate | | 781 | .Fn pmap_activate |
784 | call, like | | 782 | call, like |
785 | .Fn pmap_deactivate , | | 783 | .Fn pmap_deactivate , |
786 | must never block, as it is used for context switching. | | 784 | must never block, as it is used for context switching. |
787 | .It void Fn "pmap_deactivate" "struct lwp *l" | | 785 | .It void Fn "pmap_deactivate" "struct lwp *l" |
788 | Deactivate the physical map used by the process behind lwp | | 786 | Deactivate the physical map used by the process behind lwp |
789 | .Fa l . | | 787 | .Fa l . |
790 | It is generally used in conjunction with | | 788 | It is generally used in conjunction with |
791 | .Fn pmap_activate . | | 789 | .Fn pmap_activate . |
792 | Like | | 790 | Like |
793 | .Fn pmap_activate , | | 791 | .Fn pmap_activate , |
794 | .Fn pmap_deactivate | | 792 | .Fn pmap_deactivate |
795 | may not always be called when | | 793 | is called by machine-independent code with preemption disabled and with |
796 | .Fa l | | 794 | .Fa l |
797 | is the current lwp. | | 795 | as the current lwp. |
798 | .Pp | | 796 | .Pp |
799 | As above, | | 797 | As above, |
800 | .Fn pmap_deactivate | | 798 | .Fn pmap_deactivate |
801 | must never block. | | 799 | must never block. |
802 | .It void Fn "pmap_zero_page" "paddr_t pa" | | 800 | .It void Fn "pmap_zero_page" "paddr_t pa" |
803 | Zero the PAGE_SIZE sized region starting at physical address | | 801 | Zero the PAGE_SIZE sized region starting at physical address |
804 | .Fa pa . | | 802 | .Fa pa . |
805 | The | | 803 | The |
806 | .Nm | | 804 | .Nm |
807 | implementation must take whatever steps are necessary to map the | | 805 | implementation must take whatever steps are necessary to map the |
808 | page to a kernel-accessible address and zero the page. | | 806 | page to a kernel-accessible address and zero the page. |
809 | It is suggested that implementations use an optimized zeroing algorithm, | | 807 | It is suggested that implementations use an optimized zeroing algorithm, |
810 | as the performance of this function directly impacts page fault performance. | | 808 | as the performance of this function directly impacts page fault performance. |