VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMR0/IEMR0.cpp

Last change on this file was 108195, checked in by vboxsync, 6 weeks ago

VMM/IEM: Splitting out most of the x86 target specific stuff from IEMInternal.h and into VMMAll/target-x86/IEMInternal-x86.h. jiraref:VBP-1431

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1/* $Id: IEMR0.cpp 108195 2025-02-13 14:57:25Z vboxsync $ */
2/** @file
3 * IEM - Interpreted Execution Manager - Ring-0.
4 */
5
6/*
7 * Copyright (C) 2011-2024 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28
29/*********************************************************************************************************************************
30* Header Files *
31*********************************************************************************************************************************/
32#define LOG_GROUP LOG_GROUP_IEM
33#define VMCPU_INCL_CPUM_GST_CTX
34#ifdef IN_RING0
35# define VBOX_VMM_TARGET_X86
36#endif
37#include <VBox/vmm/iem.h>
38#include <VBox/vmm/cpum.h>
39#include <VBox/vmm/pgm.h>
40#include "IEMInternal.h"
41#include <VBox/vmm/vmcc.h>
42#include <VBox/log.h>
43#include <iprt/errcore.h>
44
45
46
47VMMR0_INT_DECL(int) IEMR0InitVM(PGVM pGVM)
48{
49 AssertCompile(sizeof(pGVM->iem.s) <= sizeof(pGVM->iem.padding));
50 AssertCompile(sizeof(pGVM->aCpus[0].iem.s) <= sizeof(pGVM->aCpus[0].iem.padding));
51
52#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
53 /*
54 * Register the per-VM VMX APIC-access page handler type.
55 */
56 if (pGVM->cpum.ro.GuestFeatures.fVmx)
57 {
58 int rc = PGMR0HandlerPhysicalTypeSetUpContext(pGVM, PGMPHYSHANDLERKIND_ALL, PGMPHYSHANDLER_F_NOT_IN_HM,
59 iemVmxApicAccessPageHandler, iemVmxApicAccessPagePfHandler,
60 "VMX APIC-access page", pGVM->iem.s.hVmxApicAccessPage);
61 AssertLogRelRCReturn(rc, rc);
62 }
63#endif
64 return VINF_SUCCESS;
65}
66
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette