VirtualBox

Changeset 66040 in vbox


Ignore:
Timestamp:
Mar 10, 2017 4:18:12 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
113906
Message:

VMM: Nested Hw.virt: SVM bits.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r66001 r66040  
    10281028    uint32_t        fSvm : 1;
    10291029
     1030    /** Support for Intel VMX. */
     1031    uint32_t        fVmx : 1;
     1032
    10301033    /** Alignment padding / reserved for future use. */
    1031     uint32_t        fPadding : 26;
    1032     uint32_t        auPadding[3];
     1034    uint32_t        fPadding : 25;
     1035
     1036    /** Hardware virtualization features. */
     1037    union
     1038    {
     1039        /** SVM features.  */
     1040        struct
     1041        {
     1042            /** Features as reported by CPUID 0x8000000a.EDX.  */
     1043            union
     1044            {
     1045                struct
     1046                {
     1047                    uint32_t fNestedPaging         : 1;
     1048                    uint32_t fLbrVirt              : 1;
     1049                    uint32_t fSvmLock              : 1;
     1050                    uint32_t fNextRipSave          : 1;
     1051                    uint32_t fTscRateMsr           : 1;
     1052                    uint32_t fVmcbClean            : 1;
     1053                    uint32_t fFlusbByAsid          : 1;
     1054                    uint32_t fDecodeAssist         : 1;
     1055                    uint32_t u2Reserved0           : 2;
     1056                    uint32_t fPauseFilter          : 1;
     1057                    uint32_t u1Reserved0           : 1;
     1058                    uint32_t fPauseFilterThreshold : 1;
     1059                    uint32_t fAvic                 : 1;
     1060                    uint32_t u18Reserved0          : 18;
     1061                } n;
     1062                uint32_t    u;
     1063            } feat;
     1064            /** Maximum supported ASID. */
     1065            uint32_t        uMaxAsid;
     1066        } svm;
     1067
     1068        /** VMX features. */
     1069        struct
     1070        {
     1071            uint32_t    uDummy1;
     1072            uint32_t    uDummy2;
     1073        } vmx;
     1074    } CPUM_UNION_NM(hwvirt);
     1075    uint32_t        auPadding[1];
    10331076} CPUMFEATURES;
    10341077#ifndef VBOX_FOR_DTRACE_LIB
     
    12691312
    12701313/**
    1271  * Checks if the guest has the specified ctrl/instruction
    1272  * intercept active.
     1314 * Checks if the guest VMCB has the specified ctrl/instruction intercept active.
    12731315 *
    12741316 * @returns @c true if in intercept is set, @c false otherwise.
     
    12791321DECLINLINE(bool) CPUMIsGuestSvmCtrlInterceptSet(PCPUMCTX pCtx, uint64_t fIntercept)
    12801322{
    1281     return RT_BOOL(pCtx->hwvirt.svm.u64InterceptCtrl & fIntercept);
     1323    return RT_BOOL(pCtx->hwvirt.svm.VmcbCtrl.u64InterceptCtrl & fIntercept);
    12821324}
    12831325
    12841326/**
    1285  * Checks if the guest has the specified CR read intercept
     1327 * Checks if the guest VMCB has the specified CR read intercept
    12861328 * active.
    12871329 *
     
    12921334DECLINLINE(bool) CPUMIsGuestSvmReadCRxInterceptSet(PCPUMCTX pCtx, uint8_t uCr)
    12931335{
    1294     return RT_BOOL(pCtx->hwvirt.svm.u16InterceptRdCRx & (1 << uCr));
     1336    return RT_BOOL(pCtx->hwvirt.svm.VmcbCtrl.u16InterceptRdCRx & (1 << uCr));
    12951337}
    12961338
    12971339/**
    1298  * Checks if the guest has the specified CR write intercept
     1340 * Checks if the guest VMCB has the specified CR write intercept
    12991341 * active.
    13001342 *
     
    13051347DECLINLINE(bool) CPUMIsGuestSvmWriteCRxInterceptSet(PCPUMCTX pCtx, uint8_t uCr)
    13061348{
    1307     return RT_BOOL(pCtx->hwvirt.svm.u16InterceptWrCRx & (1 << uCr));
     1349    return RT_BOOL(pCtx->hwvirt.svm.VmcbCtrl.u16InterceptWrCRx & (1 << uCr));
    13081350}
    13091351
    13101352/**
    1311  * Checks if the guest has the specified DR read intercept
     1353 * Checks if the guest VMCB has the specified DR read intercept
    13121354 * active.
    13131355 *
     
    13181360DECLINLINE(bool) CPUMIsGuestSvmReadDRxInterceptSet(PCPUMCTX pCtx, uint8_t uDr)
    13191361{
    1320     return RT_BOOL(pCtx->hwvirt.svm.u16InterceptRdDRx & (1 << uDr));
     1362    return RT_BOOL(pCtx->hwvirt.svm.VmcbCtrl.u16InterceptRdDRx & (1 << uDr));
    13211363}
    13221364
    13231365/**
    1324  * Checks if the guest has the specified DR write intercept
     1366 * Checks if the guest VMCB has the specified DR write intercept
    13251367 * active.
    13261368 *
     
    13311373DECLINLINE(bool) CPUMIsGuestSvmWriteDRxInterceptSet(PCPUMCTX pCtx, uint8_t uDr)
    13321374{
    1333     return RT_BOOL(pCtx->hwvirt.svm.u16InterceptWrDRx & (1 << uDr));
     1375    return RT_BOOL(pCtx->hwvirt.svm.VmcbCtrl.u16InterceptWrDRx & (1 << uDr));
    13341376}
    13351377
    13361378/**
    1337  * Checks if the guest has the specified exception
     1379 * Checks if the guest VMCB has the specified exception
    13381380 * intercept active.
    13391381 *
     
    13441386DECLINLINE(bool) CPUMIsGuestSvmXcptInterceptSet(PCPUMCTX pCtx, X86XCPT enmXcpt)
    13451387{
    1346     return RT_BOOL(pCtx->hwvirt.svm.u32InterceptXcpt & enmXcpt);
     1388    return RT_BOOL(pCtx->hwvirt.svm.VmcbCtrl.u32InterceptXcpt & enmXcpt);
    13471389}
    13481390
    13491391/**
    1350  * Checks if the guest is currently in nested hardware-virtualized
    1351  * guest mode.
     1392 * Checks if we are executing inside the nested hardware-virtualized guest.
    13521393 *
    13531394 * @returns true if in nested-guest mode, false otherwise.
     
    13571398{
    13581399    /*
    1359      * With SVM, the VMRUN intercept is a pre-requisite to entering guest-mode.
    1360      * See AMD spec., 15.5 "VMRUN instruction" subsection "Canonicalization and Consistency Checks".
     1400     * With AMD-V, the VMRUN intercept is a pre-requisite to entering SVM guest-mode.
     1401     * See AMD spec. 15.5 "VMRUN instruction" subsection "Canonicalization and Consistency Checks".
    13611402     */
    1362     /** @todo Fix this -- silly recompiler is redefining this stuff... why? */
    1363     return RT_BOOL(pCtx->hwvirt.svm.u64InterceptCtrl & RT_BIT_64(32) /* SVM_CTRL_INTERCEPT_VMRUN*/);
     1403    return RT_BOOL(pCtx->hwvirt.svm.VmcbCtrl.u64InterceptCtrl & SVM_CTRL_INTERCEPT_VMRUN);
    13641404    /** @todo Intel VMX.  */
    13651405}
  • trunk/include/VBox/vmm/cpum.mac

    r66000 r66040  
    259259%endif
    260260    .hwvirt.svm.uMsrHSavePa         resq    1
    261     .hwvirt.svm.u64InterceptCtrl    resq    1
    262     .hwvirt.svm.u32InterceptXcpt    resd    1
    263     .hwvirt.svm.u16InterceptRdCRx   resw    1
    264     .hwvirt.svm.u16InterceptWrCRx   resw    1
    265     .hwvirt.svm.u16InterceptRdDRx   resw    1
    266     .hwvirt.svm.u16InterceptWrDRx   resw    1
     261    .hwvirt.svm.GCPhysVmcb          resq    1
     262    .hwvirt.svm.VmcbCtrl            resb  256
     263    .hwvirt.svm.HostState           resb  184
    267264    .hwvirt.svm.fGif                resb    1
    268     .hwvirt.svm.abPadding           resb    3
    269     .hwvirt.svm.GCPhysNstGstVmcb    resq    1
    270265    alignb 64
    271266endstruc
  • trunk/include/VBox/vmm/cpumctx.h

    r66015 r66040  
    3030# include <iprt/x86.h>
    3131# include <VBox/types.h>
     32# include <VBox/vmm/hm_svm.h>
    3233#else
    3334# pragma D depends_on library x86.d
     
    7273    X86DESCATTR Attr;
    7374} CPUMSELREG;
    74 #ifdef VBOX_FOR_DTRACE_LIB
    75 AssertCompileSize(CPUMSELREG, 24)
     75#ifndef VBOX_FOR_DTRACE_LIB
     76AssertCompileSize(CPUMSELREG, 24);
    7677#endif
    7778
     
    169170    } CPUM_STRUCT_NM(s);
    170171} CPUMCTXGREG;
    171 #ifdef VBOX_FOR_DTRACE_LIB
     172#ifndef VBOX_FOR_DTRACE_LIB
    172173AssertCompileSize(CPUMCTXGREG, 8);
    173174AssertCompileMemberOffset(CPUMCTXGREG, CPUM_STRUCT_NM(s.) bLo, 0);
     
    283284} CPUMCTXCORE;
    284285#pragma pack()
     286
     287
     288/**
     289 * SVM Host-state area (Nested Hw.virt - VirtualBox's layout).
     290 */
     291#pragma pack(1)
     292typedef struct SVMHOSTSTATE
     293{
     294    uint64_t    uEferMsr;
     295    uint64_t    uCr0;
     296    uint64_t    uCr4;
     297    uint64_t    uCr3;
     298    uint64_t    uRip;
     299    uint64_t    uRsp;
     300    uint64_t    uRax;
     301    X86RFLAGS   rflags;
     302    CPUMSELREG  es;
     303    CPUMSELREG  cs;
     304    CPUMSELREG  ss;
     305    CPUMSELREG  ds;
     306    VBOXGDTR    gdtr;
     307    VBOXIDTR    idtr;
     308    uint8_t     abPadding[4];
     309} SVMHOSTSTATE;
     310#pragma pack()
     311/** Pointer to the SVMHOSTSTATE structure. */
     312typedef SVMHOSTSTATE *PSVMHOSTSTATE;
     313/** Pointer to a const SVMHOSTSTATE structure. */
     314typedef const SVMHOSTSTATE *PCSVMHOSTSTATE;
     315#ifndef VBOX_FOR_DTRACE_LIB
     316AssertCompileSizeAlignment(SVMHOSTSTATE, 8);
     317AssertCompileSize(SVMHOSTSTATE, 184);
     318#endif
    285319
    286320
     
    441475            struct
    442476            {
    443                 /** 728 - MSR holding physical address of the Guest's 'host-state'. */
    444                 uint64_t            uMsrHSavePa;
    445 
    446                 /** @name Cache of the nested-guest VMCB controls.
    447                  * @{ */
    448                 /** 736 - Control intercepts. */
    449                 uint64_t            u64InterceptCtrl;
    450                 /** 744 - Exception intercepts. */
    451                 uint32_t            u32InterceptXcpt;
    452                 /** 748 - CR0-CR15 read intercepts. */
    453                 uint16_t            u16InterceptRdCRx;
    454                 /** 750 - CR0-CR15 write intercepts. */
    455                 uint16_t            u16InterceptWrCRx;
    456                 /** 752 - DR0-DR15 read intercepts. */
    457                 uint16_t            u16InterceptRdDRx;
    458                 /** 754 - DR0-DR15 write intercepts. */
    459                 uint16_t            u16InterceptWrDRx;
    460                 /** @} */
    461 
    462                 /** 756 - Global interrupt flag. */
    463                 uint8_t            fGif;
    464                 uint8_t            abPadding[3];
    465                 /** 760 - Nested-guest VMCB. */
    466                 RTGCPHYS           GCPhysNstGstVmcb;
     477                /** 728 - MSR holding physical address of the Guest's Host-state. */
     478                uint64_t        uMsrHSavePa;
     479                /** 736 - Guest physical address of the nested-guest VMCB. */
     480                RTGCPHYS        GCPhysVmcb;
     481                /** 744 - Cache of the nested-guest VMCB control area. */
     482                SVMVMCBCTRL     VmcbCtrl;
     483                /** 1000 - Guest's host-state save area. */
     484                SVMHOSTSTATE    HostState;
     485                /** 1184 - Global interrupt flag. */
     486                uint8_t         fGif;
     487                /** 1185 - Padding. */
     488                uint8_t         abPadding0[31];
    467489            } svm;
    468490#if 0
     
    527549AssertCompileMemberOffset(CPUMCTX,                 aoffXState, HC_ARCH_BITS == 64 ? 596 : 588);
    528550AssertCompileMemberOffset(CPUMCTX, hwvirt, 728);
    529 AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.uMsrHSavePa,       728);
    530 AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.u64InterceptCtrl,  736);
    531 AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.u32InterceptXcpt,  744);
    532 AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.u16InterceptRdCRx, 748);
    533 AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.u16InterceptWrCRx, 750);
    534 AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.u16InterceptRdDRx, 752);
    535 AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.u16InterceptWrDRx, 754);
    536 AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.fGif,              756);
     551AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.uMsrHSavePa, 728);
     552AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.GCPhysVmcb,  736);
     553AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.VmcbCtrl,    744);
     554AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.HostState,  1000);
     555AssertCompileMemberOffset(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) svm.fGif,       1184);
    537556
    538557AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw.) rax, CPUMCTX, CPUM_UNION_NM(g.) aGRegs);
     
    719738typedef const CPUMCPUID *PCCPUMCPUID;
    720739
    721 /**
    722  * SVM Host-state area (Nested Hw.virt - VirtualBox's layout).
    723  */
    724 typedef struct SVMHOSTSTATE
    725 {
    726     uint64_t    uEferMsr;
    727     uint64_t    uCr0;
    728     uint64_t    uCr4;
    729     uint64_t    uCr3;
    730     uint64_t    uRip;
    731     uint64_t    uRsp;
    732     uint64_t    uRax;
    733     X86RFLAGS   rflags;
    734     CPUMSELREG  es;
    735     CPUMSELREG  cs;
    736     CPUMSELREG  ss;
    737     CPUMSELREG  ds;
    738     VBOXGDTR    gdtr;
    739     VBOXIDTR    idtr;
    740 } SVMHOSTSTATE;
    741 /** Pointer to the SVMHOSTSTATE structure. */
    742 typedef SVMHOSTSTATE *PSVMHOSTSTATE;
    743 /** Pointer to a const SVMHOSTSTATE structure. */
    744 typedef const SVMHOSTSTATE *PCSVMHOSTSTATE;
    745 
    746740/** @}  */
    747741
  • trunk/include/VBox/vmm/hm.h

    r66022 r66040  
    153153VMM_INT_DECL(void)              HMVmxNstGstVmExit(PVMCPU pVCpu, uint16_t uBasicExitReason);
    154154VMM_INT_DECL(VBOXSTRICTRC)      HMSvmVmmcall(PVMCPU pVCpu, PCPUMCTX pCtx, bool *pfRipUpdated);
    155 VMM_INT_DECL(VBOXSTRICTRC)      HMSvmVmrun(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMVMCB pVmcb, PSVMHOSTSTATE pHostState);
     155VMM_INT_DECL(VBOXSTRICTRC)      HMSvmVmrun(PVMCPU pVCpu, PCPUMCTX pCtx);
    156156
    157157#ifndef IN_RC
  • trunk/include/VBox/vmm/hm_svm.h

    r66022 r66040  
    6767/** @} */
    6868
    69 
     69/*
     70 * Ugly!
     71 * When compiling the recompiler, its own svm.h defines clash with
     72 * the following defines. Avoid just the duplicates here as we still
     73 * require other definitions and structures in this header.
     74 */
     75#ifndef IN_REM_R3
    7076/** @name SVM Basic Exit Reasons.
    7177 * @{
    7278 */
    7379/** Invalid guest state in VMCB. */
    74 #define SVM_EXIT_INVALID                (uint64_t)(-1)
     80# define SVM_EXIT_INVALID                (uint64_t)(-1)
    7581/** Read from CR0-CR15. */
    76 #define SVM_EXIT_READ_CR0               0x0
    77 #define SVM_EXIT_READ_CR1               0x1
    78 #define SVM_EXIT_READ_CR2               0x2
    79 #define SVM_EXIT_READ_CR3               0x3
    80 #define SVM_EXIT_READ_CR4               0x4
    81 #define SVM_EXIT_READ_CR5               0x5
    82 #define SVM_EXIT_READ_CR6               0x6
    83 #define SVM_EXIT_READ_CR7               0x7
    84 #define SVM_EXIT_READ_CR8               0x8
    85 #define SVM_EXIT_READ_CR9               0x9
    86 #define SVM_EXIT_READ_CR10              0xA
    87 #define SVM_EXIT_READ_CR11              0xB
    88 #define SVM_EXIT_READ_CR12              0xC
    89 #define SVM_EXIT_READ_CR13              0xD
    90 #define SVM_EXIT_READ_CR14              0xE
    91 #define SVM_EXIT_READ_CR15              0xF
     82# define SVM_EXIT_READ_CR0               0x0
     83# define SVM_EXIT_READ_CR1               0x1
     84# define SVM_EXIT_READ_CR2               0x2
     85# define SVM_EXIT_READ_CR3               0x3
     86# define SVM_EXIT_READ_CR4               0x4
     87# define SVM_EXIT_READ_CR5               0x5
     88# define SVM_EXIT_READ_CR6               0x6
     89# define SVM_EXIT_READ_CR7               0x7
     90# define SVM_EXIT_READ_CR8               0x8
     91# define SVM_EXIT_READ_CR9               0x9
     92# define SVM_EXIT_READ_CR10              0xA
     93# define SVM_EXIT_READ_CR11              0xB
     94# define SVM_EXIT_READ_CR12              0xC
     95# define SVM_EXIT_READ_CR13              0xD
     96# define SVM_EXIT_READ_CR14              0xE
     97# define SVM_EXIT_READ_CR15              0xF
    9298/** Writes to CR0-CR15. */
    93 #define SVM_EXIT_WRITE_CR0              0x10
    94 #define SVM_EXIT_WRITE_CR1              0x11
    95 #define SVM_EXIT_WRITE_CR2              0x12
    96 #define SVM_EXIT_WRITE_CR3              0x13
    97 #define SVM_EXIT_WRITE_CR4              0x14
    98 #define SVM_EXIT_WRITE_CR5              0x15
    99 #define SVM_EXIT_WRITE_CR6              0x16
    100 #define SVM_EXIT_WRITE_CR7              0x17
    101 #define SVM_EXIT_WRITE_CR8              0x18
    102 #define SVM_EXIT_WRITE_CR9              0x19
    103 #define SVM_EXIT_WRITE_CR10             0x1A
    104 #define SVM_EXIT_WRITE_CR11             0x1B
    105 #define SVM_EXIT_WRITE_CR12             0x1C
    106 #define SVM_EXIT_WRITE_CR13             0x1D
    107 #define SVM_EXIT_WRITE_CR14             0x1E
    108 #define SVM_EXIT_WRITE_CR15             0x1F
     99# define SVM_EXIT_WRITE_CR0              0x10
     100# define SVM_EXIT_WRITE_CR1              0x11
     101# define SVM_EXIT_WRITE_CR2              0x12
     102# define SVM_EXIT_WRITE_CR3              0x13
     103# define SVM_EXIT_WRITE_CR4              0x14
     104# define SVM_EXIT_WRITE_CR5              0x15
     105# define SVM_EXIT_WRITE_CR6              0x16
     106# define SVM_EXIT_WRITE_CR7              0x17
     107# define SVM_EXIT_WRITE_CR8              0x18
     108# define SVM_EXIT_WRITE_CR9              0x19
     109# define SVM_EXIT_WRITE_CR10             0x1A
     110# define SVM_EXIT_WRITE_CR11             0x1B
     111# define SVM_EXIT_WRITE_CR12             0x1C
     112# define SVM_EXIT_WRITE_CR13             0x1D
     113# define SVM_EXIT_WRITE_CR14             0x1E
     114# define SVM_EXIT_WRITE_CR15             0x1F
    109115/** Read from DR0-DR15. */
    110 #define SVM_EXIT_READ_DR0               0x20
    111 #define SVM_EXIT_READ_DR1               0x21
    112 #define SVM_EXIT_READ_DR2               0x22
    113 #define SVM_EXIT_READ_DR3               0x23
    114 #define SVM_EXIT_READ_DR4               0x24
    115 #define SVM_EXIT_READ_DR5               0x25
    116 #define SVM_EXIT_READ_DR6               0x26
    117 #define SVM_EXIT_READ_DR7               0x27
    118 #define SVM_EXIT_READ_DR8               0x28
    119 #define SVM_EXIT_READ_DR9               0x29
    120 #define SVM_EXIT_READ_DR10              0x2A
    121 #define SVM_EXIT_READ_DR11              0x2B
    122 #define SVM_EXIT_READ_DR12              0x2C
    123 #define SVM_EXIT_READ_DR13              0x2D
    124 #define SVM_EXIT_READ_DR14              0x2E
    125 #define SVM_EXIT_READ_DR15              0x2F
     116# define SVM_EXIT_READ_DR0               0x20
     117# define SVM_EXIT_READ_DR1               0x21
     118# define SVM_EXIT_READ_DR2               0x22
     119# define SVM_EXIT_READ_DR3               0x23
     120# define SVM_EXIT_READ_DR4               0x24
     121# define SVM_EXIT_READ_DR5               0x25
     122# define SVM_EXIT_READ_DR6               0x26
     123# define SVM_EXIT_READ_DR7               0x27
     124# define SVM_EXIT_READ_DR8               0x28
     125# define SVM_EXIT_READ_DR9               0x29
     126# define SVM_EXIT_READ_DR10              0x2A
     127# define SVM_EXIT_READ_DR11              0x2B
     128# define SVM_EXIT_READ_DR12              0x2C
     129# define SVM_EXIT_READ_DR13              0x2D
     130# define SVM_EXIT_READ_DR14              0x2E
     131# define SVM_EXIT_READ_DR15              0x2F
    126132/** Writes to DR0-DR15. */
    127 #define SVM_EXIT_WRITE_DR0              0x30
    128 #define SVM_EXIT_WRITE_DR1              0x31
    129 #define SVM_EXIT_WRITE_DR2              0x32
    130 #define SVM_EXIT_WRITE_DR3              0x33
    131 #define SVM_EXIT_WRITE_DR4              0x34
    132 #define SVM_EXIT_WRITE_DR5              0x35
    133 #define SVM_EXIT_WRITE_DR6              0x36
    134 #define SVM_EXIT_WRITE_DR7              0x37
    135 #define SVM_EXIT_WRITE_DR8              0x38
    136 #define SVM_EXIT_WRITE_DR9              0x39
    137 #define SVM_EXIT_WRITE_DR10             0x3A
    138 #define SVM_EXIT_WRITE_DR11             0x3B
    139 #define SVM_EXIT_WRITE_DR12             0x3C
    140 #define SVM_EXIT_WRITE_DR13             0x3D
    141 #define SVM_EXIT_WRITE_DR14             0x3E
    142 #define SVM_EXIT_WRITE_DR15             0x3F
     133# define SVM_EXIT_WRITE_DR0              0x30
     134# define SVM_EXIT_WRITE_DR1              0x31
     135# define SVM_EXIT_WRITE_DR2              0x32
     136# define SVM_EXIT_WRITE_DR3              0x33
     137# define SVM_EXIT_WRITE_DR4              0x34
     138# define SVM_EXIT_WRITE_DR5              0x35
     139# define SVM_EXIT_WRITE_DR6              0x36
     140# define SVM_EXIT_WRITE_DR7              0x37
     141# define SVM_EXIT_WRITE_DR8              0x38
     142# define SVM_EXIT_WRITE_DR9              0x39
     143# define SVM_EXIT_WRITE_DR10             0x3A
     144# define SVM_EXIT_WRITE_DR11             0x3B
     145# define SVM_EXIT_WRITE_DR12             0x3C
     146# define SVM_EXIT_WRITE_DR13             0x3D
     147# define SVM_EXIT_WRITE_DR14             0x3E
     148# define SVM_EXIT_WRITE_DR15             0x3F
    143149/* Exception 0-31. */
    144 #define SVM_EXIT_EXCEPTION_0            0x40
    145 #define SVM_EXIT_EXCEPTION_1            0x41
    146 #define SVM_EXIT_EXCEPTION_2            0x42
    147 #define SVM_EXIT_EXCEPTION_3            0x43
    148 #define SVM_EXIT_EXCEPTION_4            0x44
    149 #define SVM_EXIT_EXCEPTION_5            0x45
    150 #define SVM_EXIT_EXCEPTION_6            0x46
    151 #define SVM_EXIT_EXCEPTION_7            0x47
    152 #define SVM_EXIT_EXCEPTION_8            0x48
    153 #define SVM_EXIT_EXCEPTION_9            0x49
    154 #define SVM_EXIT_EXCEPTION_A            0x4A
    155 #define SVM_EXIT_EXCEPTION_B            0x4B
    156 #define SVM_EXIT_EXCEPTION_C            0x4C
    157 #define SVM_EXIT_EXCEPTION_D            0x4D
    158 #define SVM_EXIT_EXCEPTION_E            0x4E
    159 #define SVM_EXIT_EXCEPTION_F            0x4F
    160 #define SVM_EXIT_EXCEPTION_10           0x50
    161 #define SVM_EXIT_EXCEPTION_11           0x51
    162 #define SVM_EXIT_EXCEPTION_12           0x52
    163 #define SVM_EXIT_EXCEPTION_13           0x53
    164 #define SVM_EXIT_EXCEPTION_14           0x54
    165 #define SVM_EXIT_EXCEPTION_15           0x55
    166 #define SVM_EXIT_EXCEPTION_16           0x56
    167 #define SVM_EXIT_EXCEPTION_17           0x57
    168 #define SVM_EXIT_EXCEPTION_18           0x58
    169 #define SVM_EXIT_EXCEPTION_19           0x59
    170 #define SVM_EXIT_EXCEPTION_1A           0x5A
    171 #define SVM_EXIT_EXCEPTION_1B           0x5B
    172 #define SVM_EXIT_EXCEPTION_1C           0x5C
    173 #define SVM_EXIT_EXCEPTION_1D           0x5D
    174 #define SVM_EXIT_EXCEPTION_1E           0x5E
    175 #define SVM_EXIT_EXCEPTION_1F           0x5F
     150# define SVM_EXIT_EXCEPTION_0            0x40
     151# define SVM_EXIT_EXCEPTION_1            0x41
     152# define SVM_EXIT_EXCEPTION_2            0x42
     153# define SVM_EXIT_EXCEPTION_3            0x43
     154# define SVM_EXIT_EXCEPTION_4            0x44
     155# define SVM_EXIT_EXCEPTION_5            0x45
     156# define SVM_EXIT_EXCEPTION_6            0x46
     157# define SVM_EXIT_EXCEPTION_7            0x47
     158# define SVM_EXIT_EXCEPTION_8            0x48
     159# define SVM_EXIT_EXCEPTION_9            0x49
     160# define SVM_EXIT_EXCEPTION_A            0x4A
     161# define SVM_EXIT_EXCEPTION_B            0x4B
     162# define SVM_EXIT_EXCEPTION_C            0x4C
     163# define SVM_EXIT_EXCEPTION_D            0x4D
     164# define SVM_EXIT_EXCEPTION_E            0x4E
     165# define SVM_EXIT_EXCEPTION_F            0x4F
     166# define SVM_EXIT_EXCEPTION_10           0x50
     167# define SVM_EXIT_EXCEPTION_11           0x51
     168# define SVM_EXIT_EXCEPTION_12           0x52
     169# define SVM_EXIT_EXCEPTION_13           0x53
     170# define SVM_EXIT_EXCEPTION_14           0x54
     171# define SVM_EXIT_EXCEPTION_15           0x55
     172# define SVM_EXIT_EXCEPTION_16           0x56
     173# define SVM_EXIT_EXCEPTION_17           0x57
     174# define SVM_EXIT_EXCEPTION_18           0x58
     175# define SVM_EXIT_EXCEPTION_19           0x59
     176# define SVM_EXIT_EXCEPTION_1A           0x5A
     177# define SVM_EXIT_EXCEPTION_1B           0x5B
     178# define SVM_EXIT_EXCEPTION_1C           0x5C
     179# define SVM_EXIT_EXCEPTION_1D           0x5D
     180# define SVM_EXIT_EXCEPTION_1E           0x5E
     181# define SVM_EXIT_EXCEPTION_1F           0x5F
    176182/** Physical maskable interrupt. */
    177 #define SVM_EXIT_INTR                   0x60
     183# define SVM_EXIT_INTR                   0x60
    178184/** Non-maskable interrupt. */
    179 #define SVM_EXIT_NMI                    0x61
     185# define SVM_EXIT_NMI                    0x61
    180186/** System Management interrupt. */
    181 #define SVM_EXIT_SMI                    0x62
     187# define SVM_EXIT_SMI                    0x62
    182188/** Physical INIT signal. */
    183 #define SVM_EXIT_INIT                   0x63
     189# define SVM_EXIT_INIT                   0x63
    184190/** Virtual interrupt. */
    185 #define SVM_EXIT_VINTR                  0x64
     191# define SVM_EXIT_VINTR                  0x64
    186192/** Write to CR0 that changed any bits other than CR0.TS or CR0.MP. */
    187 #define SVM_EXIT_CR0_SEL_WRITE          0x65
     193# define SVM_EXIT_CR0_SEL_WRITE          0x65
    188194/** IDTR read. */
    189 #define SVM_EXIT_IDTR_READ              0x66
     195# define SVM_EXIT_IDTR_READ              0x66
    190196/** GDTR read. */
    191 #define SVM_EXIT_GDTR_READ              0x67
     197# define SVM_EXIT_GDTR_READ              0x67
    192198/** LDTR read. */
    193 #define SVM_EXIT_LDTR_READ              0x68
     199# define SVM_EXIT_LDTR_READ              0x68
    194200/** TR read. */
    195 #define SVM_EXIT_TR_READ                0x69
     201# define SVM_EXIT_TR_READ                0x69
    196202/** IDTR write. */
    197 #define SVM_EXIT_IDTR_WRITE             0x6A
     203# define SVM_EXIT_IDTR_WRITE             0x6A
    198204/** GDTR write. */
    199 #define SVM_EXIT_GDTR_WRITE             0x6B
     205# define SVM_EXIT_GDTR_WRITE             0x6B
    200206/** LDTR write. */
    201 #define SVM_EXIT_LDTR_WRITE             0x6C
     207# define SVM_EXIT_LDTR_WRITE             0x6C
    202208/** TR write. */
    203 #define SVM_EXIT_TR_WRITE               0x6D
     209# define SVM_EXIT_TR_WRITE               0x6D
    204210/** RDTSC instruction. */
    205 #define SVM_EXIT_RDTSC                  0x6E
     211# define SVM_EXIT_RDTSC                  0x6E
    206212/** RDPMC instruction. */
    207 #define SVM_EXIT_RDPMC                  0x6F
     213# define SVM_EXIT_RDPMC                  0x6F
    208214/** PUSHF instruction. */
    209 #define SVM_EXIT_PUSHF                  0x70
     215# define SVM_EXIT_PUSHF                  0x70
    210216/** POPF instruction. */
    211 #define SVM_EXIT_POPF                   0x71
     217# define SVM_EXIT_POPF                   0x71
    212218/** CPUID instruction. */
    213 #define SVM_EXIT_CPUID                  0x72
     219# define SVM_EXIT_CPUID                  0x72
    214220/** RSM instruction. */
    215 #define SVM_EXIT_RSM                    0x73
     221# define SVM_EXIT_RSM                    0x73
    216222/** IRET instruction. */
    217 #define SVM_EXIT_IRET                   0x74
     223# define SVM_EXIT_IRET                   0x74
    218224/** software interrupt (INTn instructions). */
    219 #define SVM_EXIT_SWINT                  0x75
     225# define SVM_EXIT_SWINT                  0x75
    220226/** INVD instruction. */
    221 #define SVM_EXIT_INVD                   0x76
     227# define SVM_EXIT_INVD                   0x76
    222228/** PAUSE instruction. */
    223 #define SVM_EXIT_PAUSE                  0x77
     229# define SVM_EXIT_PAUSE                  0x77
    224230/** HLT instruction. */
    225 #define SVM_EXIT_HLT                    0x78
     231# define SVM_EXIT_HLT                    0x78
    226232/** INVLPG instructions. */
    227 #define SVM_EXIT_INVLPG                 0x79
     233# define SVM_EXIT_INVLPG                 0x79
    228234/** INVLPGA instruction. */
    229 #define SVM_EXIT_INVLPGA                0x7A
     235# define SVM_EXIT_INVLPGA                0x7A
    230236/** IN or OUT accessing protected port (the EXITINFO1 field provides more information). */
    231 #define SVM_EXIT_IOIO                   0x7B
     237# define SVM_EXIT_IOIO                   0x7B
    232238/** RDMSR or WRMSR access to protected MSR. */
    233 #define SVM_EXIT_MSR                    0x7C
     239# define SVM_EXIT_MSR                    0x7C
    234240/** task switch. */
    235 #define SVM_EXIT_TASK_SWITCH            0x7D
     241# define SVM_EXIT_TASK_SWITCH            0x7D
    236242/** FP legacy handling enabled, and processor is frozen in an x87/mmx instruction waiting for an interrupt. */
    237 #define SVM_EXIT_FERR_FREEZE            0x7E
     243# define SVM_EXIT_FERR_FREEZE            0x7E
    238244/** Shutdown. */
    239 #define SVM_EXIT_SHUTDOWN               0x7F
     245# define SVM_EXIT_SHUTDOWN               0x7F
    240246/** VMRUN instruction. */
    241 #define SVM_EXIT_VMRUN                  0x80
     247# define SVM_EXIT_VMRUN                  0x80
    242248/** VMMCALL instruction. */
    243 #define SVM_EXIT_VMMCALL                0x81
     249# define SVM_EXIT_VMMCALL                0x81
    244250/** VMLOAD instruction. */
    245 #define SVM_EXIT_VMLOAD                 0x82
     251# define SVM_EXIT_VMLOAD                 0x82
    246252/** VMSAVE instruction. */
    247 #define SVM_EXIT_VMSAVE                 0x83
     253# define SVM_EXIT_VMSAVE                 0x83
    248254/** STGI instruction. */
    249 #define SVM_EXIT_STGI                   0x84
     255# define SVM_EXIT_STGI                   0x84
    250256/** CLGI instruction. */
    251 #define SVM_EXIT_CLGI                   0x85
     257# define SVM_EXIT_CLGI                   0x85
    252258/** SKINIT instruction. */
    253 #define SVM_EXIT_SKINIT                 0x86
     259# define SVM_EXIT_SKINIT                 0x86
    254260/** RDTSCP instruction. */
    255 #define SVM_EXIT_RDTSCP                 0x87
     261# define SVM_EXIT_RDTSCP                 0x87
    256262/** ICEBP instruction. */
    257 #define SVM_EXIT_ICEBP                  0x88
     263# define SVM_EXIT_ICEBP                  0x88
    258264/** WBINVD instruction. */
    259 #define SVM_EXIT_WBINVD                 0x89
     265# define SVM_EXIT_WBINVD                 0x89
    260266/** MONITOR instruction. */
    261 #define SVM_EXIT_MONITOR                0x8A
     267# define SVM_EXIT_MONITOR                0x8A
    262268/** MWAIT instruction. */
    263 #define SVM_EXIT_MWAIT                  0x8B
     269# define SVM_EXIT_MWAIT                  0x8B
    264270/** MWAIT instruction, when armed. */
    265 #define SVM_EXIT_MWAIT_ARMED            0x8C
     271# define SVM_EXIT_MWAIT_ARMED            0x8C
    266272/** XSETBV instruction. */
    267 #define SVM_EXIT_XSETBV                 0x8D
     273# define SVM_EXIT_XSETBV                 0x8D
    268274/** Nested paging: host-level page fault occurred (EXITINFO1 contains fault errorcode; EXITINFO2 contains the guest physical address causing the fault). */
    269 #define SVM_EXIT_NPF                    0x400
     275# define SVM_EXIT_NPF                    0x400
    270276/** AVIC: Virtual IPI delivery not completed. */
    271 #define SVM_EXIT_AVIC_INCOMPLETE_IPI    0x401
     277# define SVM_EXIT_AVIC_INCOMPLETE_IPI    0x401
    272278/** AVIC: Attempted access by guest to a vAPIC register not handled by AVIC
    273279 *  hardware. */
    274 #define SVM_EXIT_AVIC_NOACCEL           0x402
    275 
     280# define SVM_EXIT_AVIC_NOACCEL           0x402
    276281/** The maximum possible exit value. */
    277 #define SVM_EXIT_MAX                    (SVM_EXIT_AVIC_NOACCEL)
    278 /** @} */
     282# define SVM_EXIT_MAX                    (SVM_EXIT_AVIC_NOACCEL)
     283/** @} */
     284#endif /* !IN_REM_R3*/
    279285
    280286
     
    283289 */
    284290/** Set to 1 if the task switch was caused by an IRET; else cleared to 0. */
    285 #define SVM_EXIT2_TASK_SWITCH_IRET            RT_BIT_64(36)
     291# define SVM_EXIT2_TASK_SWITCH_IRET            RT_BIT_64(36)
    286292/** Set to 1 if the task switch was caused by a far jump; else cleared to 0. */
    287 #define SVM_EXIT2_TASK_SWITCH_JMP             RT_BIT_64(38)
     293# define SVM_EXIT2_TASK_SWITCH_JMP             RT_BIT_64(38)
    288294/** Set to 1 if the task switch has an error code; else cleared to 0. */
    289 #define SVM_EXIT2_TASK_SWITCH_HAS_ERROR_CODE  RT_BIT_64(44)
     295# define SVM_EXIT2_TASK_SWITCH_HAS_ERROR_CODE  RT_BIT_64(44)
    290296/** The value of EFLAGS.RF that would be saved in the outgoing TSS if the task switch were not intercepted. */
    291 #define SVM_EXIT2_TASK_SWITCH_EFLAGS_RF       RT_BIT_64(48)
     297# define SVM_EXIT2_TASK_SWITCH_EFLAGS_RF       RT_BIT_64(48)
    292298/** @} */
    293299
     
    296302 */
    297303/** The access was a read MSR. */
    298 #define SVM_EXIT1_MSR_READ                    0x0
     304# define SVM_EXIT1_MSR_READ                    0x0
    299305/** The access was a write MSR. */
    300 #define SVM_EXIT1_MSR_WRITE                   0x1
     306# define SVM_EXIT1_MSR_WRITE                   0x1
    301307/** @} */
    302308
  • trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp

    r66015 r66040  
    179179 *
    180180 * @returns Strict VBox status code (i.e. informational status codes too).
    181  *
    182181 * @param   pVCpu               The cross context virtual CPU structure.
    183182 * @param   pCtx                Pointer to the guest-CPU context.
    184  * @param   pVmcb               The VMCB of the nested-guest.
    185  * @param   pHostState          The host-state save area in the guest.
    186  */
    187 VMM_INT_DECL(VBOXSTRICTRC) HMSvmVmrun(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMVMCB pVmcb, PSVMHOSTSTATE pHostState)
    188 {
    189     Assert(pHostState);
    190     Assert(pVmcb);
    191 
    192     /*
    193      * Save host state.
    194      */
    195     pHostState->es       = pCtx->es;
    196     pHostState->cs       = pCtx->cs;
    197     pHostState->ss       = pCtx->ss;
    198     pHostState->ds       = pCtx->ds;
    199     pHostState->gdtr     = pCtx->gdtr;
    200     pHostState->idtr     = pCtx->idtr;
    201     pHostState->uEferMsr = pCtx->msrEFER;
    202     pHostState->uCr0     = pCtx->cr0;
    203     pHostState->uCr3     = pCtx->cr3;
    204     pHostState->uCr4     = pCtx->cr4;
    205     pHostState->rflags   = pCtx->rflags;
    206     pHostState->uRip     = pCtx->rip;
    207     pHostState->uRsp     = pCtx->rsp;
    208     pHostState->uRax     = pCtx->rax;
    209 
    210     /*
    211      * Load controls from VMCB.
    212      */
    213     pCtx->hwvirt.svm.u16InterceptRdCRx = pVmcb->ctrl.u16InterceptRdCRx;
    214     pCtx->hwvirt.svm.u16InterceptWrCRx = pVmcb->ctrl.u16InterceptWrCRx;
    215     pCtx->hwvirt.svm.u16InterceptRdDRx = pVmcb->ctrl.u16InterceptRdDRx;
    216     pCtx->hwvirt.svm.u16InterceptWrDRx = pVmcb->ctrl.u16InterceptWrDRx;
    217     pCtx->hwvirt.svm.u64InterceptCtrl  = pVmcb->ctrl.u64InterceptCtrl;
    218     pCtx->hwvirt.svm.u32InterceptXcpt  = pVmcb->ctrl.u32InterceptXcpt;
    219     if (!(pVmcb->ctrl.u64InterceptCtrl & SVM_CTRL_INTERCEPT_VMRUN))
    220     {
    221         Log(("HMSvmVmRun: VMRUN instruction not intercepted -> #VMEXIT\n"));
    222         return HMSvmNstGstVmExit(pVCpu, pCtx, SVM_EXIT_INVALID, 0 /* uExitInfo1 */, 0 /* uExitInfo2 */);
    223     }
    224     if (!pVmcb->ctrl.TLBCtrl.n.u32ASID)
    225     {
    226         Log(("HMSvmVmRun: Guest ASID is invalid -> #VMEXIT\n"));
    227         return HMSvmNstGstVmExit(pVCpu, pCtx, SVM_EXIT_INVALID, 0 /* uExitInfo1 */, 0 /* uExitInfo2 */);
    228     }
    229 
    230 
    231     /** @todo the rest. */
    232 
    233     return VERR_NOT_IMPLEMENTED;
     183 * @param   GCPhysVmcb          Guest physical address of the VMCB to run.
     184 */
     185VMM_INT_DECL(VBOXSTRICTRC) HMSvmVmrun(PVMCPU pVCpu, PCPUMCTX pCtx, RTGCPHYS GCPhysVmcb)
     186{
     187    Assert(pVCpu);
     188    Assert(pCtx);
     189
     190    /*
     191     * Cache the physical address of the VMCB for #VMEXIT exceptions.
     192     */
     193    pCtx->hwvirt.svm.GCPhysVmcb = GCPhysVmcb;
     194
     195    SVMVMCB Vmcb;
     196    PVM pVM = pVCpu->CTX_SUFF(pVM);
     197    int rc = PGMPhysSimpleReadGCPhys(pVM, &Vmcb, GCPhysVmcb, X86_PAGE_4K_SIZE);
     198    if (RT_SUCCESS(rc))
     199    {
     200        /*
     201         * Save host state.
     202         */
     203        PSVMHOSTSTATE pHostState = &pCtx->hwvirt.svm.HostState;
     204        pHostState->es       = pCtx->es;
     205        pHostState->cs       = pCtx->cs;
     206        pHostState->ss       = pCtx->ss;
     207        pHostState->ds       = pCtx->ds;
     208        pHostState->gdtr     = pCtx->gdtr;
     209        pHostState->idtr     = pCtx->idtr;
     210        pHostState->uEferMsr = pCtx->msrEFER;
     211        pHostState->uCr0     = pCtx->cr0;
     212        pHostState->uCr3     = pCtx->cr3;
     213        pHostState->uCr4     = pCtx->cr4;
     214        pHostState->rflags   = pCtx->rflags;
     215        pHostState->uRip     = pCtx->rip;
     216        pHostState->uRsp     = pCtx->rsp;
     217        pHostState->uRax     = pCtx->rax;
     218
     219        /*
     220         * Cache the VMCB controls.
     221         */
     222        pCtx->hwvirt.svm.VmcbCtrl = Vmcb.ctrl;
     223
     224        /*
     225         * Validate the VMCB controls.
     226         */
     227        if (!CPUMIsGuestSvmCtrlInterceptSet(pCtx, SVM_CTRL_INTERCEPT_VMRUN))
     228        {
     229            Log(("HMSvmVmRun: VMRUN instruction not intercepted -> #VMEXIT\n"));
     230            return HMSvmNstGstVmExit(pVCpu, pCtx, SVM_EXIT_INVALID, 0 /* uExitInfo1 */, 0 /* uExitInfo2 */);
     231        }
     232        if (    pCtx->hwvirt.svm.VmcbCtrl.NestedPaging.n.u1NestedPaging
     233            && !pVM->cpum.ro.GuestFeatures.svm.feat.n.fNestedPaging)
     234        {
     235            Log(("HMSvmVmRun: Nested paging not supported -> #VMEXIT\n"));
     236            return HMSvmNstGstVmExit(pVCpu, pCtx, SVM_EXIT_INVALID, 0 /* uExitInfo1 */, 0 /* uExitInfo2 */);
     237        }
     238        if (!pCtx->hwvirt.svm.VmcbCtrl.TLBCtrl.n.u32ASID)
     239        {
     240            Log(("HMSvmVmRun: Guest ASID is invalid -> #VMEXIT\n"));
     241            return HMSvmNstGstVmExit(pVCpu, pCtx, SVM_EXIT_INVALID, 0 /* uExitInfo1 */, 0 /* uExitInfo2 */);
     242        }
     243
     244        /** @todo the rest. */
     245
     246        return VERR_NOT_IMPLEMENTED;
     247    }
     248
     249    return rc;
    234250}
    235251
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h

    r66015 r66040  
    59005900#endif
    59015901
    5902     void *pvVmcb;
    5903     PGMPAGEMAPLOCK PgLockVmcb;
    5904     VBOXSTRICTRC rcStrict = iemMemPageMap(pVCpu, GCPhysVmcb, IEM_ACCESS_DATA_RW, &pvVmcb, &PgLockVmcb);
    5905     if (rcStrict == VINF_SUCCESS)
    5906     {
    5907         pCtx->hwvirt.svm.GCPhysNstGstVmcb = GCPhysVmcb;
    5908 
    5909         RTGCPHYS GCPhysHostState = pCtx->hwvirt.svm.uMsrHSavePa;
    5910         /** @todo SVM does not validate the host-state area beyond checking the
    5911          *        alignment and range of the physical address. Nothing to prevent users
    5912          *        from using MMIO or other weird stuff in which case anything might
    5913          *        happen. */
    5914         void *pvHostState;
    5915         PGMPAGEMAPLOCK PgLockHostState;
    5916         rcStrict = iemMemPageMap(pVCpu, GCPhysHostState, IEM_ACCESS_DATA_RW, &pvHostState, &PgLockHostState);
    5917         if (rcStrict == VINF_SUCCESS)
    5918         {
    5919             PSVMHOSTSTATE pHostState = (PSVMHOSTSTATE)pvHostState;
    5920             PSVMVMCB      pVmcb      = (PSVMVMCB)pvVmcb;
    5921             rcStrict = HMSvmVmrun(pVCpu, pCtx, pVmcb, pHostState);
    5922 
    5923             iemMemPageUnmap(pVCpu, GCPhysHostState, IEM_ACCESS_DATA_RW, pvHostState, &PgLockHostState);
    5924         }
    5925         iemMemPageUnmap(pVCpu, GCPhysVmcb, IEM_ACCESS_DATA_RW, pvVmcb, &PgLockVmcb);
    5926     }
     5902    rcStrict = HMSvmVmrun(pVCpu, pCtx, );
    59275903    RT_NOREF(cbInstr);
    59285904    return rcStrict;
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp

    r65905 r66040  
    16801680            pFeatures->fXop             = RT_BOOL(pExtLeaf->uEcx & X86_CPUID_AMD_FEATURE_ECX_XOP);
    16811681            pFeatures->fSvm             = RT_BOOL(pExtLeaf->uEcx & X86_CPUID_AMD_FEATURE_ECX_SVM);
     1682            if (pFeatures->fSvm)
     1683            {
     1684                PCCPUMCPUIDLEAF pSvmLeaf = cpumR3CpuIdFindLeaf(paLeaves, cLeaves, 0x8000000a);
     1685                AssertLogRelReturn(pSvmLeaf, VERR_CPUM_IPE_1);
     1686                pFeatures->svm.feat.u   = pSvmLeaf->uEdx;
     1687                pFeatures->svm.uMaxAsid = pSvmLeaf->uEbx;
     1688            }
    16821689        }
    16831690
     
    33633370        pSvmFeatureLeaf->uEbx = 0x8000;     /** @todo figure out virtual NASID. */
    33643371        pSvmFeatureLeaf->uEcx = 0;
    3365         pSvmFeatureLeaf->uEdx = 0; /** @todo Support SVM features */
     3372        pSvmFeatureLeaf->uEdx = 0;          /** @todo Support SVM features */
    33663373    }
    33673374    else
  • trunk/src/VBox/VMM/include/CPUMInternal.mac

    r66000 r66040  
    231231    .Guest.abPadding          resb    12
    232232%endif
    233     .Guest.hwvirt.svm.uMsrHSavePa         resq    1
    234     .Guest.hwvirt.svm.u64InterceptCtrl    resq    1
    235     .Guest.hwvirt.svm.u32InterceptXcpt    resd    1
    236     .Guest.hwvirt.svm.u16InterceptRdCRx   resw    1
    237     .Guest.hwvirt.svm.u16InterceptWrCRx   resw    1
    238     .Guest.hwvirt.svm.u16InterceptRdDRx   resw    1
    239     .Guest.hwvirt.svm.u16InterceptWrDRx   resw    1
    240     .Guest.hwvirt.svm.fGif                resb    1
    241     .Guest.hwvirt.svm.abPadding           resb    3
    242     .Guest.hwvirt.svm.GCPhysNstGstVmcb    resq    1
     233    .Guest.hwvirt.svm.uMsrHSavePa    resq    1
     234    .Guest.hwvirt.svm.GCPhysVmcb     resq    1
     235    .Guest.hwvirt.svm.VmcbCtrl       resb  256
     236    .Guest.hwvirt.svm.HostState      resb  184
     237    .Guest.hwvirt.svm.fGif           resb    1
    243238    alignb 64
    244239
     
    504499    .Hyper.abPadding          resb    12
    505500%endif
    506     .Hyper.hwvirt.svm.uMsrHSavePa         resq    1
    507     .Hyper.hwvirt.svm.u64InterceptCtrl    resq    1
    508     .Hyper.hwvirt.svm.u32InterceptXcpt    resd    1
    509     .Hyper.hwvirt.svm.u16InterceptRdCRx   resw    1
    510     .Hyper.hwvirt.svm.u16InterceptWrCRx   resw    1
    511     .Hyper.hwvirt.svm.u16InterceptRdDRx   resw    1
    512     .Hyper.hwvirt.svm.u16InterceptWrDRx   resw    1
    513     .Hyper.hwvirt.svm.fGif                resb    1
    514     .Hyper.hwvirt.svm.abPadding           resb    3
    515     .Hyper.hwvirt.svm.GCPhysNstGstVmcb    resq    1
     501    .Hyper.hwvirt.svm.uMsrHSavePa    resq    1
     502    .Hyper.hwvirt.svm.GCPhysVmcb     resq    1
     503    .Hyper.hwvirt.svm.VmcbCtrl       resb  256
     504    .Hyper.hwvirt.svm.HostState      resb  184
     505    .Hyper.hwvirt.svm.fGif           resb    1
    516506    alignb 64
    517507
  • trunk/src/VBox/VMM/testcase/tstVMStruct.h

    r65904 r66040  
    133133    GEN_CHECK_OFF(CPUMCTX, hwvirt);
    134134    GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.uMsrHSavePa);
     135    GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.GCPhysVmcb);
     136    GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.VmcbCtrl);
     137    GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.HostState);
    135138    GEN_CHECK_OFF(CPUMCTX, hwvirt.svm.fGif);
    136139    /** @todo add rest of hwvirt fields when code is more
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