Commit Graph

3472 Commits

Author SHA1 Message Date
Yonghua Huang
6ac9e15a2b dm: fix possible memory leak in 'load_elf32()'
Dynamic memory stored in 'elf32_phdr' allocated
through 'calloc' be lost.

the patch port from apl_sdc_stable branch.

Tracked-On: #2705
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-04-15 17:33:42 +08:00
Jiang,Mao
e50c0c88fb tools: acrn-manager: fix the possibility of creating directory at will by no permission process
There are several duplicate definitions for check_dir, it can check or create directory at will. However, only acrnd and dm monitor can create the directory. This commit fixs the possibility of creating directory at will by no permission process, which adds a param flags to conctrl if it should create the directory. By the way, this commit collates related MACRO into the same file , deletes the duplicate definitions in another files and fixs some format issues.

Tracked-On: #2886
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
2019-04-15 17:01:03 +08:00
Sainath Grandhi
16a2af5715 hv: Build mptable for guest if VM type is Pre-Launched
ACRN builds mptable for pre-launched VMs. It uses CONFIG_PARTITION_MODE
to compile mptable source code and related support. This patch removes
the macro and checks if the type of VM is pre-launched to build mptable.

Tracked-On: #2941
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-15 15:51:02 +08:00
Shiqing Gao
869de39757 hv: rename 'assign_iommu_device' and 'unassign_iommu_device'
- rename 'assign_iommu_device' to 'assign_pt_device'
- rename 'unassign_iommu_device' to 'unassign_pt_device'

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@inte.com>
2019-04-15 15:38:01 +08:00
Victor Sun
ccecd55075 HV: show VM UUID in shell
Enhance "vm_list" command in shell to Show VM UUID;

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-12 13:45:32 +08:00
Victor Sun
445999af5d HV: make vm id statically by uuid
Currently VM id of NORMAL_VM is allocated dymatically, we need to make
VM id statically for FuSa compliance.

This patch will pre-configure UUID for all VMs, then NORMAL_VM could
get its VM id/configuration from vm_configs array by indexing the UUID.

If UUID collisions is found in vm configs array, HV will refuse to
load the VM;

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-12 13:45:32 +08:00
Victor Sun
cb10dc7e73 HV: return bool in sanitize_vm_config
Return true if vm configs is sanitized successfully, otherwise return false;

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-12 13:45:32 +08:00
Victor Sun
6071234337 HV: use term of UUID
The code mixed the usage on term of UUID and GUID, now use UUID to make
code more consistent, also will use lowercase (i.e. uuid) in variable name
definition.

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-12 13:45:32 +08:00
Li, Fei1
4557033a3a hv: vlapic: minor fix about vlapic write
1) In x2apic mode, when read ICR, we want to read a 64-bits value.
2) In x2apic mode, write self-IPI will trap out through MSR write when VID isn't enabled.

Tracked-On: #1842
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-04-12 10:11:10 +08:00
Li, Fei1
fa8fa37cdf hv: vlapic: remove vlapic_rdmsr/wrmsr
We could call vlapic API directly, remove vlapic_rdmsr/wrmsr to make things easier.

