Commit Graph

3298 Commits

Author SHA1 Message Date
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
Shiqing Gao
3d0992c7bd doc: update rules category in coding guidelines
This patch updates the rules category in coding guidelines.

Move some rules in 'Statements' part to 'Expressions' part and
'Functions' part, which is more reasonable.

No functional change is involved.

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-04-08 16:03:48 -07:00
Sainath Grandhi
5b70c202e1 hv: Remove CONFIG_PARTITION_MODE used to compile out irq enable/disable
ACRN uses CONFIG_PARTITION_MODE  macro to compile out CPU_IRQ_ENABLE/DISABLE
APIs. With vector remapping enabled for pre-launched VMs, this is of no use.
And for VMs with LAPIC pass-thru, interrupts stay disabled in vmexit loop
with the help of is_lapic_pt() API.

Tracked-On: #2903
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-08 13:10:44 +08:00
Victor Sun
16de23d0d5 HV: move CONFIG_MAX_VM_NUM to vm configurations
Now the MAX supported VM number is defined explicitly for each scenario,
so move this config from Kconfig to VM configuration.

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-08 13:08:55 +08:00
Victor Sun
d3e4f69595 HV: use separated vm_config.c for each scenario
Previously we use unified vm_config.c for all scenarios and use MACROs
for each configuration items, then the initialization of vm_configs[]
becomes more complicated when definition of MACROs increase, so change
the coding style that all configurable items could be explicitly shown in
vm_configuration.c to make code more readable.

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-08 13:08:55 +08:00
Geoffroy Van Cutsem
d8cec9f9c4 doc: fix '@return' and '@retval' statements for vCPU ops
Add, update '@return' and '@retval' statements to the API descriptions related
to vCPU operations.

Tracked-On: #1844
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-04-08 11:07:16 +08:00
Yuan Liu
4a6bc369ad DM: virtio-gpio: implement GPIO operations via accessing PIO
GPIO set/get value can be operated by accessing PIO space and the PIO
register definition for GPIO is in gpio_dm.h, frontend driver or ACPI
control methods can operate GPIO based on it.

GPIO mediator also defines ACPI control methods to support GPIO
operations, GPIO consumers can invoke PIO_GPIO_SET_VALUE/PIO_GPIO_GET_VALUE
in their own DSDT to set/get one GPIO value via ACPI control method.

v2: 1) Fix code style.
    2) Use virtio configuration space callbacks to implement GPIO PIO operations
       that replace pci_gpio_read/pci_gpio_write with virtio_cfgread/virtio_cfgwrite.
    3) Return 0xFFFFFFFF as invalid result of PIO reading instead 0.

Tracked-On: #2512
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-04-08 10:51:49 +08:00
Geoffroy Van Cutsem
a66aa65f05 doc: tweaks to the "User Guides" section (esp. "ACRN DM parameters")
Few tweaks to the "User Guides" and "ACRN Device Model parameters" docs:
- Enhance the help text for the '--rtvm' option description
- Correct the flag name to IO_COMPLETION_POLLING
- Use double-backticks instead of quotes in various places
- Explicitly list all docs in 'index.rst' to enforce special ordering

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-04-07 12:28:17 -07:00
David B. Kinder
c09046abbf doc: add robots.txt
use a robots.txt file to prevent search engines from indexing old
content.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-04 15:51:27 -07:00
David B. Kinder
fe470cfe23 doc: make doc version selector more obvious
Move the doc version selector menu higher on the left nav to make it
more visible (from its prior bottom of the nav menu)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-04 14:47:23 -07:00
David B. Kinder
5531673f79 doc: fix broken link to kernel options
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-04 14:21:03 -07:00
David B. Kinder
cfae3d4e95 doc: remove odd GVT-g link
Remove an incorrect link reference (and target) and fix some
misspellings.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-04 14:16:09 -07:00
David B. Kinder
4ec9edcf40 doc: fix memmap parameter description
Columns were switched for the description of the memmap parameter

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-04 13:53:43 -07:00
Geoffroy Van Cutsem
4cfd952413 doc: re-organize and consolidate ACRN kernel parameters documentation
A few changes to the documents that describe kernel command-line parameters
relevant to ACRN (SOS and UOS):
- Merge two documents into one (with sections)
- Move to the "User Guides" (from the "Developer Guides")
- Update order in the list to make it consistent across sections
- Add missing parameters to the overview list

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-04-04 13:38:30 -07:00
Shiqing Gao
1da23415a9 doc: add some rules related to function documentation
This patch adds some rules related to function documentation.

