Skip to content
Permalink
Tree: 633e744028
Commits on Sep 25, 2019
  1. Merge pull request #239 from hyuan3/work

    wcwang committed Sep 25, 2019
    Add VM pause support
  2. Add VM pause support

    hyuan3 committed Sep 24, 2019
    Check if Qemu wants to pause VM. If yes, don't enter guest. This is
    used in snapshot scenario that Qemu pauses VM and tell HAXM not to
    enter guest after it finishes the last guest IO/MMIO instruction.
    
    Signed-off-by: Hang Yuan <hang.yuan@intel.com>
Commits on Aug 29, 2019
  1. Merge pull request #237 from leecher1337/patch

    wcwang committed Aug 29, 2019
    memslot: Fix a bug of memslot_move()
Commits on Aug 28, 2019
  1. memslot: Fix a bug of memslot_move()

    leecher1337 committed Aug 28, 2019
    Invoking memslot_init() in memslot_move() will result in losing the
    linked list information of the original memory slot node. Reimplement
    memslot_move() to resolve some exceptional issues during mapping memory
    slots.
    
    Signed-off-by: leecher1337 <leecher@dose.0wnz.at>
Commits on Aug 16, 2019
  1. Merge pull request #233 from coxuintel/intstate_bit

    wcwang committed Aug 16, 2019
    Fix incorrect interruptibility_state before vmx entry.
  2. Merge pull request #225 from coxuintel/vmx_entry

    wcwang committed Aug 16, 2019
    Fix incorrect VMX_ENTRY_CONTROLS loading.
  3. Merge pull request #231 from hyuan3/work

    wcwang committed Aug 16, 2019
    set PCLMULQDQ in feature informantion of CPUID
  4. Merge pull request #232 from coxuintel/mac_build

    wcwang committed Aug 16, 2019
    Fix macOS build failure on SDK 10.12 and host crash.
  5. Fix incorrect interruptibility_state before vmx entry.

    coxuintel committed Aug 14, 2019
    According to SDM 26.3.1.5 Checks on Guest Non-Register State, Bit 0
    (blocking by STI) must be 0 if the IF flag (bit 9) is 0 in the RFLAGS
    field.
    There is an issue during snapshot loading, that IF and
    interruptibility_state don't pass the checks, which will result in
    VM-entry failure due to invalid guest state.
    This WA correct the bit so that vmx entry check could pass. The normal
    interruptibility_state update is done when advancing the IP.
    In future, proper approach is expected to replace the WA.
    
    Signed-off-by: Colin Xu <colin.xu@intel.com>
Commits on Aug 15, 2019
  1. Fix macOS build failure on SDK 10.12 and host crash.

    coxuintel committed Aug 14, 2019
    Macro panic() is expand to postfix with panic line number, when passing
    a va_list to panic(), the macro can't expand correctly.
    Since panic() is now wrapped with hax_panic(), the line number always
    points inside hax_panic() which isn't necessary.
    Directly use (panic) instead of the macro.
    
    Before hax logger refine, hax_log_level() incorrectly use printf() for
    va_list. However it should use vprintf(). The new hax_log() inherits
    from hax_log_level() but doens't fix printf()->vprintf().
    
    Signed-off-by: Colin Xu <colin.xu@intel.com>
Commits on Aug 13, 2019
  1. set PCLMULQDQ in feature informantion of CPUID

    hyuan3 committed Aug 13, 2019
    CTS 'test_SSLSocket_getHandshankeSession_duringHandshake' relys on
    PCLMULQDQ feature. Enable it in CPUID emulation if host can support.
    
    Signed-off-by: Hang Yuan <hang.yuan@intel.com>
Commits on Aug 7, 2019
  1. Fix incorrect VMX_ENTRY_CONTROLS loading.

    coxuintel committed Aug 6, 2019
    There exists some issue when programming VMX_ENTRY_CONTROLS and GUEST_EFER:
    - ENTRY_CONTROL_LONG_MODE_GUEST has no chance to clear.
    - vmwrite_efer() called by vmwrite_cr() will check vmx field before
    vmx field gets updated, and itself will also program VMX_ENTRY_CONTROLS,
    which may cause incorrect VMX_ENTRY_CONTROLS programmed.
    - vmx filed entry_ctls_base and entry_ctls are loaded from vmcs in:
    vcpu_create()->vcpu_prepare()->fill_common_vmcs()->load_vmcs_common().
    When vmwrite_cr() and vmwrite_efer() write a dirty VMX_ENTRY_CONTROLS,
    it only updates vmx field entry_ctls, but it compares with value of
    entry_ctls_base for dirty check, which may cause reduntant or miss
    programming to VMX_ENTRY_CONTROLS.
    
    Below changes are made:
    - Add the missing clear of ENTRY_CONTROL_LONG_MODE_GUEST.
    - Move vmwrite_efer() to last of vmwrite_cr() after VMX_ENTRY_CONTROLS
      programmed.
    - Remove unnecessary entry_ctls_base in vmx field.
    
    Signed-off-by: Colin Xu <colin.xu@intel.com>
