VirtualBox

Changeset 846 in vbox


Ignore:
Timestamp:
Feb 12, 2007 1:18:55 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18546
Message:

Fix for OpenBSD 4.0 (again).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PATM/CSAM.cpp

    r760 r846  
    2828#include <VBox/patm.h>
    2929#include <VBox/csam.h>
     30#include <VBox/cpumdis.h>
    3031#include <VBox/pgm.h>
    3132#include <VBox/iom.h>
     
    22342235                continue;
    22352236            }
     2237            /* OpenBSD guest specific patch test. */
    22362238            if (iGate >= 0x20)
    22372239            {
    2238                 /* OpenBSD guest specific patch test (3.7 & 3.8) */
    2239                 rc = PATMR3InstallPatch(pVM, pHandler - 3, PATMFL_CODE32 | PATMFL_GUEST_SPECIFIC);
    2240                 if (VBOX_FAILURE(rc))
    2241                     /* OpenBSD guest specific patch test (3.9 & 4.0) */
    2242                     rc = PATMR3InstallPatch(pVM, pHandler - 0x2B, PATMFL_CODE32 | PATMFL_GUEST_SPECIFIC);
    2243                 if (VBOX_SUCCESS(rc))
    2244                     Log(("Installed OpenBSD interrupt handler prefix instruction (push cs) patch\n"));
     2240                PCPUMCTX    pCtx;
     2241                DISCPUSTATE cpu;
     2242                RTGCUINTPTR aOpenBsdPushCSOffset[3] = {0x03,       /* OpenBSD 3.7 & 3.8 */
     2243                                                       0x2B,       /* OpenBSD 4.0 installation ISO */
     2244                                                       0x2F};      /* OpenBSD 4.0 after install */
     2245
     2246                rc = CPUMQueryGuestCtxPtr(pVM, &pCtx);
     2247                AssertRC(rc);   /* can't fail */
     2248
     2249                for (int i=0;i<ELEMENTS(aOpenBsdPushCSOffset);i++)
     2250                {
     2251                    rc = CPUMR3DisasmInstrCPU(pVM, pCtx, pHandler - aOpenBsdPushCSOffset[i], &cpu, NULL);
     2252                    if (    rc == VINF_SUCCESS
     2253                        &&  cpu.pCurInstr->opcode == OP_PUSH
     2254                        &&  cpu.pCurInstr->param1 == OP_PARM_REG_CS)
     2255                    {
     2256                        rc = PATMR3InstallPatch(pVM, pHandler - aOpenBsdPushCSOffset[i], PATMFL_CODE32 | PATMFL_GUEST_SPECIFIC);
     2257                        if (VBOX_SUCCESS(rc))
     2258                            Log(("Installed OpenBSD interrupt handler prefix instruction (push cs) patch\n"));
     2259                    }
     2260                }
    22452261            }
    22462262
Note: See TracChangeset for help on using the changeset viewer.

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