VirtualBox

Changeset 104988 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 20, 2024 8:42:07 PM (8 months ago)
Author:
vboxsync
Message:

VMM/IEM: Use the IEM_F_X86_AC flag where we can. bugref:10687

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMInline.h

    r104984 r104988  
    41994199DECLINLINE(bool) iemMemAreAlignmentChecksEnabled(PVMCPUCC pVCpu) RT_NOEXCEPT
    42004200{
     4201#if 0
    42014202    AssertCompile(X86_CR0_AM == X86_EFL_AC);
    42024203    return IEM_GET_CPL(pVCpu) == 3
    42034204        && (((uint32_t)pVCpu->cpum.GstCtx.cr0 & pVCpu->cpum.GstCtx.eflags.u) & X86_CR0_AM);
     4205#else
     4206    return RT_BOOL(pVCpu->iem.s.fExec & IEM_F_X86_AC);
     4207#endif
    42044208}
    42054209
     
    45624566 * trigger an \#AC.
    45634567 *
    4564  * This can be used to deal with misaligned accesses on platforms that are
     4568 * This can also be used to deal with misaligned accesses on platforms that are
    45654569 * senstive to such if desires.
    45664570 */
    4567 AssertCompile(X86_CR0_AM == X86_EFL_AC);
    4568 AssertCompile(((3U + 1U) << 16) == X86_CR0_AM);
    45694571#if 1
    45704572# define TMPL_MEM_CHECK_UNALIGNED_WITHIN_PAGE_OK(a_pVCpu, a_GCPtrEff, a_TmplMemType) \
    45714573    (   ((a_GCPtrEff) & GUEST_PAGE_OFFSET_MASK) <= GUEST_PAGE_SIZE - sizeof(a_TmplMemType) \
    4572      && !(  (uint32_t)(a_pVCpu)->cpum.GstCtx.cr0 \
    4573           & (a_pVCpu)->cpum.GstCtx.eflags.u \
    4574           & ((IEM_GET_CPL((a_pVCpu)) + 1U) << 16) /* IEM_GET_CPL(a_pVCpu) == 3 ? X86_CR0_AM : 0 */ \
    4575           & X86_CR0_AM) )
     4574     && !((a_pVCpu)->iem.s.fExec & IEM_F_X86_AC) )
    45764575#else
    45774576# define TMPL_MEM_CHECK_UNALIGNED_WITHIN_PAGE_OK(a_pVCpu, a_GCPtrEff, a_TmplMemType) 0
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