OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man2 / subpage_prot.2
1 .\" Copyright (c) 2010 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\" based on a proposal from Stephan Mueller <smueller@atsec.com>
3 .\"
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of
9 .\" this manual under the conditions for verbatim copying, provided that
10 .\" the entire resulting derived work is distributed under the terms of
11 .\" a permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume.
15 .\" no responsibility for errors or omissions, or for damages resulting.
16 .\" from the use of the information contained herein.  The author(s) may.
17 .\" not have taken the same level of care in the production of this.
18 .\" manual, which is licensed free of charge, as they might when working.
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .\" Various pieces of text taken from the kernel source and the commentary
25 .\" in kernel commit fa28237cfcc5827553044cbd6ee52e33692b0faa
26 .\" both written by Paul Mackerras <paulus@samba.org>
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .TH SUBPAGE_PROT 2 2010\-10\-30 Linux "Linux Programmer's Manual"
34 .SH 名前
35 subpage_prot \- define a subpage protection for an address range
36 .SH 書式
37 .nf
38 \fBlong subpage_prot(unsigned long \fP\fIaddr\fP\fB, unsigned long \fP\fIlen\fP\fB,\fP
39 \fB                  uint32_t *\fP\fImap\fP\fB);\fP
40 .fi
41 .SH 説明
42 The PowerPC\-specific \fBsubpage_prot\fP()  system call provides the facility to
43 control the access permissions on individual 4kB subpages on systems
44 configured with a page size of 64kB.
45
46 The protection map is applied to the memory pages in the region starting at
47 \fIaddr\fP and continuing for \fIlen\fP bytes.  Both of these arguments must be
48 aligned to a 64\-kB boundary.
49
50 The protection map is specified in the buffer pointed to by \fImap\fP.  The map
51 has 2 bits per 4kB subpage; thus each 32\-bit word specifies the protections
52 of 16 4kB subpages inside a 64kB page (so, the number of 32\-bit words
53 pointed to by \fImap\fP should equate to the number of 64\-kB pages specified by
54 \fIlen\fP).  Each 2\-bit field in the protection map is either 0 to allow any
55 access, 1 to prevent writes, or 2 or 3 to prevent all accesses.
56 .SH 返り値
57 On success, \fBsubpage_prot\fP()  returns 0.  Otherwise, one of the error codes
58 specified below is returned.
59 .SH エラー
60 .TP 
61 \fBEFAULT\fP
62 The buffer referred to by \fImap\fP is not accessible.
63 .TP 
64 \fBEINVAL\fP
65 The \fIaddr\fP or \fIlen\fP arguments are incorrect.  Both of these arguments must
66 be aligned to a multiple of the system page size, and they must not refer to
67 a region outside of the address space of the process or to a region that
68 consists of huge pages.
69 .TP 
70 \fBENOMEM\fP
71 メモリ不足である。
72 .SH バージョン
73 This system call is provided on the PowerPC architecture since Linux
74 2.6.25.  The system call is provided only if the kernel is configured with
75 \fBCONFIG_PPC_64K_PAGES\fP.  No library support is provided.
76 .SH 準拠
77 このシステムコールは Linux 独自である。
78 .SH 注意
79 Normal page protections (at the 64\-kB page level) also apply; the subpage
80 protection mechanism is an additional constraint, so putting 0 in a 2\-bit
81 field won't allow writes to a page that is otherwise write\-protected.
82 .SS Rationale
83 .\" In the initial implementation, it was the case that:
84 .\"     In fact the whole process is switched to use 4k hardware pages when the
85 .\"     subpage_prot system call is used, but this could be improved in future
86 .\"     to switch only the affected segments.
87 .\" But Paul Mackerass says (Oct 2010): I'm pretty sure we now only switch
88 .\" the affected segment, not the whole process.
89 This system call is provided to assist writing emulators that operate using
90 64\-kB pages on PowerPC systems.  When emulating systems such as x86, which
91 uses a smaller page size, the emulator can no longer use the
92 memory\-management unit (MMU)  and normal system calls for controlling page
93 protections.  (The emulator could emulate the MMU by checking and possibly
94 remapping the address for each memory access in software, but that is slow.)
95 The idea is that the emulator supplies an array of protection masks to apply
96 to a specified range of virtual addresses.  These masks are applied at the
97 level where hardware page\-table entries (PTEs)  are inserted into the
98 hardware page table based on the Linux PTEs, so the Linux PTEs are not
99 affected.  Implicit in this is that the regions of the address space that
100 are protected are switched to use 4\-kB hardware pages rather than 64\-kB
101 hardware pages (on machines with hardware 64\-kB page support).
102 .SH 関連項目
103 \fBmprotect\fP(2), \fBsyscall\fP(2);
104 .br
105 the kernel source file \fIDocumentation/vm/hugetlbpage.txt\fP.