Commit Graph

4427 Commits

Author SHA1 Message Date
Victor Sun f657bae0a8 Makefile: do not rm board acpi info header
The $(BOARD)_acpi_info.h is generated by acrn-config tool, remove this
header in make clean would cause failure when user finish configuring
in webUI and start to make acrn-hypervisor by the command
"make hypervisor BOARD=xxx SCENARIO=yyy" because we mandatory do make
clean before making hypervisor.

The patch replace the file removal with a warning string to hint user
to check the file validity.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-21 16:15:23 +08:00
David B. Kinder 28e24c4198 doc: put v1.0 docs back in version menu
We've been keeping the doc version choice list trimmed as new doc
version releases are made, but the v1.0 version should remain.  (Note
that the documents for all previously published versions are still
available on the server, but they were included in the menu choice).
This PR puts the 1.0 choice back in.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-11-20 09:02:37 -08:00
Wei Liu b332bf84b8 acrn-config: enhance the board config that has no serial port
There may be no physical serial port in the target board, and it will
stop generating board file, the patch add support to handle such case.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-20 10:01:24 +08:00
Wei Liu 658dccfbe3 acrn-config: set S3/S5 to default value while BIOS not support them
If S3/S5 are not support by BIOS in some platform, will set them to 0
as default.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-20 10:01:24 +08:00
Wei Liu 037e7a4a2c acrn-config: modify the key of vuart base
Return correct key of vuart base to webUI for parsing.

Tracked-On: #4128
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-20 10:01:24 +08:00
Jidong Xia 26c45a0c70 hv: modify printf "not support the vuart index parameter" in vuart_register_io_handler
call vuart_register_io_handler function, when the parameter vuart_idx is greater
than or equal to 2, print the vuart index value which will not register the vuart.

Tracked-On: #4072
Signed-off-by: Jidong Xia <xiajidong@cmss.chinamobile.com>
2019-11-20 09:45:00 +08:00
Deb Taylor 40439e1d84 Doc: Content edits to the AGL as VMs docs
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-11-19 13:07:54 -05:00
hongliang 1d8f16a2e9 doc: edit agl-vms.rst adjust to v1.3 2019-11-19 11:58:03 -05:00
Yonghua Huang da469d9e3e doc: add mitigation description for CVE-2018-12207 in advisory
Mitigation for this vulnerability is applied in 1.4 release, update
 related notes in adviosry.

Tracked-On: #4101
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-11-18 12:54:45 -05:00
Li Fei1 5aa92b85ea hv: vpci: move vBAR base setting into pci_vdev_write_bar
Updating vBAR base when setting vBAR configuration sapce.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-15 13:54:21 +08:00
Li Fei1 5fdb6cc0ac hv: vpci: remove 64 bits PCI BAR map logic constraint
After reshuffle pci_bar structrue we could write ~0U not BAR size mask to BAR
configuration space directly when do BAR sizing. In this case, we could know whether
the value in BAR configuration space is a valid base address. As a result, we could
do BAR re-programming whenever we want.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-15 13:54:21 +08:00
Li Fei1 c049c5c965 hv: vpci: reshuffle pci_bar structure
The current code declare pci_bar structure following the PCI bar spec. However,
we could not tell whether the value in virtual BAR configuration space is valid
base address base on current pci_bar structure. We need to add more fields which
are duplicated instances of the vBAR information. Basides these fields which will
added, bar_base_mapped is another duplicated instance of the vBAR information.
This patch try to reshuffle the pci_bar structure to declare pci_bar structure
following the software implement benefit not the PCI bar spec.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-15 13:54:21 +08:00
Li Fei1 f53baadd5a hv: vpci: refine PCI IO BAR map
The current do PCI IO BAR remap in vdev_pt_allow_io_vbar. This patch split this
function into vdev_pt_deny_io_vbar and vdev_pt_allow_io_vbar. vdev_pt_deny_io_vbar
removes the old IO port mapping, vdev_pt_allow_io_vbar add the new IO port mapping.

Tracked-On: #3475
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-15 13:54:21 +08:00
Mingqiang Chi a59205f6a2 dm:use acrn-dm logger function instread of fprintf
use acrn-dm logger function instread of fprintf,
this helps the stability testing log capture.

Tracked-On: #4098
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Cao Minggui <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-11-14 15:34:04 +08:00
Mingqiang Chi 5375a1613b dm:use acrn-dm logger function instread of printf
Use acrn-dm logger function instread of printf,
this helps the stability testing log capture.

Tracked-On: #4098
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Cao Minggui <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-11-14 15:34:04 +08:00
Sainath Grandhi 22a1bd6948 hv: Fix the definition of struct representing interrupt hw frame
In 64-bit mode, processor pushes SS and RSP onto stack unconditionally.
Also when dumping the exception info, it makes more sense to dump
the RSP at the point of interrupt, rather than the RSP after pushing
context (including GPRs)

