Commit Graph

4062 Commits

Author SHA1 Message Date
lirui34 12db54af5f doc: update CODEOWNER for rst
Add Nanlin (@NanlinXie) as a reviewer for ACRN documentation.

Tracked-On: #3419
Signed-off-by: lirui34 <ruix.li@intel.com>
2019-09-11 17:32:58 +08:00
Yin Fengwei 6b6aa80600 hv: pm: fix coding style issue
This patch fix the coding style issue introduced by previous two
patches.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 17:30:24 +08:00
Yin Fengwei f039d75998 hv: pm: enhencement platform S5 entering operation
Now, we have assumption that SOS control whether the platform
should enter S5 or not. So when SOS tries enter S5, we just
forward the S5 request to native port which make sure platform
S5 is totally aligned with SOS S5.

With higher serverity guest introduced,this assumption is not
true any more. We need to extend the platform S5 process to
handle higher severity guest:
  - For DM launched RTVM, we need to make sure these guests
    is off before put the whole platfrom to S5.

  - For pre-launched VM, there are two cases:
    * if os running in it support S5, we wait for guests off.
    * if os running in it doesn't support S5, we expect it
      will invoke one hypercall to notify HV to shutdown it.
      NOTE: this case is not supported yet. Will add it in the
      future.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
2019-09-11 17:30:24 +08:00
Yin Fengwei ce9375874c hv: pm: correct the function name
do_acpi_s3 actually not limit to do s3 operation. It depends on
the paramters pm1a_cnt_val and pm1b_cnt_val. It could be s3/s5.
Update the function name from xx_s3 to xx_sx.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-11 17:30:24 +08:00
Minggui Cao f41f9307cc DOC: add --pm_by_vuart setting guide.
new params: --pm_by_vuart is used to set power mananger by vuart
on ACRN; so add it to user guide.

Tracked-On: #3564
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2019-09-11 16:43:22 +08:00
Minggui Cao 3d23c90a8e DM: to avoid RTVM shutdown forcely by acrn-dm
if RTVM, now we assume it can't be shutdown forcely by SOS, so
add check condition to avoid that.

Tracked-On: #3564
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 16:43:22 +08:00
Minggui Cao 8578125fed DM: add power off by vuart setting to launch script
1. for post-launch general VM, like LaaG, the vUART is emulated in DM,
so the power off control channel is:
  acrn-dm:pty[master <-> salve] <--> acrn-dm:vUART <--> UOS:vUART

2. for RTVM, like RT-Linux, the vUART is emulated in hypervisor layer,
so the control channel is:
   acrn-dm <--> SOS:/dev/ttyS1 <--> Hypervisor <--> UOS:vUART.

So the settings in launch script are different.

Tracked-On: #3564
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2019-09-11 16:43:22 +08:00
Minggui Cao eb5a57b780 DM: add guest vm power manager by vuart
vuart can be used as communication channel between VMs;
here vuart used to control vm's power off flow; control command
is from SOS to UOS

Tracked-On: #3564
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 16:43:22 +08:00
Minggui Cao 00401a1e78 DM: separate pty vuart operation from IOC
for pty vuart operation will be commonly used by other module,
like pm-vuart: control UOS power off through vuart.

Tracked-On: #3564
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 16:43:22 +08:00
Victor Sun d188afbc59 HV: add acpi info header for nuc7i7dnb
Currently nuc7i7dnb board is using default platform acpi info file so causes
S3/S5 not working properly.

This patch updates the correct ACPI info for nuc7i7dnb board.

Tracked-On: #3609

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 14:00:53 +08:00
Shuang Zheng 00da5a994e acrn-config: web UI app for acrn-config tool
The web UI application for ACRN VM configuration tool based on Flask web framework:
1. import board info xml which is generated by acrn-config/target on target boards; or select one
board from the imported list of UI.
2. load scenario settings or import scenario settings from local.
3. edit scenario settings from web UI.
4. export and save the edited scenario setting, the application will prompt error messages from UI
if there are illegal configured items.
5. generate board source code, generate scenario source code.
6. load launch settings or import launch settings from local.
7. edit launch settings from web UI.
8. export and save the edited launch setting; the application will prompt error messages from UI
if there are illegal configurable items
9. generate launch scripts based on current launch setting.

