Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instruction not emulated properly on guests #8756

Open
jiaqingz-intel opened this issue Jan 10, 2025 · 0 comments
Open

Instruction not emulated properly on guests #8756

jiaqingz-intel opened this issue Jan 10, 2025 · 0 comments
Labels
status: new The issue status: new for creation

Comments

@jiaqingz-intel
Copy link
Contributor

The following instruction does not work properly on guests

mov $1, %rsi
mov $0x8086, %eax
cmpl (PCI_VID_ADDR), %eax
je 1f
mov $0, %rsi
1:

After execution, %rsi equals 0, it should be 1 as je 1f is true and jumps to 1:

@jiaqingz-intel jiaqingz-intel added the status: new The issue status: new for creation label Jan 10, 2025
jiaqingz-intel added a commit to jiaqingz-intel/acrn-hypervisor that referenced this issue Jan 10, 2025
The VM-exit instruction length(VMX_EXIT_INSTR_LEN) in VMCS is undefined
on EPT violation, except during delivery of a software interrupt,
privileged software exception, or software exception[1]. Although CPU
is likely to set the field, it can be incorrect in certain cases, such
as cmp+jcc and test+jcc.

Since hypervisor does not know exactly how much bytes needed, and GVA
translation is costly, it first copies at most 15 (VIE_INST_SIZE) bytes
within the page, then decodes the instruction. If more bytes are needed
during decoding and copied length is less than 15, it copies remaining
bytes.

[1] 29.2.5, https://cdrdv2-public.intel.com/671200/325462-sdm-vol-1-2abcd-3abcd.pdf

Tracked-On: projectacrn#8756
Signed-off-by: Jiaqing Zhao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: new The issue status: new for creation
Projects
None yet
Development

No branches or pull requests

1 participant