Tracked-On: #4102
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-11-13 16:06:35 +08:00
Victor Sun 0d52f933da Makefile: move .mk file to hv scripts folder
The *.mk files under misc/acrn-config/library are all rules for hypervisor
makefiles only, so move these files to hypervisor/scripts/makefile/ folder.

The folder of acrn-config/library/ will be used to store python script lib only.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Terry Zou <terry.zou@intel.com>
2019-11-13 16:05:30 +08:00
Victor Sun acd0deb8a1 Makefile: board specific acpi info header clean up
The board specific $(BOARD)_acpi_info.h is generated by acrn-config tool,
we should clean it up before build hypervisor, otherwise the file could be
referenced by next build process if no config XMLs is specified.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-13 16:05:30 +08:00
Lei, Lu bab0118b51 CODEOWNERS: add acrn-hypervisor Makefile owner
Tracked-On: #3419

Signed-off-by: Lei, Lu <leix.lu@intel.com>
2019-11-13 09:49:46 +08:00
Binbin Wu fa3888c12a hv: ept: disable execute right on large pages
Issue description:
-----------------
Machine Check Error on Page Size Change
Instruction fetch may cause machine check error if page size
and memory type was changed without invalidation on some
processors[1][2]. Malicious guest kernel could trigger this issue.

This issue applies to both primary page table and extended page
tables (EPT), however the primary page table is controlled by
hypervisor only. This patch mitigates the situation in EPT.

Mitigation details:
------------------
Implement non-execute huge pages in EPT.
This patch series clears the execute permission (bit 2) in the
EPT entries for large pages. When EPT violation is triggered by
guest instruction fetch, hypervisor converts the large page to
smaller 4 KB pages and restore the execute permission, and then
re-execute the guest instruction.

The current patch turns on the mitigation by default.
The follow-up patches will conditionally turn on/off the feature
per processor model.

[1] Refer to erratum KBL002 in "7th Generation Intel Processor
Family and 8th Generation Intel Processor Family for U Quad Core
Platforms Specification Update"
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/7th-gen-core-family-spec-update.pdf
[2] Refer to erratum SKL002 in "6th Generation Intel Processor
Family Specification Update"
https://www.intel.com/content/www/us/en/products/docs/processors/core/desktop-6th-gen-core-family-spec-update.html

Tracked-On: #4101
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-11-13 08:00:36 +08:00
Kaige Fu e9b035bab6 DM: samples: Correct parameter of intel_pstate
The parameter of intel_pstate should be 'disable' instead of 'disabled'.
This patch fixes it.

Tracked-On: #4094
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-11-12 22:04:51 +08:00
Wei Liu cdd086a81d acrn-config: by-pass acpi_idle/acpi_cpufreq for parsing target board
Current board parse logic would be broken if acpi_idle/acpi-cpufreq
driver is not loaded by native kernel.
This patch would just leave a warning to user and continue to parse
other information in this case.

Tracked-On: #4082
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Wei Liu 631c461314 acrn-config: Cx desc parsing enhancement
Previous code parse the Cx value by hardcoded position in sysfs desc
node, but this might be changed in different kernel.

This patch will parse the Cx value position by index key word like
MWAIT/IOPORT.

Tracked-On: #4074
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Wei Liu d9cb750ed9 acrn-config: alloc vuart1 irq when pttyS1 not exist only
If pttyS1 do not exist, we can alloc irq for vuart1, but if pttyS1
exist, we should reuse the irq of pttyS1 to keep compliance.

Tracked-On: #4073
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Victor Sun 5dd1c5350c Makefile: pass BOARD/SCENARIO FILE to make hv
If we don't enforce passing BOARD_FILE/SCENARIO_FILE param to
hypervisor/Makefile, the BOARD_FILE/SCENARIO_FILE value would
not be overridden to its realpath in hypervisor/Makefile when
make hypervisor.

Tracked-On: #4067

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-12 14:02:34 +08:00
Victor Sun 0011607a16 Makefile: refine include path for efi_stub
Move hypervisor related include path from CFLAGS to INCLUDE_PATH to make
structure more clean.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-12 10:51:04 +08:00
Deb Taylor bb3befa306 Doc: Grammatical edits to the 1.4 Release Notes.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-11-11 11:47:12 -05:00
lirui34 c1470c8a02 doc: Release notes v1.4
Signed-off-by: lirui34 <ruix.li@intel.com>
2019-11-11 11:06:25 -05:00
Deb Taylor d3d33ffce9 Doc: Grammatical edits to the Advisory doc.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-11-11 10:59:06 -05:00
lirui34 95d26da472 doc: Add Advisory notes
Signed-off-by: lirui34 <ruix.li@intel.com>
2019-11-11 10:39:16 -05:00
Deb Taylor 3c50ae57cd Doc: Grammatical edits to the Enable S5 Guide.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-11-11 10:31:46 -05:00
lirui34 cb207b4383 doc: enable s5 guide
Add instruction of enabling s5.

