acrn-hypervisor/hypervisor/arch/x86
Kaige Fu ce79d3aa24 HV: instr_emul: Handle error gracefully
ASSERT is too strict for HV when error happens during emulating instruction.
This patch remove all ASSERT and return a negative error code when failing to
emulate instruction.

Originally, getcc will return -EINVAL when opsize are not one of (1, 2, 4, 8).
But theoretically, opsize in current implementation can only be one of (1, 2, 4, 8).
So, we will always get valid "cc".

This patch add a pre-assumption and make sure that getcc always return valid value.

For the current code, #GP will be injected to guest if something goes wrong with
instruction emulation.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2018-08-07 12:09:22 +08:00
..
configs HV: config: add Kconfig and defconfigs for sbl & uefi 2018-06-08 17:21:13 +08:00
debug hv:Rename port/mmio read and write APIs 2018-08-02 14:03:38 +08:00
guest HV: instr_emul: Handle error gracefully 2018-08-07 12:09:22 +08:00
assign.c HV:treewide:fix value outside range of underlying type 2018-08-06 16:07:41 +08:00
cpu_primary.S HV:treewide:Replace HOST_GDT_RING0_CODE/DATA_SEL with constant 2018-07-18 12:31:42 +08:00
cpu_state_tbl.c fix x86 dir integer violations 2018-07-25 15:29:34 +08:00
cpu.c move global x2apic_enabled into arch dir 2018-08-07 09:55:13 +08:00
cpuid.c move global x2apic_enabled into arch dir 2018-08-07 09:55:13 +08:00
ept.c hv:removed assert in free_ept_mem 2018-08-07 10:11:48 +08:00
gdt.c HV:treewide:fix value outside range of underlying type 2018-08-06 16:07:41 +08:00
idt.S HV: Refine 'hv_main()' function usage 2018-08-06 10:34:43 +08:00
io.c vcpu: add get/set register APIs 2018-08-07 09:55:13 +08:00
ioapic.c hv:Rename port/mmio read and write APIs 2018-08-02 14:03:38 +08:00
irq.c HV: Rename functions, variables starting with "_" 2018-08-03 12:49:01 +08:00
Kconfig HV: Add Partitioning mode option for ACRN 2018-08-02 12:58:09 +08:00
lapic.c hv:Rename port/mmio read and write APIs 2018-08-02 14:03:38 +08:00
mmu.c HV: Rename functions, variables starting with "_" 2018-08-03 12:49:01 +08:00
mtrr.c hv:cleanup vmid related code 2018-08-06 12:27:53 +08:00
notify.c HV: Fix new MISRAC violations for brackets 2018-07-16 11:02:38 +08:00
pagetable.c hv: ept: add lookup_address to lookup the page table 2018-07-26 12:46:34 +08:00
pm.c pm: use cpu_context for s3 save/restore 2018-08-07 09:55:13 +08:00
retpoline-thunk.S license: Replace license text with SPDX tag 2018-06-01 10:43:06 +08:00
timer.c HV:treewide:fix value outside range of underlying type 2018-08-06 16:07:41 +08:00
trampoline.S HV:treewide:Replace HOST_GDT_RING0_CODE/DATA_SEL with constant 2018-07-18 12:31:42 +08:00
trusty.c Revert "[REVERT-ME]:handle discontinuous hpa for trusty" 2018-08-07 10:10:16 +08:00
virq.c vcpu: add get/set register APIs 2018-08-07 09:55:13 +08:00
vmexit.c vcpu: add get/set register APIs 2018-08-07 09:55:13 +08:00
vmx_asm.S vcpu: add ext context support for world switch 2018-08-07 09:55:13 +08:00
vmx.c vcpu: add ext context support for world switch 2018-08-07 09:55:13 +08:00
vtd.c hv: treewide: fix 'Prototype and definition name mismatch' 2018-08-06 16:04:40 +08:00
wakeup.S pm: use cpu_context for s3 save/restore 2018-08-07 09:55:13 +08:00