Tracked-On: #1844
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-04-04 11:47:07 -07:00
Conghui Chen
e8dda1e914 DM USB: fix memory leak during reboot
1. free memory during pci_xhci_dev_destroy.
2. add libusb_free_device_list to free the list of devices previously
discovered using libusb_get_device_list().
3. fix possible memory corruption.

Tracked-On: #2892
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-04-04 18:35:02 +08:00
Sainath Grandhi
f22347346e hv: Remove separate interrupt routine for pre-launched VMs
As vector re-mapping is enabled for pre-launched/partition mode VMs,
there is no more need for separate interrupt routine i.e.
partition_mode_dispatch_interrupt.

Tracked-On: #2879
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-04-04 17:51:36 +08:00
Sainath Grandhi
5b795a3312 hv: add the support of vector remapping for pre-launched VMs
For pre-launched VMs MSI/MSI-x configuration writes are not intercepted by ACRN.
It is pass-thru and interrupts land in ACRN and the guest vector is injected into
the VM's vLAPIC. With this patch, ACRN intercepts MSI/MSI-x config writes and take
the code path to remap interrupt vector/APIC ID as it does for SOS/UOS.

Tracked-On: #2879
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-04-04 17:51:36 +08:00
Kaige Fu
c4ec7ac358 DM: Keep consistency between HV and DM about PM1A_CNT_ADDR
To keep consistency between HV and DM about PM1A_CNT_ADDR,
it is better to replace the PM1A_CNT related MACROs used in DM
with VIRTUAL_PM1A_CNT related MACROs in acrn_common.h.

Tracked-On: #2865
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
2019-04-04 17:51:15 +08:00
Conghui Chen
ede5987c11 dm: storage: add read-only feature for virtio-blk
Add VIRTIO_BLK_F_RO feature bit for virtio-blk.

Tracked-On: #2887
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-04-04 12:27:38 +08:00
Kaige Fu
f4f9970623 doc: update documents for "--rtvm" parameter
This patch update documents for "--rtvm" parameter.

Tracked-On: #2865
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-04-03 13:10:36 -07:00
Kaige Fu
469ce711c5 DM: Add new parameter --rtvm for soft/hard real-time guest
This patch add one new parameter --rtvm to indicate if the guest is a RTVM or not.
For RTVM, it may be not interference by SOS.

Tracked-On: #2865
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-04 00:27:55 +08:00
Kaige Fu
336ed72250 HV: Minor refinement about RTVM pm MACRO and comments
This patch mainly does the following:
  - Replace prefix RT_VM_ with VIRTUAL_.
  - Remove the check of "addr != RT_VM_PM1A_CNT_ADDR" as the handler is specific for this addr.
  - Add comments about the meaning of return value.

Tracked-On: #2865
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-04 00:27:55 +08:00
Kaige Fu
9c5e16987a HV: Remove the check pcpu active status when sending INIT
Intel SDM Vol3 23.8 says:
  The INIT signal is blocked whenever a logical processor is in VMX root operation.
  It is not blocked in VMX nonroot operation. Instead, INITs cause VM exits

So, there is no side-effect to send INIT signal regardless of pcpu active status.

Tracked-On: #2865
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-04-04 00:27:55 +08:00
Peter Fang
f412d52546 dm: protect pthread_cond_wait() against spurious wakeups
Users of pthread_cond_wait() should take care of spurious wakeups and it
is usually used in conjunction with a predicate. Not doing so can result
in unintended behavior. For example:

virtio_net_tx_thread():
  entry -> pthread_cond_wait() -> spurious wakeup ->
  vq_clear_used_ring_flags() -> segfault (vq->used uninitialized)

tpm_crb_request_deliver():
  entry -> pthread_cond_wait() -> spurious wakeup ->
  swtpm_handle_request() called needlessly

virtio_rnd_get_entropy():
  entry -> pthread_cond_wait() -> spurious wakeup ->
  no avail ring processing ->
  virtio_rnd_notify() skips pthread_cond_signal() due to
  rnd->in_progress ->
  vq_endchains() called needlessly ->
  wait in pthread_cond_wait() indefinitely

Fix these uses of pthread_cond_wait() by using predicates.

The only use case without a clear predicate is the tx thread in
virtio-mei, because it works with two-dimensional linked lists.

v1 -> v2:
- fix bugs and comments
- reduce code redundancy

Tracked-On: #2763
Signed-off-by: Peter Fang <peter.fang@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
2019-04-04 00:27:10 +08:00