ept.h revision 221828
125184Sjkh/*- 2113674Smtm * Copyright (c) 2011 NetApp, Inc. 3113674Smtm * All rights reserved. 4113674Smtm * 5113674Smtm * Redistribution and use in source and binary forms, with or without 6113674Smtm * modification, are permitted provided that the following conditions 7113674Smtm * are met: 8113674Smtm * 1. Redistributions of source code must retain the above copyright 9113674Smtm * notice, this list of conditions and the following disclaimer. 10113674Smtm * 2. Redistributions in binary form must reproduce the above copyright 11113674Smtm * notice, this list of conditions and the following disclaimer in the 12113674Smtm * documentation and/or other materials provided with the distribution. 13113674Smtm * 14113674Smtm * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND 15113674Smtm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16113674Smtm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17113674Smtm * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE 18113674Smtm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19113674Smtm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20113674Smtm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21113674Smtm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22113674Smtm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23113674Smtm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24113674Smtm * SUCH DAMAGE. 2550472Speter * 2666830Sobrien * $FreeBSD$ 2725184Sjkh */ 28113674Smtm 29113674Smtm#ifndef _EPT_H_ 30113674Smtm#define _EPT_H_ 31113674Smtm 3225184Sjkhstruct vmx; 33113674Smtm 34113674Smtm#define EPT_PWLEVELS 4 /* page walk levels */ 35113674Smtm#define EPTP(pml4) ((pml4) | (EPT_PWLEVELS - 1) << 3 | PAT_WRITE_BACK) 36113674Smtm 37147088Sbrooksint ept_init(void); 38147088Sbrooksint ept_vmmmap(void *arg, vm_paddr_t gpa, vm_paddr_t hpa, size_t length, 39113674Smtm vm_memattr_t attr, int prot, boolean_t allow_superpage_mappings); 40113674Smtmvoid ept_invalidate_mappings(u_long ept_pml4); 41113674Smtmvoid ept_vmcleanup(struct vmx *vmx); 42147088Sbrooks#endif 43147088Sbrooks