VirtualBox

Changeset 49018 in vbox


Ignore:
Timestamp:
Oct 10, 2013 8:19:24 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89766
Message:

VMM/HMR0Mixed.mac: Remove ugly jump label suffix passing when assembler can handle it with '%%'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMR0Mixed.mac

    r48965 r49018  
    3636%endif
    3737
    38 ;; @def RESTORESTATEVM32
     38;; @def RESTORE_STATE_VM32
    3939; Macro restoring essential host state and updating guest state
    4040; for common host, 32-bit guest for VT-x.
    41 ;
    42 ; @param 1  Jump label suffix 1.
    43 ; @param 2  Jump label suffix 2.
    44 ; @param 3  Jump label suffix 3.
    45 %macro RESTORESTATEVM32 3
     41%macro RESTORE_STATE_VM32 0
    4642    ; Restore base and limit of the IDTR & GDTR.
    4743 %ifndef VMX_SKIP_IDTR
     
    9591 %ifdef RT_ARCH_AMD64
    9692    cmp     eax, 0
    97     je      .skipldtwrite32%1
     93    je      %%skip_ldt_write32
    9894 %endif
    9995    lldt    ax
    10096
    101 .skipldtwrite32%1:
     97%%skip_ldt_write32:
    10298    add     xSP, xCB     ; pCtx
    10399
     
    110106    mov     ecx, [ss:xDX + VMCSCACHE.Read.cValidEntries]
    111107    cmp     ecx, 0      ; Can't happen
    112     je      .no_cached_read32%2
    113     jmp     .cached_read32%3
     108    je      %%no_cached_read32
     109    jmp     %%cached_read32
    114110
    115111ALIGN(16)
    116 .cached_read32%3:
     112%%cached_read32:
    117113    dec     xCX
    118114    mov     eax, [ss:xDX + VMCSCACHE.Read.aField + xCX * 4]
    119115    vmread  [ss:xDX + VMCSCACHE.Read.aFieldVal + xCX * 8], xAX
    120116    cmp     xCX, 0
    121     jnz     .cached_read32%3
    122 .no_cached_read32%2:
     117    jnz     %%cached_read32
     118%%no_cached_read32:
    123119 %endif
    124120
     
    233229    mov     xDX, cr2
    234230    cmp     xBX, xDX
    235     je      .skipcr2write32
     231    je      .skip_cr2_write32
    236232    mov     cr2, xBX
    237233
    238 .skipcr2write32:
     234.skip_cr2_write32:
    239235    mov     eax, VMX_VMCS_HOST_RSP
    240236    vmwrite xAX, xSP
     
    273269    jz      near .vmxstart_start_failed
    274270
    275     RESTORESTATEVM32 A, B, C
     271    RESTORE_STATE_VM32
    276272    mov     eax, VINF_SUCCESS
    277273
     
    282278
    283279.vmxstart_invalid_vmcs_ptr:
    284     RESTORESTATEVM32 D, E, F
     280    RESTORE_STATE_VM32
    285281    mov     eax, VERR_VMX_INVALID_VMCS_PTR_TO_START_VM
    286282    jmp     .vmstart_end
    287283
    288284.vmxstart_start_failed:
    289     RESTORESTATEVM32 G, H, I
     285    RESTORE_STATE_VM32
    290286    mov     eax, VERR_VMX_UNABLE_TO_START_VM
    291287    jmp     .vmstart_end
     
    295291
    296292%ifdef RT_ARCH_AMD64
    297 ;; @def RESTORESTATEVM64
     293;; @def RESTORE_STATE_VM64
    298294; Macro restoring essential host state and updating guest state
    299295; for 64-bit host, 64-bit guest for VT-x.
    300296;
    301 ; @param 1  Jump label suffix 1.
    302 ; @param 2  Jump label suffix 2.
    303 ; @param 3  Jump label suffix 3.
    304 %macro RESTORESTATEVM64 3
     297%macro RESTORE_STATE_VM64 0
    305298    ; Restore base and limit of the IDTR & GDTR
    306299 %ifndef VMX_SKIP_IDTR
     
    357350    pop     xAX         ; Saved LDTR
    358351    cmp     eax, 0
    359     je      .skipldtwrite64%1
     352    je      %%skip_ldt_write64
    360353    lldt    ax
    361354
    362 .skipldtwrite64%1:
     355%%skip_ldt_write64:
    363356    pop     xSI         ; pCtx (needed in rsi by the macros below)
    364357
     
    379372    mov     ecx, [xDX + VMCSCACHE.Read.cValidEntries]
    380373    cmp     ecx, 0      ; Can't happen
    381     je      .no_cached_read64%2
    382     jmp     .cached_read64%3
     374    je      %%no_cached_read64
     375    jmp     %%cached_read64
    383376
    384377ALIGN(16)
    385 .cached_read64%3:
     378%%cached_read64:
    386379    dec     xCX
    387380    mov     eax, [xDX + VMCSCACHE.Read.aField + xCX * 4]
    388381    vmread  [xDX + VMCSCACHE.Read.aFieldVal + xCX * 8], xAX
    389382    cmp     xCX, 0
    390     jnz     .cached_read64%3
    391 .no_cached_read64%2:
     383    jnz     %%cached_read64
     384%%no_cached_read64:
    392385 %endif
    393386
     
    499492    mov     rdx, cr2
    500493    cmp     rbx, rdx
    501     je      .skipcr2write
     494    je      .skip_cr2_write
    502495    mov     cr2, rbx
    503496
    504 .skipcr2write:
     497.skip_cr2_write:
    505498    mov     eax, VMX_VMCS_HOST_RSP
    506499    vmwrite xAX, xSP
     
    547540    jz      near .vmxstart64_start_failed
    548541
    549     RESTORESTATEVM64 a, b, c
     542    RESTORE_STATE_VM64
    550543    mov     eax, VINF_SUCCESS
    551544
     
    556549
    557550.vmxstart64_invalid_vmcs_ptr:
    558     RESTORESTATEVM64 d, e, f
     551    RESTORE_STATE_VM64
    559552    mov     eax, VERR_VMX_INVALID_VMCS_PTR_TO_START_VM
    560553    jmp     .vmstart64_end
    561554
    562555.vmxstart64_start_failed:
    563     RESTORESTATEVM64 g, h, i
     556    RESTORE_STATE_VM64
    564557    mov     eax, VERR_VMX_UNABLE_TO_START_VM
    565558    jmp     .vmstart64_end
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