Tracked-On: #3602
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-11 13:43:35 +08:00
Yin Fengwei 476e9a2efe doc: Update document for --pm_notify_channel
Update the document for new parameter --pm_notify_channel.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 13:27:10 +08:00
Yin Fengwei e38e026332 script: launch_uos: Give right pm notify channel
We seperate the guest power event notify channel out. And now
it's required to give the guest power event notify channel
explicitly. Update the sample launch script to have correct
parameters.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 13:27:10 +08:00
Yin Fengwei b36d80ea0c dm: pm: add dm option to select guest notify method
Now, we have two ways to notify guest about power managment
event:
  - ioc on MRB platforms
  - ACPI power button on other platforms
And we hardcode which one is used now.

In coming change, we will add UART based guest notify method.
We add dm command option to select which method will be used
when launch UOS.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Wang Yu <yu1.wang@intel.com>
2019-09-11 13:27:10 +08:00
Yin Fengwei 1041384993 dm: pm: move host power button related code out of pm.c
For the code which forwards the native power button event to
guest, they are not related with guest pm related operation
emulation. Move this part of code out of pm.c. And will make
the power button as one possible method to notify guest about
the shutdown operation.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Wang Yu <yu1.wang@intel.com>
2019-09-11 13:27:10 +08:00
Li, Fei1 ca51cc9d8a hv: vPCI: vPCI device should use its virtual configure space to access its BAR
vPCI device should use its virtual configure space to access its BAR after vPCI
device initialized.
This patch also remove corner case "vPCI device will use its 64 bits BAR high idx
to access its BAR base address".

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-09-11 13:17:42 +08:00
Li, Fei1 6ebc22210b hv: vPCI: cache PCI BAR physical base address
PCI BAR physical base address will never changed. Cache it to avoid calculating
it every time when we access it.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2019-09-11 13:17:42 +08:00
David B. Kinder 5083aba379 doc: review edits for config tool doc
Update material from PR #3559 with review and clarity edits.
Added review comments.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-09-10 18:21:20 -07:00
Geoffroy Van Cutsem ede5988587 doc: add 'logger_setting' parameter information to acrn-dm documentation
Add the '--logger_setting' parameter information to the 'acrn-dm' parameter
document.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-09-10 11:43:27 -04:00
Geoffroy Van Cutsem ff91d07337 doc: update .gitignore to reflect the new location of the tools
Update the .gitignore file to reflect the fact that the tools are now located
under misc/ and no longer under tools/.

One of the temporary folder created during the documentation generation was
doc/tools and it was therefore ignored by Git. It is now better to *not*
ignore it as it will cause documention build issues if such previous folder
exists.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-09-10 12:13:58 +02:00
Geoffroy Van Cutsem 9bb21aca64 dm: remove '-p' option from the embedded help
Remove the '-p' ("pincpu" option) from the help displayed when calling 'acrn-dm
-h'.

Tracked-On: #3600
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-09-10 15:28:56 +08:00
Li, Fei1 8b9aa11030 hv: mmu: remove strict check for deleting page table mapping
When we support PCI MSI-X table BAR remapping, we may re-delete the MSI-X table BAR
region. This patch removes strict check for deleting page table mapping.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-09-10 15:28:07 +08:00
Li, Fei1 127c73c3be hv: mmu: add strict check for adding page table mapping
The current implement only do "only add a page table mapping for a region when
it's not mapped" check when this page table entry is a PTE entry. However, it
need to do this check for PDPTE entry and PDE entry too.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-09-10 15:28:07 +08:00
Mingqiang Chi c691c5bd3c hv:add volatile keyword for some variables
pcpu_active_bitmap was read continuously in wait_pcpus_offline(),
acrn_vcpu->running was read continuously in pause_vcpu(),
add volatile keyword to ensure that such accesses are not
optimised away by the complier.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-09-10 11:26:35 +08:00
lirui34 be0c2a8124 doc: update CODEOWNERS for doc, misc reviews
Add Nanlin (@NanlinXie) as a reviewer for ACRN documentation.
Add Terry and Shuang (@terryzouhao @szhen11) as the reviewers for misc component.

