VirtualBox

Changeset 95371 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 24, 2022 11:11:42 PM (3 years ago)
Author:
vboxsync
Message:

bs3kit: Some work on extended CPU/FPU state management, making the saving/restoring work in v8086 and non-ring0 modes. Added system calls for setting and getting XCR0 from non-ring-0 contexts. Fixed broken Bs3RegSetCr4. bugref:9898

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
12 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r93115 r95371  
    138138       bs3-cmn-RegGetLdtr.asm \
    139139       bs3-cmn-RegSetLdtr.asm \
     140       bs3-cmn-RegGetXcr0.asm \
     141       bs3-cmn-RegGetXcr0Asm.asm \
     142       bs3-cmn-RegSetXcr0.asm \
    140143       bs3-cmn-ExtCtxInit.c \
    141144       bs3-cmn-ExtCtxSave.asm \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxInit.c

    r93115 r95371  
    3737{
    3838    Bs3MemSet(pExtCtx, 0, cbExtCtx);
     39
    3940    if (cbExtCtx >= RT_UOFFSETOF(BS3EXTCTX, Ctx) + sizeof(X86FXSTATE) + sizeof(X86XSAVEHDR))
    4041    {
     
    4243        pExtCtx->enmMethod = BS3EXTCTXMETHOD_XSAVE;
    4344        pExtCtx->Ctx.x.Hdr.bmXState = fFlags;
     45
     46        /* Setting bit 6 (0x40) here as it kept sneaking in when loading/saving state in 16-bit and v8086 mode. */
     47        pExtCtx->Ctx.x.x87.FCW        = X86_FCW_RC_NEAREST | X86_FCW_PC_64 /* go figure:*/ | RT_BIT(6);
     48        pExtCtx->Ctx.x.x87.MXCSR      = X86_MXCSR_RC_NEAREST;
     49        pExtCtx->Ctx.x.x87.MXCSR_MASK = 0xffff;
    4450    }
    4551    else if (cbExtCtx >= RT_UOFFSETOF(BS3EXTCTX, Ctx) + sizeof(X86FXSTATE))
     
    4753        BS3_ASSERT(fFlags == 0);
    4854        pExtCtx->enmMethod = BS3EXTCTXMETHOD_FXSAVE;
     55        pExtCtx->Ctx.x87.FCW          = X86_FCW_RC_NEAREST | X86_FCW_PC_64 /* go figure:*/ | RT_BIT(6);
     56        pExtCtx->Ctx.x87.MXCSR        = X86_MXCSR_RC_NEAREST;
     57        pExtCtx->Ctx.x87.MXCSR_MASK   = 0xffff;
    4958    }
    5059    else
     
    5362        BS3_ASSERT(cbExtCtx >= RT_UOFFSETOF(BS3EXTCTX, Ctx) + sizeof(X86FPUSTATE));
    5463        pExtCtx->enmMethod = BS3EXTCTXMETHOD_ANCIENT;
     64        pExtCtx->Ctx.Ancient.FCW      = X86_FCW_RC_NEAREST | X86_FCW_PC_64 /* go figure:*/ | RT_BIT(6);
     65        pExtCtx->Ctx.Ancient.FTW      = UINT16_MAX;  /* all registers empty */
    5566    }
     67
    5668    pExtCtx->cb             = cbExtCtx;
    5769    pExtCtx->u16Magic       = BS3EXTCTX_MAGIC;
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxRestore.asm

    r93115 r95371  
    2626
    2727%include "bs3kit-template-header.mac"
     28
     29extern BS3_CMN_NM(Bs3RegSetXcr0)
    2830
    2931
     
    6264
    6365.do_16_xsave:
    64         xor     ecx, ecx
     66        push    dword [es:bx + BS3EXTCTX.fXcr0Nominal + 4]
     67        push    dword [es:bx + BS3EXTCTX.fXcr0Nominal]
     68        call    BS3_CMN_NM(Bs3RegSetXcr0)
     69
    6570        mov     eax, [es:bx + BS3EXTCTX.fXcr0Nominal]
    6671        mov     edx, [es:bx + BS3EXTCTX.fXcr0Nominal + 4]
    67         xsetbv
    68 
    6972        xrstor  [es:bx + BS3EXTCTX.Ctx]
    7073
    71         mov     eax, [es:bx + BS3EXTCTX.fXcr0Saved]
    72         mov     edx, [es:bx + BS3EXTCTX.fXcr0Saved + 4]
    73         xsetbv
     74        push    dword [es:bx + BS3EXTCTX.fXcr0Saved + 4]
     75        push    dword [es:bx + BS3EXTCTX.fXcr0Saved]
     76        call    BS3_CMN_NM(Bs3RegSetXcr0)
     77
     78        add     xSP, 4 * 2 * 2          ; clean up both calls
    7479        ;jmp     .return
    7580
     
    97102
    98103.do_xsave:
    99         xor     ecx, ecx
     104 %if ARCH_BITS == 32
     105        push    dword [xBX + BS3EXTCTX.fXcr0Nominal + 4]
     106        push    dword [xBX + BS3EXTCTX.fXcr0Nominal]
     107        call    BS3_CMN_NM(Bs3RegSetXcr0)
     108
    100109        mov     eax, [xBX + BS3EXTCTX.fXcr0Nominal]
    101110        mov     edx, [xBX + BS3EXTCTX.fXcr0Nominal + 4]
    102         xsetbv
     111        xrstor  [xBX + BS3EXTCTX.Ctx]
    103112
    104 BONLY32 xrstor  [xBX + BS3EXTCTX.Ctx]
    105 BONLY64 xrstor64 [xBX + BS3EXTCTX.Ctx]
     113        push    dword [xBX + BS3EXTCTX.fXcr0Saved + 4]
     114        push    dword [xBX + BS3EXTCTX.fXcr0Saved]
     115        call    BS3_CMN_NM(Bs3RegSetXcr0)
    106116
    107         mov     eax, [xBX + BS3EXTCTX.fXcr0Saved]
    108         mov     edx, [xBX + BS3EXTCTX.fXcr0Saved + 4]
    109         xsetbv
     117        add     xSP, 4 * 2 * 2          ; clean up both calls
     118 %else
     119        mov     rcx, [xBX + BS3EXTCTX.fXcr0Nominal]
     120        push    rcx                     ; just for reserving parameter dumping space needed by Bs3RegSetXcr0
     121        call    BS3_CMN_NM(Bs3RegSetXcr0)
     122
     123        mov     eax, [xBX + BS3EXTCTX.fXcr0Nominal]
     124        mov     edx, [xBX + BS3EXTCTX.fXcr0Nominal + 4]
     125        xrstor64 [xBX + BS3EXTCTX.Ctx]
     126
     127        mov     rcx, [xBX + BS3EXTCTX.fXcr0Saved]
     128        call    BS3_CMN_NM(Bs3RegSetXcr0)
     129
     130        add     xSP, 8                  ; clean up parameter space
    110131        ;jmp     .return
    111 
     132  %endif
    112133%endif
    113134
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSave.asm

    r93115 r95371  
    2727%include "bs3kit-template-header.mac"
    2828
     29extern BS3_CMN_NM(Bs3RegSetXcr0)
     30extern BS3_CMN_NM(Bs3RegGetXcr0Asm)
    2931
    3032;;
     
    6264
    6365.do_16_xsave:
    64         xor     ecx, ecx
    65         xgetbv
     66        call    BS3_CMN_NM(Bs3RegGetXcr0Asm)
    6667        mov     [es:bx + BS3EXTCTX.fXcr0Saved], eax
    6768        mov     [es:bx + BS3EXTCTX.fXcr0Saved + 4], edx
     69
     70        push    dword [es:bx + BS3EXTCTX.fXcr0Nominal + 4]
     71        push    dword [es:bx + BS3EXTCTX.fXcr0Nominal]
     72        call    BS3_CMN_NM(Bs3RegSetXcr0)
     73
    6874        mov     eax, [es:bx + BS3EXTCTX.fXcr0Nominal]
    6975        mov     edx, [es:bx + BS3EXTCTX.fXcr0Nominal + 4]
    70         xsetbv
    71 
    7276        xsave   [es:bx + BS3EXTCTX.Ctx]
    7377
    74         mov     eax, [es:bx + BS3EXTCTX.fXcr0Saved]
    75         mov     edx, [es:bx + BS3EXTCTX.fXcr0Saved + 4]
    76         xsetbv
     78        push    dword [es:bx + BS3EXTCTX.fXcr0Saved + 4]
     79        push    dword [es:bx + BS3EXTCTX.fXcr0Saved]
     80        call    BS3_CMN_NM(Bs3RegSetXcr0)
     81
     82        add     xSP, 4 * 2 * 2          ; clean up both calls
    7783        ;jmp     .return
    7884
     
    100106
    101107.do_xsave:
    102         xor     ecx, ecx
    103         xgetbv
     108        call    BS3_CMN_NM(Bs3RegGetXcr0Asm)
    104109        mov     [xBX + BS3EXTCTX.fXcr0Saved], eax
    105110        mov     [xBX + BS3EXTCTX.fXcr0Saved + 4], edx
     111
     112 %if ARCH_BITS == 32
     113        push    dword [xBX + BS3EXTCTX.fXcr0Nominal + 4]
     114        push    dword [xBX + BS3EXTCTX.fXcr0Nominal]
     115        call    BS3_CMN_NM(Bs3RegSetXcr0)
     116
    106117        mov     eax, [xBX + BS3EXTCTX.fXcr0Nominal]
    107118        mov     edx, [xBX + BS3EXTCTX.fXcr0Nominal + 4]
    108         xsetbv
     119        xsave   [xBX + BS3EXTCTX.Ctx]
    109120
    110 BONLY32 xsave   [xBX + BS3EXTCTX.Ctx]
    111 BONLY64 xsave64 [xBX + BS3EXTCTX.Ctx]
     121        push    dword [xBX + BS3EXTCTX.fXcr0Saved + 4]
     122        push    dword [xBX + BS3EXTCTX.fXcr0Saved]
     123        call    BS3_CMN_NM(Bs3RegSetXcr0)
    112124
    113         mov     eax, [xBX + BS3EXTCTX.fXcr0Saved]
    114         mov     edx, [xBX + BS3EXTCTX.fXcr0Saved + 4]
    115         xsetbv
     125        add     xSP, 4 * 2 * 2          ; clean up both calls
     126 %else
     127        mov     rcx, [xBX + BS3EXTCTX.fXcr0Nominal]
     128        push    rcx                     ; only to reserve necessary stack space for the Bs3RegSetXcr0 param dump.
     129        call    BS3_CMN_NM(Bs3RegSetXcr0)
     130
     131        mov     eax, [xBX + BS3EXTCTX.fXcr0Nominal]
     132        mov     edx, [xBX + BS3EXTCTX.fXcr0Nominal + 4]
     133        xsave64 [xBX + BS3EXTCTX.Ctx]
     134
     135        mov     rcx, [xBX + BS3EXTCTX.fXcr0Saved]
     136        call    BS3_CMN_NM(Bs3RegSetXcr0)
     137
     138        add     xSP, 8h                 ; clean up
     139 %endif
    116140        ;jmp     .return
    117141
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetXcr0.asm

    r95361 r95371  
    11; $Id$
    22;; @file
    3 ; BS3Kit - Bs3RegGetCr0
     3; BS3Kit - Bs3RegGetXcr0
    44;
    55
     
    2828
    2929
    30 BS3_EXTERN_CMN Bs3Panic
    3130BS3_EXTERN_CMN Bs3Syscall
    3231%if TMPL_BITS == 16
     
    3736
    3837;;
    39 ; @cproto   BS3_CMN_PROTO_STUB(RTCCUINTXREG, Bs3RegGetCr0,(void));
     38; @cproto   BS3_CMN_PROTO_STUB(uint64_t, Bs3RegGetXcr0,(void));
    4039;
    4140; @returns  Register value.
    4241; @remarks  Does not require 20h of parameter scratch space in 64-bit mode.
    4342;
    44 ; @uses     No GPRs (only return full register(s)).
     43; @uses     No GPRs, though 16-bit mode the upper 48-bits of rax and rdx are cleared.
    4544;
    46 BS3_PROC_BEGIN_CMN Bs3RegGetCr0, BS3_PBC_HYBRID_SAFE
     45BS3_PROC_BEGIN_CMN Bs3RegGetXcr0, BS3_PBC_HYBRID_SAFE
    4746        BS3_CALL_CONV_PROLOG 0
    4847        push    xBP
    4948        mov     xBP, xSP
     49TONLY64 push    rdx
    5050
    5151%if TMPL_BITS == 16
     
    6262
    6363.direct_access:
    64         mov     sAX, cr0
    65 TONLY16 mov     edx, eax
    66 TONLY16 shr     edx, 16
     64TNOT16  push    sCX
     65        xor     ecx, ecx
     66        xgetbv
     67TNOT16  pop     sCX
    6768        jmp     .return
    6869
    6970.via_system_call:
    70         mov     xAX, BS3_SYSCALL_GET_CRX
    71         mov     dl, 0
     71        mov     xAX, BS3_SYSCALL_GET_XCR0
    7272        call    Bs3Syscall
    7373
    7474.return:
     75%if TMPL_BITS == 16
     76        ; value [dx cx bx ax]
     77        ror     eax, 16
     78        mov     bx, ax
     79        mov     cx, dx
     80        shr     eax, 16
     81        shr     edx, 16
     82%elif TMPL_BITS == 64
     83        mov     eax, eax
     84        shr     rdx, 32
     85        or      rax, rdx
     86        pop     rdx
     87%endif
    7588        pop     xBP
    7689        BS3_CALL_CONV_EPILOG 0
    7790        BS3_HYBRID_RET
    78 BS3_PROC_END_CMN   Bs3RegGetCr0
     91BS3_PROC_END_CMN   Bs3RegGetXcr0
    7992
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegGetXcr0Asm.asm

    r95361 r95371  
    11; $Id$
    22;; @file
    3 ; BS3Kit - Bs3RegGetCr0
     3; BS3Kit - Bs3RegGetXcr0
    44;
    55
     
    2828
    2929
    30 BS3_EXTERN_CMN Bs3Panic
    3130BS3_EXTERN_CMN Bs3Syscall
    3231%if TMPL_BITS == 16
     
    3736
    3837;;
    39 ; @cproto   BS3_CMN_PROTO_STUB(RTCCUINTXREG, Bs3RegGetCr0,(void));
     38; Only callable from assembly.
    4039;
    41 ; @returns  Register value.
     40; @returns  Register value in edx:eax in all modes
    4241; @remarks  Does not require 20h of parameter scratch space in 64-bit mode.
     42; @uses     No GPRs other than return registers.
    4343;
    44 ; @uses     No GPRs (only return full register(s)).
    45 ;
    46 BS3_PROC_BEGIN_CMN Bs3RegGetCr0, BS3_PBC_HYBRID_SAFE
     44BS3_PROC_BEGIN_CMN Bs3RegGetXcr0Asm, BS3_PBC_HYBRID_SAFE
    4745        BS3_CALL_CONV_PROLOG 0
    4846        push    xBP
     
    6260
    6361.direct_access:
    64         mov     sAX, cr0
    65 TONLY16 mov     edx, eax
    66 TONLY16 shr     edx, 16
     62TNOT16  push    sCX
     63        xor     ecx, ecx
     64        xgetbv
     65TNOT16  pop     sCX
    6766        jmp     .return
    6867
    6968.via_system_call:
    70         mov     xAX, BS3_SYSCALL_GET_CRX
    71         mov     dl, 0
     69        mov     xAX, BS3_SYSCALL_GET_XCR0
    7270        call    Bs3Syscall
    7371
     
    7674        BS3_CALL_CONV_EPILOG 0
    7775        BS3_HYBRID_RET
    78 BS3_PROC_END_CMN   Bs3RegGetCr0
     76BS3_PROC_END_CMN   Bs3RegGetXcr0Asm
    7977
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetCr4.asm

    r93115 r95371  
    7272
    7373        mov     sSI, [xBP + xCB + cbCurRetAddr]
    74         mov     xAX, BS3_SYSCALL_SET_DRX
     74        mov     xAX, BS3_SYSCALL_SET_CRX
    7575        mov     dl, 4
    7676        call    Bs3Syscall
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegSetXcr0.asm

    r95361 r95371  
    11; $Id$
    22;; @file
    3 ; BS3Kit - Bs3RegSetCr0
     3; BS3Kit - Bs3RegSetXcr0
    44;
    55
     
    3636
    3737;;
    38 ; @cproto   BS3_CMN_PROTO_STUB(void, Bs3RegSetCr0,(RTCCUINTXREG uValue));
     38; @cproto   BS3_CMN_PROTO_STUB(void, Bs3RegSetXcr0,(uint64_t uValue));
    3939;
    4040; @param    uValue      The value to set.
    4141
    42 ; @remarks  Does not require 20h of parameter scratch space in 64-bit mode.
     42; @remarks  Does not require 20h of parameter scratch space in 64-bit mode,
     43;           only 8 bytes for dumping rcx.
    4344;
    4445; @uses     No GPRs.
    4546;
    46 BS3_PROC_BEGIN_CMN Bs3RegSetCr0, BS3_PBC_HYBRID_SAFE
     47BS3_PROC_BEGIN_CMN Bs3RegSetXcr0, BS3_PBC_HYBRID_SAFE
    4748        BS3_CALL_CONV_PROLOG 1
    4849        push    xBP
    4950        mov     xBP, xSP
    5051        push    sSI
     52        push    sDX
     53        push    sAX
     54
     55        ; Load the value
     56        mov     sAX, [xBP + xCB + cbCurRetAddr]
     57        mov     sDX, [xBP + xCB + cbCurRetAddr + 4]
    5158
    5259%if TMPL_BITS == 16
     
    6370
    6471.direct_access:
    65         mov     sSI, [xBP + xCB + cbCurRetAddr]
    66         mov     cr0, sSI
     72        push    sCX
     73        xor     ecx, ecx
     74        xsetbv
     75        pop     sCX
    6776        jmp     .return
    6877
    6978.via_system_call:
    70         push    xDX
    71         push    xAX
    72 
    73         mov     sSI, [xBP + xCB + cbCurRetAddr]
    74         mov     xAX, BS3_SYSCALL_SET_CRX
    75         mov     dl, 0
     79        xchg    esi, eax
     80        mov     xAX, BS3_SYSCALL_SET_XCR0
    7681        call    Bs3Syscall
    77         pop     xAX
    78         pop     xDX
    7982
    8083.return:
     84        pop     sAX
     85        pop     sDX
    8186        pop     sSI
    8287        pop     xBP
    8388        BS3_CALL_CONV_EPILOG 1
    8489        BS3_HYBRID_RET
    85 BS3_PROC_END_CMN   Bs3RegSetCr0
     90BS3_PROC_END_CMN   Bs3RegSetXcr0
    8691
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestCheckRegCtxEx.c

    r93115 r95371  
    3434#undef Bs3TestCheckRegCtxEx
    3535BS3_CMN_DEF(bool, Bs3TestCheckRegCtxEx,(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust, int16_t cbSpAcjust,
    36                                         uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep))
     36                                        uint32_t fExtraEfl, const char BS3_FAR *pszMode, uint16_t idTestStep))
    3737{
    3838    uint16_t const cErrorsBefore = Bs3TestSubErrorCount();
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapDefaultHandler.c

    r93115 r95371  
    139139    else if (uSyscallNo == BS3_SYSCALL_GET_LDTR)
    140140        pTrapFrame->Ctx.rax.u16 = ASMGetLDTR();
     141    else if (uSyscallNo == BS3_SYSCALL_SET_XCR0)
     142        ASMSetXcr0(RT_MAKE_U64(pTrapFrame->Ctx.rsi.u32, pTrapFrame->Ctx.rdx.u32));
     143    else if (uSyscallNo == BS3_SYSCALL_GET_XCR0)
     144    {
     145        uint64_t const uValue = ASMGetXcr0();
     146        pTrapFrame->Ctx.rax.u32 = (uint32_t)uValue;
     147        pTrapFrame->Ctx.rdx.u32 = (uint32_t)(uValue >> 32);
     148    }
    141149    else
    142150        Bs3Panic();
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk

    r93115 r95371  
    55
    66#
    7 # Copyright (C) 2007-2022 Oracle Corporation
     7# Copyright (C) 2007-2020 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r93115 r95371  
    55
    66/*
    7  * Copyright (C) 2007-2022 Oracle Corporation
     7 * Copyright (C) 2007-2020 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    108108#define Bs3RegGetLdtr BS3_CMN_MANGLER(Bs3RegGetLdtr)
    109109#define Bs3RegGetTr BS3_CMN_MANGLER(Bs3RegGetTr)
     110#define Bs3RegGetXcr0 BS3_CMN_MANGLER(Bs3RegGetXcr0)
    110111#define Bs3RegSetCr0 BS3_CMN_MANGLER(Bs3RegSetCr0)
    111112#define Bs3RegSetCr2 BS3_CMN_MANGLER(Bs3RegSetCr2)
     
    121122#define Bs3RegSetLdtr BS3_CMN_MANGLER(Bs3RegSetLdtr)
    122123#define Bs3RegSetTr BS3_CMN_MANGLER(Bs3RegSetTr)
     124#define Bs3RegSetXcr0 BS3_CMN_MANGLER(Bs3RegSetXcr0)
    123125#define Bs3SelFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelFar32ToFlat32)
    124126#define Bs3SelFar32ToFlat32NoClobber BS3_CMN_MANGLER(Bs3SelFar32ToFlat32NoClobber)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r93115 r95371  
    55
    66/*
    7  * Copyright (C) 2007-2022 Oracle Corporation
     7 * Copyright (C) 2007-2020 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    108108#undef Bs3RegGetLdtr
    109109#undef Bs3RegGetTr
     110#undef Bs3RegGetXcr0
    110111#undef Bs3RegSetCr0
    111112#undef Bs3RegSetCr2
     
    121122#undef Bs3RegSetLdtr
    122123#undef Bs3RegSetTr
     124#undef Bs3RegSetXcr0
    123125#undef Bs3SelFar32ToFlat32
    124126#undef Bs3SelFar32ToFlat32NoClobber
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r95296 r95371  
    847847/** Get the LDT register (value returned in ax). */
    848848#define BS3_SYSCALL_GET_LDTR    UINT16_C(0x000f)
     849/** Set XCR0 register (value in edx:esi). */
     850#define BS3_SYSCALL_SET_XCR0    UINT16_C(0x0010)
     851/** Get XCR0 register (value returned in edx:eax). */
     852#define BS3_SYSCALL_GET_XCR0    UINT16_C(0x0011)
    849853/** The last system call value. */
    850 #define BS3_SYSCALL_LAST        BS3_SYSCALL_GET_LDTR
     854#define BS3_SYSCALL_LAST        BS3_SYSCALL_GET_XCR0
    851855/** @} */
    852856
     
    29062910BS3_CMN_PROTO_NOSB(uint16_t, Bs3RegGetTr,(void));
    29072911BS3_CMN_PROTO_NOSB(uint16_t, Bs3RegGetLdtr,(void));
     2912BS3_CMN_PROTO_NOSB(uint64_t, Bs3RegGetXcr0,(void));
    29082913
    29092914BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr0,(RTCCUINTXREG uValue));
     
    29132918BS3_CMN_PROTO_NOSB(void, Bs3RegSetTr,(uint16_t uValue));
    29142919BS3_CMN_PROTO_NOSB(void, Bs3RegSetLdtr,(uint16_t uValue));
     2920BS3_CMN_PROTO_NOSB(void, Bs3RegSetXcr0,(uint64_t uValue));
    29152921/** @} */
    29162922
     
    33763382 */
    33773383BS3_CMN_PROTO_STUB(bool, Bs3TestCheckRegCtxEx,(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust,
    3378                                                int16_t cbSpAdjust, uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep));
     3384                                               int16_t cbSpAdjust, uint32_t fExtraEfl,
     3385                                               const char BS3_FAR *pszMode, uint16_t idTestStep));
    33793386
    33803387/**
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac

    r93115 r95371  
    15151515;; Get the LDT register (value returned in ax).
    15161516%define BS3_SYSCALL_GET_LDTR        000fh
     1517;; Set XCR0 register (value in edx:esi).
     1518%define BS3_SYSCALL_SET_XCR0        0010h
     1519;; Get XCR0 register (value returned in edx:eax).
     1520%define BS3_SYSCALL_GET_XCR0        0011h
    15171521;; The last system call value.
    1518 %define BS3_SYSCALL_LAST            BS3_SYSCALL_GET_LDTR
     1522%define BS3_SYSCALL_LAST            BS3_SYSCALL_GET_XCR0
    15191523;; @}
    15201524
Note: See TracChangeset for help on using the changeset viewer.

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