VirtualBox

Changeset 83017 in vbox for trunk


Ignore:
Timestamp:
Feb 7, 2020 1:12:36 PM (5 years ago)
Author:
vboxsync
Message:

bs3kit: Do the long mode check in bs3-first-init-all-lm64.asm.

Location:
trunk/src/VBox/ValidationKit/bootsectors
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-state64-1.c64

    r83006 r83017  
    9696{
    9797    Bs3TestInit("bs3-cpu-state64-1");
    98     if (!(g_uBs3CpuDetected & BS3CPU_F_LONG_MODE))
    99         Bs3TestSkipped("no long mode");
    100     else
    101     {
    102         /*
    103          * Switch to 64-bit mode and back to rm.
    104          */
    105         Bs3TestSub("noop");
    106         bs3CpuState64InitCtx(0);
    107         bs3CpuState64Worker(bs3CpuState64Worker_Nop);
    108         bs3CpuState64Comp(false /*fModRbx*/);
     98    /*
     99     * Switch to 64-bit mode and back to rm.
     100     */
     101    Bs3TestSub("noop");
     102    bs3CpuState64InitCtx(0);
     103    bs3CpuState64Worker(bs3CpuState64Worker_Nop);
     104    bs3CpuState64Comp(false /*fModRbx*/);
    109105
    110         Bs3TestSub("Modify all 32-bit GPRs");
    111         bs3CpuState64InitCtx(0);
    112         bs3CpuState64Worker(bs3CpuState64Worker_ModAll32BitGrps);
    113         g_bs3CpuState64CtxToLoad.rax.u = UINT64_C(0xc0ffee0d);
    114         g_bs3CpuState64CtxToLoad.rcx.u = UINT64_C(0xc0ffee1d);
    115         g_bs3CpuState64CtxToLoad.rdx.u = UINT64_C(0xc0ffee2d);
    116         g_bs3CpuState64CtxToLoad.rbx.u = UINT64_C(0xc0ffee3d);
    117         g_bs3CpuState64CtxToLoad.rsp.u = UINT64_C(0xc0ffee4d);
    118         g_bs3CpuState64CtxToLoad.rbp.u = UINT64_C(0xc0ffee5d);
    119         g_bs3CpuState64CtxToLoad.rsi.u = UINT64_C(0xc0ffee6d);
    120         g_bs3CpuState64CtxToLoad.rdi.u = UINT64_C(0xc0ffee7d);
    121         bs3CpuState64Comp(true /*fModRbx*/);
     106    Bs3TestSub("Modify all 32-bit GPRs");
     107    bs3CpuState64InitCtx(0);
     108    bs3CpuState64Worker(bs3CpuState64Worker_ModAll32BitGrps);
     109    g_bs3CpuState64CtxToLoad.rax.u = UINT64_C(0xc0ffee0d);
     110    g_bs3CpuState64CtxToLoad.rcx.u = UINT64_C(0xc0ffee1d);
     111    g_bs3CpuState64CtxToLoad.rdx.u = UINT64_C(0xc0ffee2d);
     112    g_bs3CpuState64CtxToLoad.rbx.u = UINT64_C(0xc0ffee3d);
     113    g_bs3CpuState64CtxToLoad.rsp.u = UINT64_C(0xc0ffee4d);
     114    g_bs3CpuState64CtxToLoad.rbp.u = UINT64_C(0xc0ffee5d);
     115    g_bs3CpuState64CtxToLoad.rsi.u = UINT64_C(0xc0ffee6d);
     116    g_bs3CpuState64CtxToLoad.rdi.u = UINT64_C(0xc0ffee7d);
     117    bs3CpuState64Comp(true /*fModRbx*/);
    122118
    123         Bs3TestSub("Modify all 16-bit GPRs");
    124         bs3CpuState64InitCtx(0);
    125         bs3CpuState64Worker(bs3CpuState64Worker_ModAll16BitGrps);
    126         g_bs3CpuState64CtxToLoad.rax.u = UINT64_C(0xfad0);
    127         g_bs3CpuState64CtxToLoad.rcx.u = UINT64_C(0xfad1);
    128         g_bs3CpuState64CtxToLoad.rdx.u = UINT64_C(0xfad2);
    129         g_bs3CpuState64CtxToLoad.rbx.u = UINT64_C(0xfad3);
    130         g_bs3CpuState64CtxToLoad.rsp.u = UINT64_C(0xfad4);
    131         g_bs3CpuState64CtxToLoad.rbp.u = UINT64_C(0xfad5);
    132         g_bs3CpuState64CtxToLoad.rsi.u = UINT64_C(0xfad6);
    133         g_bs3CpuState64CtxToLoad.rdi.u = UINT64_C(0xfad7);
    134         bs3CpuState64Comp(true /*fModRbx*/);
     119    Bs3TestSub("Modify all 16-bit GPRs");
     120    bs3CpuState64InitCtx(0);
     121    bs3CpuState64Worker(bs3CpuState64Worker_ModAll16BitGrps);
     122    g_bs3CpuState64CtxToLoad.rax.au16[0] = UINT16_C(0xfad0);
     123    g_bs3CpuState64CtxToLoad.rcx.au16[0] = UINT16_C(0xfad1);
     124    g_bs3CpuState64CtxToLoad.rdx.au16[0] = UINT16_C(0xfad2);
     125    g_bs3CpuState64CtxToLoad.rbx.au16[0] = UINT16_C(0xfad3);
     126    g_bs3CpuState64CtxToLoad.rsp.au16[0] = UINT16_C(0xfad4);
     127    g_bs3CpuState64CtxToLoad.rbp.au16[0] = UINT16_C(0xfad5);
     128    g_bs3CpuState64CtxToLoad.rsi.au16[0] = UINT16_C(0xfad6);
     129    g_bs3CpuState64CtxToLoad.rdi.au16[0] = UINT16_C(0xfad7);
     130    bs3CpuState64Comp(true /*fModRbx*/);
    135131
    136         Bs3TestSub("Modify all 8-bit GPRs");
    137         bs3CpuState64InitCtx(0);
    138         bs3CpuState64Worker(bs3CpuState64Worker_ModAll8BitGrps);
    139         g_bs3CpuState64CtxToLoad.rax.u      = 0;
    140         g_bs3CpuState64CtxToLoad.rax.au8[0] = 0x10;
    141         g_bs3CpuState64CtxToLoad.rax.au8[1] = 0x11;
    142         g_bs3CpuState64CtxToLoad.rcx.u      = 0;
    143         g_bs3CpuState64CtxToLoad.rcx.au8[0] = 0x20;
    144         g_bs3CpuState64CtxToLoad.rcx.au8[1] = 0x21;
    145         g_bs3CpuState64CtxToLoad.rdx.u      = 0;
    146         g_bs3CpuState64CtxToLoad.rdx.au8[0] = 0x30;
    147         g_bs3CpuState64CtxToLoad.rdx.au8[1] = 0x31;
    148         g_bs3CpuState64CtxToLoad.rbx.u      = 0;
    149         g_bs3CpuState64CtxToLoad.rbx.au8[0] = 0x40;
    150         g_bs3CpuState64CtxToLoad.rbx.au8[1] = 0x41;
    151         bs3CpuState64Comp(true /*fModRbx*/);
     132    Bs3TestSub("Modify all 8-bit GPRs");
     133    bs3CpuState64InitCtx(0);
     134    bs3CpuState64Worker(bs3CpuState64Worker_ModAll8BitGrps);
     135    g_bs3CpuState64CtxToLoad.rax.au8[0] = 0x10;
     136    g_bs3CpuState64CtxToLoad.rax.au8[1] = 0x11;
     137    g_bs3CpuState64CtxToLoad.rcx.au8[0] = 0x20;
     138    g_bs3CpuState64CtxToLoad.rcx.au8[1] = 0x21;
     139    g_bs3CpuState64CtxToLoad.rdx.au8[0] = 0x30;
     140    g_bs3CpuState64CtxToLoad.rdx.au8[1] = 0x31;
     141    g_bs3CpuState64CtxToLoad.rbx.au8[0] = 0x40;
     142    g_bs3CpuState64CtxToLoad.rbx.au8[1] = 0x41;
     143    bs3CpuState64Comp(true /*fModRbx*/);
    152144
    153         Bs3TestSub("Modify CR2");
    154         bs3CpuState64InitCtx(0);
    155         bs3CpuState64Worker(bs3CpuState64Worker_ModCr2);
    156         g_bs3CpuState64CtxToLoad.cr2.u = 0xf00dface;
    157         bs3CpuState64Comp(true /*fModRbx*/);
     145    Bs3TestSub("Modify CR2");
     146    bs3CpuState64InitCtx(0);
     147    bs3CpuState64Worker(bs3CpuState64Worker_ModCr2);
     148    g_bs3CpuState64CtxToLoad.cr2.u = 0xf00dface;
     149    bs3CpuState64Comp(true /*fModRbx*/);
    158150
    159151        /** @todo DRx */
    160     }
    161152    Bs3TestTerm();
    162153    for (;;)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-init-all-lm64.asm

    r83003 r83017  
    3636extern NAME(Main_lm64)
    3737extern NAME(Bs3Shutdown_c64)
     38extern BS3_DATA_NM(g_uBs3CpuDetected)
     39extern NAME(Bs3PrintStrN_c16)
     40extern NAME(Bs3Panic_c16)
    3841
    3942;; Entry point.
     
    5154
    5255        ;
     56        ; Check that long mode is supported.
     57        ;
     58        test    word [BS3_DATA_NM(g_uBs3CpuDetected)], BS3CPU_F_LONG_MODE
     59        jnz     .long_mode_supported
     60        push    .s_szLongModeError_End - .s_szLongModeError
     61        push    cs
     62        push    .s_szLongModeError wrt CGROUP16
     63        call    NAME(Bs3PrintStrN_c16)
     64        call    NAME(Bs3Panic_c16)
     65.long_mode_supported:
     66
     67        ;
    5368        ; Switch to LM64 and call main.
    5469        ;
     
    6075        call    NAME(Bs3Shutdown_c64)
    6176
     77.s_szLongModeError:
     78        db      'BS3 Error! Long mode not supported!', 0ah, 0dh
     79.s_szLongModeError_End:
     80        db      00h
     81
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