Our customer wrote:
DMIScope on x64 Windows hangs on write operation, but works fine on x86 Windows on the same platform. Why it happens?
This happens because of the way how your BIOS is written.

The sample below is taken from widely installed Phoenix BIOS version 6.0 to demonstrate why described error occurs.

Doing the DMI write operation BIOS tries to switch the system into 32-bit protected mode by causing the SMI (System Management Interrupt). The used code is as follow:

 


        xor  al, al           ; Set P flag
        out  0B2h, al         ; B2h is a the Advanced Power Management (APM) Control Port Register
                              ; (or APM_CNT for short), which is used to issue APM commands to the
                              ; SMI handler.
                              ; Output to port B2h stores data to the APMC register and might also
                              ; generate an SMI# interrupt when the APMC_EN bit is set in the SMI
                              ; Control and Enable Register (SMI_EN).
@@:     jp   @b

        .......

Under Windows x64 the SMI handler from BIOS cannot be executed (simply because 32-bit protected mode code of SMI handler cannot be executed on x64 architecture) and, therefore, CPU flags will be never changed. As result, following conditional JP instruction will be executed forever in the endless loop.

Microsoft emulator executing 16-bit code built into Windows x64 provides no mechanism to recognize or break execution in such situation. As result, DMIScope appears to hang, but in fact system is sitting in the end-less loop inside of the BIOS code.