169e0a03cSPaolo Bonzini /* 269e0a03cSPaolo Bonzini * Copyright (C) 2016 Veertu Inc, 369e0a03cSPaolo Bonzini * Copyright (C) 2017 Google Inc, 469e0a03cSPaolo Bonzini * 569e0a03cSPaolo Bonzini * This program is free software; you can redistribute it and/or 669e0a03cSPaolo Bonzini * modify it under the terms of the GNU Lesser General Public 769e0a03cSPaolo Bonzini * License as published by the Free Software Foundation; either 88af82b8eSChetan Pant * version 2.1 of the License, or (at your option) any later version. 969e0a03cSPaolo Bonzini * 1069e0a03cSPaolo Bonzini * This program is distributed in the hope that it will be useful, 1169e0a03cSPaolo Bonzini * but WITHOUT ANY WARRANTY; without even the implied warranty of 1269e0a03cSPaolo Bonzini * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1369e0a03cSPaolo Bonzini * Lesser General Public License for more details. 1469e0a03cSPaolo Bonzini * 1569e0a03cSPaolo Bonzini * You should have received a copy of the GNU Lesser General Public 1669e0a03cSPaolo Bonzini * License along with this program; if not, see <http://www.gnu.org/licenses/>. 1769e0a03cSPaolo Bonzini */ 18a8b991b5SMarkus Armbruster 19a8b991b5SMarkus Armbruster #ifndef X86_MMU_H 20a8b991b5SMarkus Armbruster #define X86_MMU_H 2169e0a03cSPaolo Bonzini 2269e0a03cSPaolo Bonzini #define PT_PRESENT (1 << 0) 2369e0a03cSPaolo Bonzini #define PT_WRITE (1 << 1) 2469e0a03cSPaolo Bonzini #define PT_USER (1 << 2) 2569e0a03cSPaolo Bonzini #define PT_WT (1 << 3) 2669e0a03cSPaolo Bonzini #define PT_CD (1 << 4) 2769e0a03cSPaolo Bonzini #define PT_ACCESSED (1 << 5) 2869e0a03cSPaolo Bonzini #define PT_DIRTY (1 << 6) 2969e0a03cSPaolo Bonzini #define PT_PS (1 << 7) 3069e0a03cSPaolo Bonzini #define PT_GLOBAL (1 << 8) 3169e0a03cSPaolo Bonzini #define PT_NX (1llu << 63) 3269e0a03cSPaolo Bonzini 3369e0a03cSPaolo Bonzini /* error codes */ 3469e0a03cSPaolo Bonzini #define MMU_PAGE_PT (1 << 0) 3569e0a03cSPaolo Bonzini #define MMU_PAGE_WT (1 << 1) 3669e0a03cSPaolo Bonzini #define MMU_PAGE_US (1 << 2) 3769e0a03cSPaolo Bonzini #define MMU_PAGE_NX (1 << 3) 3869e0a03cSPaolo Bonzini 39*f8436a16SPhilippe Mathieu-Daudé bool mmu_gva_to_gpa(CPUState *cpu, target_ulong gva, uint64_t *gpa); 4069e0a03cSPaolo Bonzini 41*f8436a16SPhilippe Mathieu-Daudé void vmx_write_mem(CPUState *cpu, target_ulong gva, void *data, int bytes); 42*f8436a16SPhilippe Mathieu-Daudé void vmx_read_mem(CPUState *cpu, void *data, target_ulong gva, int bytes); 4369e0a03cSPaolo Bonzini 44a8b991b5SMarkus Armbruster #endif /* X86_MMU_H */ 45