Tracked-On: #3419
Signed-off-by: lirui34 <ruix.li@intel.com>
2019-09-10 10:50:28 +08:00
deb-intel 2664254399
Merge pull request #3660 from deb-intel/3632_GCC
Add URL to GCC 7.3 Manual, Section 6
2019-09-09 22:27:01 -04:00
Deb Taylor 96d51a5228 Add URL to GCC 7.3 Manual, Section 6
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-09-09 22:23:35 -04:00
Liu Xinyun 639c698626 dm: reserve 16M hole for gvt in e820 table
Add 16M@0xDF000000 for GVT usage as below. Currently, use 8M for GOP
framebuf, it satisfies display resolution of 1920x1080@32bpp

start         end          size    Note
[0x 00000000, 0x 000A0000] 640K
[0x 000A0000, 0x 00100000] 384K
[0x 00100000, 0x 7ff00000] 2G-1M   lowmem-1M
[0x 80000000, 0x 88000000] 128M    [lowmem, +128M]
[0x DF000000, 0x E0000000] 16M     *gvt*
[0x e0000000, 0x100000000] 512M
[0x100000000, 0x140000000] 1G

*gvt*:
[0xDF000000, 0xDF800000] 8M      GOP FB
[0xDFFFD000, 0XE0000000] 12K     opregion

Tracked-On: #3624

Signed-off-by: Liu Xinyun <xinyun.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-10 09:50:39 +08:00
Conghui Chen 32d8510596 hv: remove pr_dbg between stac/clac
As the pr_dbg will access sbuf which will call stac/clac inside, so can
not put pr_dbg between stac/clac, it will case Page Fault.
acrn_print_request is a debug feature, and it calls pr_dbg. when the
loglevel is set to 6, there will be Page Fault.
So, remove the caller for acrn_print_request and mask the function as
unused, reserved for debug.

Tracked-On: #3648
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
2019-09-10 09:48:27 +08:00
deb-intel 8d27c1e11c
Merge pull request #3632 from shiqingg/doc-lang-ext
doc: update Language Extensions in coding guidelines
2019-09-09 21:07:46 -04:00
deb-intel 19e9c4ca9e
Merge pull request #3613 from gvancuts/acrnctl-force-arg
doc: add "-f/--force' optional arg to 'acrnctl' documentation
2019-09-09 19:55:30 -04:00
deb-intel 67f3da2e97
Merge pull request #3567 from ClaudZhang1995/zy4
doc: update Build ACRN from Source
2019-09-09 19:13:25 -04:00
deb-intel 876d31122c
Merge pull request #3640 from lirui34/add_new_glossary
doc: Add three new glossaries
2019-09-09 18:24:37 -04:00
deb-intel ceec4d80a4
Merge pull request #3649 from gvancuts/zlib1g-dev-debian
doc: add 'zlib1g-dev' to list of dependencies in Debian
2019-09-09 18:11:55 -04:00
deb-intel 1b48773f7c
Merge pull request #3653 from deb-intel/remove_newerRef
Remove "or newer" reference to ensure that users know ACRN 1.2 requir…
2019-09-09 18:09:55 -04:00
lirui34 edbec46dcd doc: Add ACRN configuration tool tutorial
An offline configure tool is designed to configure the BOARD and VM configurations.
Here is the tutorial to tell people how to use it.

Signed-off-by: lirui34 <ruix.li@intel.com>
2019-09-09 11:03:04 -07:00
deb-intel 1e3da9f2ee
Merge pull request #3658 from deb-intel/USBMed
Add supported USB devices for WaaG and LaaG OSs
2019-09-09 12:26:09 -04:00
Deb Taylor fd60bb0768 Add supported USB devices for WaaG and LaaG OSs
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-09-09 12:17:54 -04:00
lirui34 5d284c08f4 doc: Add three new glossaries
Add three new glossaries: "Hybrid Mode", "Partition Mode", "Sharing Mode".

Signed-off-by: lirui34 <ruix.li@intel.com>
2019-09-09 17:00:37 +08:00
Yin Fengwei 81435f5504 vm reset: refine platform reset
We did following to do platform reset:
1. Try ACPI reset first if it's available
2. Then try 0xcf9 reset method
3. if 2 fails, try keyboard reset method
This introduces some timing concern which needs be handled carefully.

