Commit Graph

1793 Commits

Author SHA1 Message Date
Peter Fang 0359bd0f99 dm: vpit: add PIT-related header files
Add the necessary header files for vPIT.

Origin: FreeBSD
License: BSD-3-Clause
URL: https://svnweb.freebsd.org/
commit: 335030
Purpose: Adding vPIT support.
Maintained-by: External

Tracked-On: #1392
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-09 13:24:47 +08:00
Mingqiang Chi eff2ac7a90 hv: Remove vm_list
Loop the global vm_array[] instead of the vm_list.

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-09 13:24:21 +08:00
Mingqiang Chi b8e59e1638 hv:Replace dynamic memory with static for vm
-- Replace dynamic memory allocation with static memory
-- Remove the parameter check if the vm is NULL

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-09 13:24:21 +08:00
Mingqiang Chi ff3f9bd1e6 hv: Remove const qualifier for struct vm
This patch is ready for next one,we will switch from
pointer to embedded structures such as structure vcpu,
some const qualifiers can be improper and raise compilation errors,
this patch remove const qualifier for struct vm.

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-09 13:24:04 +08:00
Sainath Grandhi 5b28b37842 hv: Fix for PARTITION_MODE compilation
This patch fixes compilation issue for PARTITION_MODE.

Tracked-On: #1404
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2018-10-08 22:04:27 +08:00
Wei Liu eebccac2a7 hv: add suffix(U) in vmx.h to come up MISRA-C
MISRA-C required the suffix(U), such as:
(1U << 0) ---> (1U << 0U)
This patch will add the suffix(U) to come up MISRA-C.

Tracked-On: #1385
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-08 12:57:25 +08:00
Yin Fengwei 8787b65fde dm: fix the issue when guest tries to disable memory range access
According to PCI spec 3.0 section 6.2.2 "Device Control", guest
could write the command register to control device response to
io/mem access.

The origial code register/unregister the memory range which is
not suitable because it can't handle the sequence:
  1. disble the device response to specific memory range
  2. reboot guest (DM will try to free the memory range which
     was freed in step 1 already)

Tracked-On: #1277
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-08 12:57:00 +08:00
Yin Fengwei be0cde7dec Revert "dm: workaroud for DM crash when doing fastboot reboot"
Remove the workaround and will submit the fixing patch.

Tracked-On: #1277
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-08 12:57:00 +08:00
Miguel Bernal Marin b115546b45 crashlog: deprecate acrnprobe_prepare and update Makefile
The `crashlogctl` command is replacing acrnprobe_prepare script.
So, let's remove from the project, and update the Makefile with
the new content.

Tracked-On: #1386
Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
2018-10-08 09:43:03 +08:00
Miguel Bernal Marin f3fc857f56 crashlog: introducing crashlogctl
This patch introduce the command `crashlogctl`,
it is used to enable/disable the ACRN crashlog services.

Also a systemd-tmpfile config file is introduced to create the
/var/log/crashlog directory, and a sysctl config file where
the usercrash-wrapper will be configured at boot time.

Tracked-On: #1386
Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
2018-10-08 09:43:03 +08:00
Miguel Bernal Marin b1a05d17ed crashlog: re-write usercrash-wrapper
Using an O(n^2) function for look up the values from the arguments
simplify the complexity code of the userchrash-wrapper.

Tracked-On: #1386
Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
2018-10-08 09:43:03 +08:00
Miguel Bernal Marin 6981a4dff7 crashlog: do not alter system behavior with watchdog
Instead of installing to systemd config directory, install to
/usr/share/acrn/crashlog. Using this way we not alter the system if it
is not used as a debug platform.

Tracked-On: #1386
Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
2018-10-08 09:43:03 +08:00
David B. Kinder d800baf553 doc: tweak hld intro
Add another level to the HLD toc, and start conversion of the HLD intro

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-10-05 16:38:13 -07:00
David B. Kinder 1e38544112 doc: reorganize HLD docs
Reorganize the high-level design docs to align with a work-in-progress
HLD document.  Migrate previous web content (and images) into the new
organization.

From here we'll continue inclusion of new design chapters as they're
reviewed and edited.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-10-05 16:08:15 -07:00
David B. Kinder 8e21d5ee99 doc: update genrest script for latest kconfiglib
The genrest.py script (used to generate config documentation from the
Kconfig files) broke when upgrading to the latest kconfiglib (10.9.1).
Copied the latest genrest.py script from the Zephyr project (where this
script and processing was developed) and things work again.

Update Makefile's call to genrest.py (toplevel Kconfig path is now found
relative to the srctree.

Update requirements.txt to match the kconfiglib version family
verified to work.

fixes: #1387

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>

Documentation scripts: enhance 'show-versions.py'

