VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMRC/CPUMRC.cpp@ 41943

Last change on this file since 41943 was 41943, checked in by vboxsync, 12 years ago

VMM: Avoid stale selector issues in RC so there will be no need to try fix them by recursive trapping (this was broken for GS since forever anyways).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1/* $Id: CPUMRC.cpp 41943 2012-06-28 02:33:43Z vboxsync $ */
2/** @file
3 * CPUM - Raw-mode Context Code.
4 */
5
6/*
7 * Copyright (C) 2006-2012 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#define LOG_GROUP LOG_GROUP_CPUM
23#include <VBox/vmm/cpum.h>
24#include <VBox/vmm/vmm.h>
25#include <VBox/vmm/trpm.h>
26#include "CPUMInternal.h"
27#include <VBox/vmm/vm.h>
28#include <VBox/err.h>
29#include <iprt/assert.h>
30#include <VBox/log.h>
31
32
33/*******************************************************************************
34* Internal Functions *
35*******************************************************************************/
36RT_C_DECLS_BEGIN /* addressed from asm (not called so no DECLASM). */
37DECLCALLBACK(int) cpumRCHandleNPAndGP(PVM pVM, PCPUMCTXCORE pRegFrame, uintptr_t uUser);
38RT_C_DECLS_END
39
40
41/**
42 * Deal with traps occurring during segment loading and IRET when resuming guest
43 * context execution.
44 *
45 * @returns VBox status code.
46 * @param pVM Pointer to the VM.
47 * @param pRegFrame The register frame.
48 * @param uUser User argument. In this case a combination of the
49 * CPUM_HANDLER_* \#defines.
50 */
51DECLCALLBACK(int) cpumRCHandleNPAndGP(PVM pVM, PCPUMCTXCORE pRegFrame, uintptr_t uUser)
52{
53 Log(("********************************************************\n"));
54 Log(("cpumRCHandleNPAndGP: eip=%RX32 uUser=%#x\n", pRegFrame->eip, uUser));
55 Log(("********************************************************\n"));
56
57 /*
58 * Take action based on what's happened.
59 */
60 switch (uUser & CPUM_HANDLER_TYPEMASK)
61 {
62 case CPUM_HANDLER_GS:
63 case CPUM_HANDLER_DS:
64 case CPUM_HANDLER_ES:
65 case CPUM_HANDLER_FS:
66 TRPMGCHyperReturnToHost(pVM, VINF_EM_RAW_STALE_SELECTOR);
67 break;
68
69 case CPUM_HANDLER_IRET:
70 TRPMGCHyperReturnToHost(pVM, VINF_EM_RAW_IRET_TRAP);
71 break;
72 }
73
74 AssertMsgFailed(("uUser=%#x eip=%#x\n", uUser, pRegFrame->eip));
75 return VERR_TRPM_DONT_PANIC;
76}
77
Note: See TracBrowser for help on using the repository browser.

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