We change it by following:
assume the platforms which ACRN could be run on must support either
ACPI reset or 0xcf9 reset. And simplify platform reset operation
a little bit:
    If ACPI reset register is generated
        try ACPI reset
    else
        try 0xcf9 reset method

Tracked-On: #3609
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-09 09:49:59 +08:00
Deb Taylor add89b51ec Remove "or newer" reference to ensure that users know ACRN 1.2 requires ONLY Clear Linux OS version 30690.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-09-06 18:44:17 -04:00
yunzha4x 4041275f78 doc: update Build ACRN from Source
Signed-off-by: yunzha4x <yunx.zhang@intel.com>
2019-09-06 12:02:50 +08:00
Geoffroy Van Cutsem d324f79aee doc: add 'zlib1g-dev' to list of dependencies in Debian
Add 'zlib1g-dev' to the list of build tools and dependencies to be installed
in Debian in order to build the ACRN project.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-09-05 12:02:33 +02:00
Mingqiang Chi cd40980d5f hv:change function parameter for invept
change the input parameter from vcpu to eptp in order to let this api
more generic, no need to care normal world or secure world.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-09-05 16:32:30 +08:00
Tw 1547a4cb27 efi-stub: fix stack memory free issue
Because of this commit:

    commit 63e258bd01
    Author: Tianhua Sun <tianhuax.s.sun@intel.com>
    Date:   Wed Jul 17 14:33:47 2019 +0800

	efi-stub: update string operation in efi-stub

	Remove unsafe API in efi-stub
	1, use Strnlen instead of StrLen except the parameter
	   is a static string.
	2, strlen() only work on static strings.

	Tracked-On: #3276
	Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
	Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>

In the default case, bootloader_name will be point to a separate ro
section which hold the constant string, free this memory later will
cause undefined behavior (memory corruption, exception and so on).

Tracked-On: #3644
Signed-off-by: Tw <wei.tan@intel.com>
Reviewed-by: Jack Ren <jack.ren@intel.com>
2019-09-05 16:32:06 +08:00
Binbin Wu cd1ae7a89e hv: cat: isolate hypervisor from rtvm
Currently, the clos id of the cpu cores in vmx root mode is the same as non-root mode.
For RTVM, if hypervisor share the same clos id with non-root mode, the cacheline may
be polluted due to the hypervisor code execution when vmexit.

The patch adds hv_clos in vm_configurations.c
Hypervisor initializes clos setting according to hv_clos during physical cpu cores initialization.
For RTVM,  MSR auto load/store areas are used to switch different settings for VMX root/non-root
mode for RTVM.

Tracked-On: #2462
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-09-05 09:59:13 +08:00
Mingqiang Chi 38ca8db19f hv:tiny cleanup
-- remove some unnecessary includes
-- fix a typo
-- remove unnecessary void before launch_vms

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-09-05 09:58:47 +08:00
Yan, Like f15a3600ec hv: fix tsc_deadline correctness issue
Fix tsc_deadline issue by trapping TSC_DEADLINE msr write if VMX_TSC_OFFSET is not 0.
Because there is an assupmtion in the ACRN vART design that pTSC_Adjust and vTSC_Adjust are
both 0.
We can leave the TSC_DEADLINE write pass-through without correctness issue becuase there is
no offset between the pTSC and vTSC, and there is no write to vTSC or vTSC_Adjust write observed
in the RTOS so far.
This commit fix the potential correctness issue, but the RT performance will be badly affected
if vTSC or vTSC_Adjust was not zero, which we will address if such case happened.

Tracked-On: #3636
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-05 09:58:16 +08:00
Yan, Like 3f84acda09 hv: add "invariant TSC" cap detection
ACRN HV is designed/implemented with "invariant TSC" capability, which wasn't checked at boot time.
This commit adds the "invairant TSC" detection, ACRN fails to boot if there wasn't "invariant TSC" capability.

Tracked-On: #3636
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-05 09:58:16 +08:00
Xiaoguang Wu be0a4b692b DM USB: fix enumeration related issues
The patch fixes enumeration related issues introduced by commit 'fc3d19'.

Tracked-On: #3612
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-03 12:22:46 +08:00