Modify the doc/scripts/show-versions.py script by making it
gather the list of Python modules to check the version for from
the "requirements.txt" file. It should help keep this in sync
if/when our requirements evolve.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-10-04 14:25:00 -07:00
David B. Kinder 1c0a05705f doc: update genrest script for latest kconfiglib
The genrest.py script (used to generate config documentation from the
Kconfig files) broke when upgrading to the latest kconfiglib (10.9.1).
Copied the latest genrest.py script from the Zephyr project (where this
script and processing was developed) and things work again.

Also update requirements.txt to match the kconfiglib version verified to
work.

tracked-on: #1387

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-10-04 14:25:00 -07:00
Peter Fang 1657544152 dm: vrtc: add memory configuration in RTC CMOS
Some firmware (e.g. UEFI) uses RTC CMOS to fetch the system's memory
configuration. Put lowmem / highmem info in the designated area.

This is a port of Bhyve vRTC's user-space logic.

v1 -> v2:
* move KB/MB/GB to macros.h
* move nvram offset definitions to rtc.h

Tracked-On: #1390
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-05 00:33:17 +08:00
Geoffroy Van Cutsem 373e79bb52 Getting Started Guide: add instructions to disable cbc_* services
Add instructions on how to disable ('mask') the 'cbc_*' services
installed by the 'ioc-cbc-tools'. These services are not functional
on standard off-the-shelf platforms such as NUCs or UP2.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-10-01 14:37:25 -07:00
Geoffroy Van Cutsem 769871496d Getting Started Guide: minor clean-up
Fix the delimiting character used when adding an extra row
to a table so as to make it consistent with the other rows.

Remove an extra set of "<>"

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-10-01 14:37:25 -07:00
Jason Chen CJ ce961e79a5 dm: acpi: set SCI_INT polarity to high active
set SCI_INT default polarity to high active

Tracked-On: #1269
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-09-30 15:24:59 +08:00
Jason Chen CJ 064e5344e9 vuart: use pulse irq to assert COM1_IRQ
vuart irq COM1_IRQ is configured as active low in ACPI table, so using
GSI_FALLING_PULSE.

Tracked-On: #1269
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-09-30 15:24:59 +08:00
Jason Chen CJ 099203c15a ptdev: assert/deassert interrupt according to polarity
add active_polarity to decide what signal to call: GSI_SET_LOW, GSI_SET_HIGH,
GSI_FALLING_PULSE or GSI_RAISING_PULSE.

Tracked-On: #1269
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-09-30 15:24:59 +08:00
Jason Chen CJ e49233ba9b ioapic: set default polarity setting as high active
high active should be default polarity setting for ioapic RTE

Tracked-On: #1269
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-09-30 15:24:59 +08:00
Jason Chen CJ 3b88d3c2ac vioapic: add pin_state bitmap to set irq
a guest may use per-cpu vector allocation mechanism which may lead to
same vector on different vcpu for different vioapic pins.
when we broadcast EOI from vlapic to vioapic, it could trigger
ptdev_intx_ack for incorrect vioapic pin which will lead to incorrect
vioapic irq deassert.

old implementation is recording assert & deassert by acnt, like:
- assert -> acnt++
- deassert -> acnt--
which means an incorrect deassert may descrease acnt from 0 to -1, it leads
to error.

this patch change the recording method for a pin assert/deassert, it
just use pin_state bit set/clear to indicate line state:
- high -> pin_state bitmap set
- low -> pin_state bitmap clear
and the irq assert will be triggered based on polarity setting during line
state changing.

it can avoid the failure of incorrect deassert on old implementation, and for
ptdev sharing irq, the dev hardware could re-trigger interrupt after deassert.
but for emulated device, there is no mechanism to re-trigger interrupt if
there is irq sharing - for DM, we already has constraint to restrict vGSI
sharing, so there is no problem of it.

Tracked-On: #1269
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-09-30 15:24:59 +08:00
Xiaoguang Wu ba68bd4190 DM USB: xHCI: fix enumeration error after rebooting
When the physical USB device is disconnected before DM's emulation
is ready, the virtual connection state is not cleared properly. This
will cause the DM refuse to do emulation for future physical connection.

This patch clears those states mentioned above and hence fix the issue.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1367
2018-09-30 14:59:15 +08:00
Shiqing Gao 4544d28ee1 hv: fix 'User name starts with underscore'
There are chances that names with leading underscore declared by
developers are conflict with the ones reserved for the compiler.

What this patch does:
- rename these functions/variables/macros starting with
  underscore to avoid such unintentational mistakes.
- remove gpr.h without any contents

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-30 14:45:37 +08:00
Minggui Cao 390861a04c DM: increase UOS memory size for MRB
on MRB, if memory >= 8GB, will allocate 6GB to UOS;
for MRB now just runs one UOS with more workload.