Commits on Aug 5, 2019
  1. Merge pull request #223 from coxuintel/linux_build

    wcwang committed Aug 5, 2019
    Fix compiling warnings and errors on Linux.
  2. Merge pull request #215 from coxuintel/master

    wcwang committed Aug 5, 2019
    Enhance hax logger on Windows, and some cleanup.
Commits on Aug 2, 2019
  1. Refine hax logger.

    coxuintel committed Jun 21, 2019
    Enhance hax logger on Windows:
    - Use hax logger instead of direct call to DbgPrint, so that platform
      specific APIs are not called directly.
    - Specify DPFLTR_IHVDRIVER_ID to vDbgPrintExWithPrefix(), and assign
      log level accordingly. DPFLTR_xxx level to HAX log level mapping:
      HAX_LOGD >> DPFLTR_TRACE_LEVEL
      HAX_LOGI >> DPFLTR_INFO_LEVEL
      HAX_LOGW >> DPFLTR_WARNING_LEVEL
      HAX_LOGE >> DPFLTR_ERROR_LEVEL
      According to MSDN, non-OS component should use DPFLTR_IHVDRIVER_ID.
      With proper level set, on-the-fly log level can be controlled by
      component filter mask without recompiling the driver.
      Check MSDN for details:
      https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/reading-and-filtering-debugging-messages
    - Replace reduntant default_hax_log_level with HAX_LOG_DEFAULT in hax.h,
      and prevent using instant value directly in logger.
    Retire other log interface except hax_log() with level input.
      Now all log will call hax_log() with expect log level defined in hax.h.
    Some spelling mistakes and cleanup.
    
    Signed-off-by: Colin Xu <colin.xu@intel.com>
Commits on Jul 30, 2019
  1. Merge pull request #224 from intel/release-7.5.2

    wcwang committed Jul 30, 2019
    Bump version for 7.5.2 release
Commits on Jul 25, 2019
  1. Fix compiling warnings and errors on Linux.

    coxuintel committed Jul 25, 2019
    Below warnings and errors are fixed:
    -Wmaybe-uninitialized in gpa_space_write_data().
    -Wmultistatement-macros of macro VMREAD_SEG.
    -Wparentheses of macro WRITE_CONTROLS.
    -Wdeclaration-after-statement in handle_cpuid_virtual();
    -Wunused-label in exit_ept_violation().
    Conflict X86_FEATURE_x definition in cpuid.h and cpufeatures.h.
    
    Signed-off-by: Colin Xu <colin.xu@intel.com>
Commits on Jul 15, 2019
  1. Bump version for 7.5.2 release

    wcwang committed Jul 15, 2019
    Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Commits on Jul 9, 2019
  1. Merge pull request #216 from jarveson/fix-host-flags

    coxuintel committed Jul 9, 2019
    emulate: save/restore host flags in fastop_dispatch
Commits on Jul 8, 2019
  1. emulate: save/restore host flags in fastop_dispatch

    jarveson committed Jun 21, 2019
    fastop_dispatch isn't saving/restoring host flags before overwriting with guest flags, which can cause some interesting issues. This fixes that by just pushing and poping host flags before/after executing fastop instruction.
    
    Signed-off-by: Jake Arveson <jarveson@gmail.com>
Commits on Jun 21, 2019
  1. Merge pull request #213 from hyuan3/master

    wcwang committed Jun 21, 2019
    Add rom device support
Commits on Jun 19, 2019
  1. Add ROM device support

    hyuan3 committed Jun 18, 2019
    ROM device is read-only. Its read operation will pass through. Its
    Write operation will be handled as MMIO. Don't dinguish ROM and ROM
    device exactly as no side impact.
    
    Signed-off-by: Hang Yuan <hang.yuan@intel.com>
  2. Update .travis.yml

    wayne-ma committed Jun 19, 2019
    The haxm-darwin Travis build has been failing due to HomeBrew version is out of date. So add the update step to the build script.
    Error: Your Homebrew is outdated. Please run `brew update`.
    Error: Kernel.exit
Commits on May 24, 2019
  1. Merge pull request #203 from intel/release-7.5.1

    raphaelning committed May 24, 2019
    Bump version for 7.5.1 release
Commits on Apr 16, 2019
  1. Bump version for 7.5.1 release

    wcwang committed Apr 16, 2019
    Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
  2. Merge pull request #185 from kryptoslogic/emulate-push

    raphaelning committed Apr 16, 2019
     Added support for PUSH/POP instructions