Signed-off-by: lirui34 <ruix.li@intel.com>
2019-11-11 08:11:52 -05:00
lirui34 70312bfb7e dm: Add licenses to the scripts.
Add licenses to the scripts:
```
devicemodel/samples/apl-mrb/launch_uos.sh
devicemodel/samples/apl-up2/launch_uos.sh
devicemodel/samples/nuc/launch_hard_rt_vm.sh
devicemodel/samples/nuc/launch_uos.sh
devicemodel/samples/nuc/launch_vxworks.sh
devicemodel/samples/nuc/launch_win.sh
devicemodel/samples/nuc/launch_zephyr.sh
hypervisor/scripts/genld.sh
```

Tracked-On: #4061
Signed-off-by: lirui34 <ruix.li@intel.com>
2019-11-11 15:35:19 +08:00
Victor Sun 9a3cc8f748 makefile: cover menuconfig way to configure board/scenario
We now have four methods to configure board and scenario when
build acrn (sorted with priority):
1. Change them with "make menuconfig" in hypervisor directory
2. Give baord_file/scenario_file as make command parameters
3. Give BOARD/SCENARIO as make command parameters
4. Use BOARD/SCENARIO default value defined in Makefile file

With this patch, we make sure we follow priority exactly.

Tracked-On: #4067

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-11 15:01:50 +08:00
Victor Sun ed8fb94778 Makefile: support make from XML for new board
Currently make hypervisor will depend on a $(BOARD).config file to load
board defconfig which triggered by oldconfig process, this will block
make from XMLs for a new board because $(BOARD).config never exist.
This requires us to patch configuration for new board earlier than make
oldconfig.

Tracked-On: #4067
Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-11 15:01:50 +08:00
Peter Fang b7329f10a5 hv: instr_emul: use cs segment when fetching instructions
In non-64-bit mode, CS segment base address should be considered when
determining the linear address of the vcpu's instruction pointer. Use
vie_calculate_gla() for instruction address translation which also takes
care of 64-bit mode.

Tracked-On: #4064
Signed-off-by: Peter Fang <peter.fang@intel.com>
2019-11-11 13:55:24 +08:00
Wei Liu 05bb56291b acrn-config: include msr.h in board.c
without the msr.h file the build will be failed when CAT is enabled.

Tracked-On: #4066
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:44:03 +08:00
Wei Liu 5cc2c0dca5 acrn-config: chose ttyS1 for vuart1
For vuart1, if it's mapped to a real native serial port, we must
re-use the native serial port io base and irq number. If no native
serial port is mapped to vuart1, non-exist io base and irq should
be used.

Please note: UOS launch script may need be updated according to
which serial port index is used by vuart1.

Now, we are using ttyS1 of SOS for vuart1 in our release. User may
need to remap vuart to different ttySx by following above rule if
ttyS1 in user platform is used by other devices like Bluetooth/Wifi.

Tracked-On: #4016
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-On: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 485529415e acrn-config: add 'xhci' usb mediator for laag and waag
Enable xhci usb mediator for whl-ipc-i5/whl-ipc-7 and KBL NUC for LaaG
and WaaG.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 572abc70d7 acrn-config: add serial config in new $(board).config
Enhance the $(board).config for new board.
Serial config should be set in $(board).config for new board.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu c3495c6839 acrn-config: refine mem_size_set function
mem_size should be set from xml, it should not be overrided dynamically.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 61926d2b11 acrn-config: refine interrupt_storm function
interrupt_storm should be enabled while passthrough device was set.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 83797610da acrn-config: add support to generate launch script
Add support to generate launch script for whl-ipc-i5/whl-ipc-i7.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 9c8059499a acrn-config: remove runC script from unnecessary launch script
1. run_cotainer is linux type uos, remove related runC script from
unnercessary luanch script.

Tracked-On: #3930
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 2fcbd5c3f5 acrn-config: add config files for whl-ipc-i7 board
Add board/scenario/launch config files for whl-ipc-i7.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 28c1d001b5 acrn-config: add config files for whl-ipc-i5 board
Add board/scenario/launch config files for whl-ipc-i5.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu b9c77e008d acrn-config: 'keep_gsi' flag set for Android vm
keep_gsi is needed as a workaround for the device that support both
MSI and legacy interrupt, so keep the flag for Android only because
it is not sure for some wifi/audio device on other Linux guest.

Tracked-On: #3956
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 11:08:21 +08:00
Mingqiang Chi 8666ba6c01 hv:remove unnecessary wrapper for emulate_instruction
remove unnecessary wrapper for this api(emulate_instruction)

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-11-09 11:43:37 +08:00
Yonghua Huang 0eb427f122 hv:refine 'uint64_t' string print format in comm moudle
Use "0x%lx" string to format 'uint64_t' type value,
  instead of "0x%llx".

Tracked-On: #4020
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-11-09 11:42:38 +08:00
Yonghua Huang e51386fe04 hv: refine 'uint64_t' string print format in x86 moudle
Use "0x%lx" string to format 'uint64_t' type value,
 instead of "0x%llx".

Tracked-On: #4020
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-11-09 11:42:38 +08:00