Tracked-On: #1842
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-04-12 10:11:10 +08:00
Mingqiang Chi
ad1bfd95ba hv: move pci.h to include/hw
renamed:    include/dm/pci.h -> include/hw/pci.h

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-04-12 10:09:26 +08:00
Mingqiang Chi
69627ad7b6 hv: rename io_emul.c to vmx_io.c
renamed:  arch/x86/guest/io_emul.c -> arch/x86/guest/vmx_io.c
renamed:  include/arch/x86/guest/io_emul.h
	   -> include/arch/x86/guest/vmx_io.h

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-12 10:09:26 +08:00
Mingqiang Chi
17faa897a5 hv:move common/io_req.c/h to dm folder
renamed:    common/io_req.c -> dm/io_req.c
renamed:    include/arch/x86/io_req.h -> include/dm/io_req.h

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-04-12 10:09:26 +08:00
Mingqiang Chi
2b79c6df6a hv:move some common APIs to io_req.c
Now the io_emul.c is relates with arch,io_req.c is common,
move some APIs from io_emul.c to io_req.c as common like these APIs:
register_pio/mmio_emulation_handler
dm_emulate_pio/mmio_complete
pio_default_read/write
mmio_default_access_handler
hv_emulate_pio/mmio etc

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-12 10:09:26 +08:00
Mingqiang Chi
0a1c016dbb hv: move 'emul_pio[]' from strcut vm_arch to acrn_vm
Move ‘emul_pio[]/default_io_read/default_io_write’
from struct vm_arch to struct acrn_vm

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-12 10:09:26 +08:00
Mingqiang Chi
35c8437bbc hv:move 'fire_vhm_interrupt' to io_emul.c
-- this api is related with arch_x86, then move to x86 folder
-- rename 'set_vhm_vector' to 'set_vhm_notification_vector'
-- rename 'acrn_vhm_vector' to 'acrn_vhm_notification_vector'
-- add an API 'get_vhm_notification_vector'

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-12 10:09:26 +08:00
David B. Kinder
e7605fad7d doc: fix misspellings
Fix misspellings missed during regular reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-11 15:45:41 -07:00
lirui34
c42f5c5cb6 Add description of enabling serial console for KBL NUC. 2019-04-11 14:44:50 -07:00
Geoffroy Van Cutsem
8ee00c1eea Update doc/getting-started/gsg_quick_setup.sh
Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
David Kinder
1312fc6f33 Update doc/getting-started/gsg_quick_setup.sh
Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
David Kinder
64f74b76d6 Update doc/getting-started/gsg_quick_setup.sh
Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
David Kinder
c3b9b4c11d Update doc/getting-started/gsg_quick_setup.sh
Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
David Kinder
f964ee92e5 Update doc/getting-started/gsg_quick_setup.sh
Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
David Kinder
595744a3c8 Update doc/getting-started/gsg_quick_setup.sh
Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
David Kinder
07baa83ca5 Update doc/getting-started/gsg_quick_setup.sh
Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
David Kinder
bf51fb03a3 Update doc/getting-started/gsg_quick_setup.sh
Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
Geoffroy Van Cutsem
b1adc035ba Update doc/getting-started/gsg_quick_setup.sh
1. Add text to the script usages and inform people to run script with root access.
2. Add logic to determine the right ESP.
3. remove unset proxy line.
4. Add reboot operation after upgrade SOS.
5. Handle multiple efi partition while it's detected.

Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
Geoffroy Van Cutsem
65ed6c6108 Update doc/getting-started/gsg_quick_setup.sh
Thanks for your comments, I will fix it in next release.

Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
Geoffroy Van Cutsem
875fc6e8a9 Update doc/getting-started/gsg_quick_setup.sh
Thanks for your comments, I will fix it in next release.

Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
Geoffroy Van Cutsem
a6df744047 Update doc/getting-started/gsg_quick_setup.sh
Thanks for your comments, I will fix it in next release.

Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
Geoffroy Van Cutsem
7ff61fb874 Update doc/getting-started/gsg_quick_setup.sh
Thanks for your comments, I will fix it in next release.

Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
Geoffroy Van Cutsem
76b34ee7f8 Update doc/getting-started/gsg_quick_setup.sh
Thanks for your comments, I will fix it in next release.

Co-Authored-By: lirui34 <48583653+lirui34@users.noreply.github.com>
2019-04-11 14:44:50 -07:00
ruix.li
a7f7b854c3 Add gsg quick setup script. 2019-04-11 14:44:50 -07:00
Xiaoguang Wu
122685b7b9 DM USB: xHCI: refine the failure process logic of control transfer
The old logic to process control transfer failure only include two cases:
1 Short packet
2 Stall.
This patch includes all possible failures reported by Libusb and does
related emulation for UOS

Tracked-On: #2918
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-04-11 20:05:20 +08:00
Sainath Grandhi
6915264740 hv: Use virtual APIC IDs for Pre-launched VMs
For Pre-launched VMs, ACRN uses mptable for reporting APIC IDs to guest OS.
In current code, ACRN uses physical LAPIC IDs for vLAPIC IDs.
This patch is to let ACRN use vCPU id for vLAPIC IDs  and also report the same
when building mptable. ACRN should still use physical LAPIC IDs for SOS
because host ACPI tables are passthru to SOS.