Commits on Apr 12, 2019
  1. Merge pull request #198 from intel/host-efer-write-fix

    raphaelning committed Apr 12, 2019
    Skip some checks for host-initiated EFER writes
  2. Skip some checks for host-initiated EFER writes

    raphaelning committed Apr 12, 2019
    Although the main purpose of handle_msr_write() is to handle guest-
    initiated MSR writes, it is also used by the SET_MSRS ioctl handler
    to deal with host-initiated writes to guest MSRs. In the case of
    IA32_EFER, these two scenarios actually require the hypervisor to
    perform different checks.
    
    Commit fe8aa45 ("Added EFER value checks for handle_msr_write")
    added additional checks on IA32_EFER, but some of them are only
    applicable to guest-initiated EFER writes. As a result, Android
    Emulator always runs into a "VCPU shutdown request" (HAXM panic)
    when booting from an AVD snapshot. That is because it tries to
    put the vCPUs directly in 64-bit mode, but one of the new checks
    prevents it from loading the saved EFER state. In the end, 0 is
    loaded into EFER, and the first VM entry fails due to invalid
    guest state (vCPU is not in 64-bit mode but uses a 64-bit RIP).
    
    Fix that by adding a Boolean parameter to handle_msr_write() that
    helps distinguish between the two scenarios, and skipping all
    guest-specific checks for host-initiated EFER writes.
    
    Signed-off-by: Yu Ning <yu.ning@intel.com>
Commits on Apr 5, 2019
  1. Fixed accesses to AH/CH/DH/BH registers in the emulator

    AlexAltea committed Feb 23, 2019
    Implemented by adding a `op->reg.shift` field that indicates the how many bytes does the full-width register need to be right-shifted in order to access the desired value.
    
    Signed-off-by: Alexandro Sanchez Bach <asanchez@kryptoslogic.com>
Commits on Mar 28, 2019
  1. Merge pull request #197 from intel/standalone-mapping

    wcwang committed Mar 28, 2019
    Support stand-alone memory mappings
Commits on Mar 25, 2019
  1. Support stand-alone memory mappings

    raphaelning committed Mar 25, 2019
    Android Emulator may dynamically create and destroy temporary
    memory mappings at guest runtime for certain rendering tasks via
    hax_user_backed_ram_map() and hax_user_backed_ram_unmap()
    ($AOSP/external/qemu/target/i386/hax-mem.c), e.g.:
    
     hax_user_backed_ram_map() <1>
     1.1) ADD_RAMBLOCK <1>:     HVA 0x14e070000..0x16e070000
     1.2) SET_RAM2 (map) <1>:   GPA 0x7dffff000..0x7fffff000 =>
                                HVA 0x14e070000..0x16e070000
     hax_user_backed_ram_unmap() <1>
     1.3) SET_RAM2 (unmap) <1>: GPA 0x7dffff000..0x7fffff000
     hax_user_backed_ram_map() <2>
     2.1) ADD_RAMBLOCK <2>:     HVA 0x14de70000..0x16de70000
    
    The second ADD_RAMBLOCK call fails, because its HVA range overlaps
    with that of the first ADD_RAMBLOCK call.
    
    The problem is that the "map" step creates a RAM block, but the
    "unmap" step doesn't destroy it. Instead of adding a DEL_RAMBLOCK
    ioctl, simply exempt the caller from calling ADD_RAMBLOCK in the
    first place:
    
     - Introduce a new hax_memslot flag for "stand-alone" mappings,
       along with a new capability flag for this API change.
     - Remove the ADD_RAMBLOCK call from hax_user_backed_ram_map().
       Instead, call SET_RAM2 with the new flag. (This will be done on
       the Android Emulator side.)
     - Internally, SET_RAM2 creates a stand-alone RAM block for each
       stand-alone mapping.
     - When the stand-alone mapping is unmapped, the reference count
       of the corresponding stand-alone RAM block will hit 0, which
       allows SET_RAM2 to destroy this temporary RAM block.
    
    + Replace HAX_RAM_INFO_xxx with HAX_MEMSLOT_xxx in code that is
      not directly in touch with user space.
    
    Signed-off-by: Yu Ning <yu.ning@intel.com>
Commits on Mar 1, 2019
  1. Merge pull request #187 from kryptoslogic/repne-fix

    raphaelning committed Mar 1, 2019
    Allow REPNE prefixes in REP-only instructions
  2. Merge pull request #188 from krytarowski/netbsd-7

    raphaelning committed Mar 1, 2019
    Allow read and write of IA32_EFER in the !PAE && PG mode
Commits on Feb 28, 2019
  1. Added EFER value checks for handle_msr_write

    polprog committed Feb 26, 2019
    Signed-off-by: Krzysztof Lasocki <nzkiwi.5000@gmail.com>
Commits on Feb 27, 2019
  1. Allow REPNE prefixes in REP-only instructions

    AlexAltea committed Feb 22, 2019
    Signed-off-by: Alexandro Sanchez Bach <asanchez@kryptoslogic.com>
Older
You can’t perform that action at this time.