Tracked-On: #1369
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-09-30 14:14:08 +08:00
Chaohong guo 39d54c8765 EFI: Disable RELOC by default temporary
Commit 6085781 replaced __emalloc() with a call to uefi allocate_page()
and allows UEFI FW to allocate memory for hypervisor from high to low
address below 4GB. However, this change triggers an issue (might be
memory corruption), in turn, PXE boot cannot work.

Since root cause the issue might take some time, the PXE boot issue
blocks auto-test, we disable hypervisor relocation by default for the
time being in config option, and users can enable it by themselves. In
the following weeks, if we root cause the issue, we can re-enable
relocation feature.`

Tracked-On: #1371
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
2018-09-30 13:15:26 +08:00
Zhao Yakui 072e77e746 DM: Disable plane_restriction on 4.19 kernel
Now the plane_restriction is not ready on 4.19-rcX kernel. So it will be
disabled temporally.
This change is only used to disable the plane_restriction for UOS when UOS
based on 4.14 kernel is launched in 4.19 sos kernel.

V1->V2: Commit log adds the description that this change is used to disable
the plane_restriction in 4.14 UOS kernel.

Tracked-on: https://github.com/projectacrn/acrn-hypervisor/issues/1373
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: He, Min <min.he@intel.com>
2018-09-30 10:54:45 +08:00
Zhao Yakui 5a64af2066 DM: Use the pass-through mode for IPU on 4.19 kernel
Now the IPU mediator driver is not ready on 4.19-rcX kernel. So the IPU will
fallback to pass-trhough mode temporally and be assigned to guest directly.
After the IPU mediator driver is ready, the ipu_passthrough flag will be
changed to zero.

V1-V2: Describe the issue clearly in commit log.

Tracked-on: https://github.com/projectacrn/acrn-hypervisor/issues/1373
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Wu, Binbin <binbin.wu@intel.com>
2018-09-30 10:54:45 +08:00
Zhao Yakui 38099e4b78 DM: Add the boot option to avoid loading dwc3_pci USB driver
The latest kernel has some issues when unloading dwc3_pci USB driver.
It will cause the kernel panic when unloading dwc3_pci driver in order to
assign USB controller to guest.
So the dwc3_pci won't be loaded.

Tracked-on: https://github.com/projectacrn/acrn-hypervisor/issues/1373
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Wu, Binbin <binbin.wu@intel.com>
2018-09-30 10:54:45 +08:00
Wei Liu c76114714e hv: modify static irq mappings into array of structure
The patch is replace irq_static_mappings type from 2 dimension array
into structure and one dimension array.

Tracked-On: #1375
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Jason Chen <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-29 15:54:22 +08:00
Yin Fengwei 1c0a3d9a02 hv: Add API to set vcpu register
set_vcpu_regs function is added to set vcpu registers.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2018-09-29 15:34:02 +08:00
Yin Fengwei 0e0dbbaca3 hv: Move the strcut acrn_vcpu_regs to public header file
Move struct acrn_vcpu_regs, acrn_descriptor_ptr and
acrn_gp_regs to acrn_common.h. The struct acrn_vcpu_regs
will be used as parameter of hypercall

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2018-09-29 15:34:02 +08:00
David B. Kinder 572b59ff33 doc: fix doxygen error in hypercall.h
Doxygen API comment added to hypercall.h was incorrect causing the doc
build process to fail with a warning (parameter not documented).

Fixes: #1353
Tracked-On: #1353

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-29 12:46:05 +08:00
Xiaoguang Wu 6c9bae6170 DM USB: xHCI: fix USB hub disconnection issue
When USB hub is disconnected, its connection status is not cleared
in the DM, this defect will cause the related assigned port could
not be used any more.

This patch is used fix this issue.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1365
2018-09-29 12:44:43 +08:00
Xiaoguang Wu 0d4a88e620 DM USB: xHCI: change logic of binding libusb to native device
Previous implementation binds libusb (in other words: usbfs) with
native device when DM receives the Enable Slot command. But according
to xHCI spec 4.6.5, the binding relationship is decided when the
Address Device command is received, so this implementation is not
consistent with hardware behaviors.

And this incompatible could induce following issue. When two or more
USB devices are connected at the same time, eg, connecting two devices
before Guest OS is booted, the virtual slot id may bind to wrong root
hub port.

This patch will do the binding when Address Device command is received
and related issues will be fixed.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1366
2018-09-29 12:44:43 +08:00
Xiaoguang Wu 2d00a99a4c DM USB: xHCI: refine stop endpoint logic
According to xHCI spec, the Stop Endpoint command should execute
no matter the endpoint is in halted state or not, but current
implementation just refuse do the command and return error to
Guest OS. It is wrong and this patch is used to fix it.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1366
2018-09-29 12:44:43 +08:00
Yin Fengwei adc7913741 hv: efi_context refine
For SBL platform, struct acrn_vcpu_regs are used as boot context.
Now the boot_ctx is only for UEFI platform. Rename struct boot_ctx
to efi_context.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2018-09-29 09:24:00 +08:00
Yin Fengwei ba1aa40707 hv: add struct acrn_vcpu_regs
Add struct acrn_vcpu_regs and make struct boot_ctx based on
struct acrn_vcpu_regs.

vm0_boot_context is also changed from struct boot_ctx to struct
acrn_vcpu_regs.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2018-09-29 09:24:00 +08:00
Yin Fengwei 843f7721f0 hv: Change the struct cpu_gp_regs name to acrn_gp_regs
We will define the hypercall to set acrn vcpu registers and
move this struct to acrn_commmon.h for reference from hypercall
parameter definition.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2018-09-29 09:24:00 +08:00
Yin Fengwei b207f1b942 hv: struct seg_desc_vmcs name change
struct seg_desc_vmcs is actually for segment descriptor vmcs fields.
Change its name to vmcs_seg_field

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-29 09:24:00 +08:00
Junjun Shan 5c92329606 hv:clear up the usage of printf data struct
The printf related functions have been called by other various
functions, e.g. get_ptdev_info(), get_ioapic_info, etc. The patch
is used to clear up the usage.

Tracked-On: #861
Signed-off-by: Junjun Shan <junjun.shan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-28 16:40:07 +08:00
Wei Liu 965f8d1033 hv: fix irq leak for MSI IRQ
Current free_irq sequence will release vector first, then use the
released vector to free irq number.It will cause irq leak for MSI IRQ.
At present, there is no one to free the irqs which in irq_static_mappings,
So this patch will only make sure free non-gsi irqs.

Tracked-On: #1359
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-28 16:39:36 +08:00
Wei Liu 67ff326e14 hv: retain the timer irq
Timer IRQ was static mapped IRQ.
It should not be cleaned up when one of the cpu dead.
The patch will retain the timer irq.

Tracked-On: #1359
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-28 16:39:36 +08:00
Mingqiang Chi 07e71212cc hv:Replace dynamic memory allocation for vuart
Replace dynamic allocation for vuart rx/tx buffer
with static array.

v2-->v3:
 --  Reduce the size of vuart tx buffer from 64K to 8K
 --  For non-partition mode, will use global rx/tx buffer,
     for partition mode, will use per VM rx/tx buffer.
 --  Change several APIs to inline
v1-->v2:
 --  Move vuart rx/tx buffer into acrn_vuart data structure

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-28 13:59:50 +08:00
Junjun Shan 7ce0e6a395 hv:Clear up printf related definition
In hypervisor, all the parameter and return value printf related are
unsigned int, this patch is used to fix the function definitions.

v1->v2:
  *Modify the return value of various functions, such as printf(),
   vprintf(), charout(), do_printf(), charmem, print_pow2(),
   print_decimal to void due to never used, no necessary to use,
   or has already returned by param.
  *Delete the impossible judgement of param->emit due to the type
   is unsigned.

Tracked-On: #861
Signed-off-by: Junjun Shan <junjun.shan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-28 13:59:38 +08:00
Shiqing Gao ed06b8a7ca hv: fix 'Void procedure used in expression'
MISRA-C states that a void procedure used in expressions is dangerous.

This patch removes the improper 'return' when calling the void procedure
'send_dest_ipi'.

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-28 13:59:19 +08:00
Yonghua Huang 9a05fbea78 HV: remove IRQSTATE_ASSERT/IRQSTATE_DEASSERT/IRQSTATE_PULSE
- replace vpic/vioapic_xassert_irq() APIs
      with vpic/vioapic_set_irq()

   - unify the description of IRQ/PIN state in vpic. & vioapic.c

Tracked-On: #861
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-28 13:14:30 +08:00
Yin Fengwei 9df8790ffc hv: Fix two minor issues in instruction emulation code
1. The wrong operand size is assigned in instruction decode phase
   if the operand size is 1 byte.

   According to the SDM, the bit 0(w bit) of opcode should be checked
   first to detect whether the operand size is 1 byte. Then, check
   whether there is prefix to overwrite the default operand size.

   The original instruction decode doesn't care about the operand
   size. But do opsize fixup during instruction emulation phase.
   With ACRN we need operand size packed to ioreq and send to DM
   after instruction decode.

2. We should always touch the GPA by following opsize to avoid side
   effect (especially when GPA is for a MMIO).

Tracked-On: #1337
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-09-28 13:10:54 +08:00