Tracked-On: #2934
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2019-04-11 20:04:58 +08:00
Yuan Liu
8796ded21b DM USB: fix SWWDT_UNHANDLED issue
add a delay for usb in launch_uos.sh

Tracked-On: #2922
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-04-11 13:21:30 +08:00
Xiaoguang Wu
8bd7b9beae DM USB: xHCI: fix an logic error during USB reset
Should not set hci_address to zero during USB reset.

Tracked-On: #2922
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-04-11 13:21:30 +08:00
Yuan Liu
b570755fd0 Domain id and name added to launch_uos.sh
For multiple guest os and particular audio features support domain id
and name is required.

Tracked-On: #2924
reviewed-by: Yu Wang <yu1.wang@intel.com>
reviewed-by: Yakui zhao <yakui.zhao@intel.com>
reviewed-by: Binbin Wu <binbin.wu@intel.com>
Signed-off-by: Marcin Pietraszko <marcin.pietraszko@intel.com>
2019-04-11 11:18:57 +08:00
Yuan Liu
6eaadc34c0 dm: passthru: support SD hotplug
Add SDC ACPI device in dsdt, and assign GPIO 0 to SDC for SD card
detection.

Currently, the SD card hotplug function needs to insert SD card when
system boot, otherwise, it does not work. Since it needs P2SB virtualization
to set SD card presence state, and P2SB does not support user space interfaces
so this is an known issue.

Tracked-On: #2512
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-04-11 10:10:15 +08:00
Xiaoguang Wu
784bfa28ae DM USB: xHCI: fix an issue during BULK transfer
When LINK type TRB are received among multiple BULK TRBs, the copying
logic in DM will miss one or more TRBs. This patch is used to fix it.

Tracked-On: #2926
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-04-11 10:08:45 +08:00
David B. Kinder
e30cd45261 doc: tweak home page redirect to latest
Try to reduce the page flash when redirecting to latest/index.html

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-10 16:26:08 -07:00
Xiaoguang Wu
63743d8b9b DM USB: xHCI: WA for an isochronous crash issue
The current xHCI mediator doesn't well support disable endpoint command.
This patch is one workaround for disable endpoint command to avoid
xHCI mediator to continue handle already dropped data.

Tracked-On: #2927
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-04-10 17:54:34 +08:00
Jack Ren
f0e7ce6a8c version: 1.0-unstable
Signed-off-by: Jack Ren <jack.ren@intel.com>
2019-04-10 11:52:55 +08:00
wenlingz
aff78d1ec8 doc: add v0.8 release note
Signed-off-by: wenlingz <wenling.zhang@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-09 18:26:27 -07:00
David B. Kinder
74b841aa08 doc: add 0.8 version to master branch
When 0.8 documents are published, we create a link to them from the
master branch where the /latest version of documentation is found.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-09 15:47:41 -07:00
Shiqing Gao
74b5de3f86 doc: add rules in coding guidelines
This patch adds rules in coding guidelines.

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-04-09 11:23:24 -07:00
Geoffroy Van Cutsem
435b29af5f doc: update documentation to the latest TAP name (no acrn_ prefix)
Update the documentation, and associated scripts to reflect the fact
that the TAP device used by 'acrn-dm' no longer use the "acrn_" prefix.

Tracked-On: #2509
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-04-09 11:21:00 -07:00
Geoffroy Van Cutsem
a459ac97f8 doc: update the "ACRN Debugging Tools" tutorial
Update the "ACRN Debugging Tools" tutorial:
* Remove sections on how to build and install the hypervisor, refer to the
  corresponding user guides instead
* Simplify the flow for checking loglevel (console and mem)
* Add a little text to improve readability

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-04-09 11:18:27 -07:00
David B. Kinder
17b2a72555 doc: add the ACRN debug tutorial document
Add a new debugging tutorial and update the acrn_shell documentation
with additional details.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-08 20:01:16 -07:00
Jie Deng
00dd26b081 dm: remove "acrn_" prefix from tap name
Some projects based on ACRN don't want tap name to contain "acrn_"
prefix. This patch removes that prefix.

Tracked-On: #2509
Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-04-09 10:59:45 +08:00