xref: /openbmc/qemu/include/exec/page-protection.h (revision 74781c08)
1*74781c08SPhilippe Mathieu-Daudé /*
2*74781c08SPhilippe Mathieu-Daudé  * QEMU page protection definitions.
3*74781c08SPhilippe Mathieu-Daudé  *
4*74781c08SPhilippe Mathieu-Daudé  *  Copyright (c) 2003 Fabrice Bellard
5*74781c08SPhilippe Mathieu-Daudé  *
6*74781c08SPhilippe Mathieu-Daudé  * SPDX-License-Identifier: LGPL-2.1+
7*74781c08SPhilippe Mathieu-Daudé  */
8*74781c08SPhilippe Mathieu-Daudé #ifndef EXEC_PAGE_PROT_COMMON_H
9*74781c08SPhilippe Mathieu-Daudé #define EXEC_PAGE_PROT_COMMON_H
10*74781c08SPhilippe Mathieu-Daudé 
11*74781c08SPhilippe Mathieu-Daudé /* same as PROT_xxx */
12*74781c08SPhilippe Mathieu-Daudé #define PAGE_READ      0x0001
13*74781c08SPhilippe Mathieu-Daudé #define PAGE_WRITE     0x0002
14*74781c08SPhilippe Mathieu-Daudé #define PAGE_EXEC      0x0004
15*74781c08SPhilippe Mathieu-Daudé #define PAGE_RWX       (PAGE_READ | PAGE_WRITE | PAGE_EXEC)
16*74781c08SPhilippe Mathieu-Daudé #define PAGE_VALID     0x0008
17*74781c08SPhilippe Mathieu-Daudé /*
18*74781c08SPhilippe Mathieu-Daudé  * Original state of the write flag (used when tracking self-modifying code)
19*74781c08SPhilippe Mathieu-Daudé  */
20*74781c08SPhilippe Mathieu-Daudé #define PAGE_WRITE_ORG 0x0010
21*74781c08SPhilippe Mathieu-Daudé /*
22*74781c08SPhilippe Mathieu-Daudé  * Invalidate the TLB entry immediately, helpful for s390x
23*74781c08SPhilippe Mathieu-Daudé  * Low-Address-Protection. Used with PAGE_WRITE in tlb_set_page_with_attrs()
24*74781c08SPhilippe Mathieu-Daudé  */
25*74781c08SPhilippe Mathieu-Daudé #define PAGE_WRITE_INV 0x0020
26*74781c08SPhilippe Mathieu-Daudé /* For use with page_set_flags: page is being replaced; target_data cleared. */
27*74781c08SPhilippe Mathieu-Daudé #define PAGE_RESET     0x0040
28*74781c08SPhilippe Mathieu-Daudé /* For linux-user, indicates that the page is MAP_ANON. */
29*74781c08SPhilippe Mathieu-Daudé #define PAGE_ANON      0x0080
30*74781c08SPhilippe Mathieu-Daudé 
31*74781c08SPhilippe Mathieu-Daudé /* Target-specific bits that will be used via page_get_flags().  */
32*74781c08SPhilippe Mathieu-Daudé #define PAGE_TARGET_1  0x0200
33*74781c08SPhilippe Mathieu-Daudé #define PAGE_TARGET_2  0x0400
34*74781c08SPhilippe Mathieu-Daudé 
35*74781c08SPhilippe Mathieu-Daudé /*
36*74781c08SPhilippe Mathieu-Daudé  * For linux-user, indicates that the page is mapped with the same semantics
37*74781c08SPhilippe Mathieu-Daudé  * in both guest and host.
38*74781c08SPhilippe Mathieu-Daudé  */
39*74781c08SPhilippe Mathieu-Daudé #define PAGE_PASSTHROUGH 0x0800
40*74781c08SPhilippe Mathieu-Daudé 
41*74781c08SPhilippe Mathieu-Daudé #endif
42